2
0

WFCCEnums.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. //
  2. // WFCCEnums.h
  3. // WFChatClient
  4. //
  5. // Created by Heavyrian Lee on 2020/6/25.
  6. // Copyright © 2020 WildFireChat. All rights reserved.
  7. //
  8. #ifndef WFCCEnums_h
  9. #define WFCCEnums_h
  10. typedef NS_ENUM(NSInteger, WFCCErrorCode) {
  11. //0~255 server error
  12. ERROR_CODE_SUCCESS = 0, // //"success"),
  13. ERROR_CODE_SECRECT_KEY_MISMATCH = 1, //"secrect key mismatch"),
  14. ERROR_CODE_INVALID_DATA = 2, //"invalid data"),
  15. ERROR_CODE_NODE_NOT_EXIST = 3, //"node not exist"),
  16. ERROR_CODE_SERVER_ERROR = 4, //"server error"),
  17. ERROR_CODE_NOT_MODIFIED = 5, //"not modified"),
  18. //Auth error
  19. ERROR_CODE_TOKEN_ERROR = 6, //"token error"),
  20. ERROR_CODE_USER_FORBIDDEN = 8, //"user forbidden"),
  21. //Message error
  22. ERROR_CODE_NOT_IN_GROUP = 9, //"not in group"),
  23. ERROR_CODE_INVALID_MESSAGE = 10, //"invalid message"),
  24. //Group error
  25. ERROR_CODE_GROUP_ALREADY_EXIST = 11, //"group aleady exist"),
  26. //user error
  27. ERROR_CODE_PASSWORD_INCORRECT = 15, //"password incorrect"),
  28. //user error
  29. ERROR_CODE_FRIEND_ALREADY_REQUEST = 16, //"already send request"),
  30. ERROR_CODE_FRIEND_REQUEST_BLOCKED = 18, //"friend request blocked"),
  31. ERROR_CODE_FRIEND_REQUEST_EXPIRED = 19, //"friend request expired"),
  32. ERROR_CODE_NOT_IN_CHATROOM = 20, //"not in chatroom"),
  33. ERROR_CODE_NOT_IN_CHANNEL = 21, //"not in channel"),
  34. ERROR_CODE_NOT_LICENSED = 22, //"not licensed"),
  35. ERROR_CODE_ALREADY_FRIENDS = 23, //"already friends"),
  36. ERROR_CODE_GROUP_EXCEED_MAX_MEMBER_COUNT = 240, //"group exceed max member count"),
  37. ERROR_CODE_GROUP_MUTED = 241, //"group is muted"),
  38. ERROR_CODE_SENSITIVE_MATCHED = 242, //"sensitive matched"),
  39. ERROR_CODE_SIGN_EXPIRED = 243, //"sign expired"),
  40. ERROR_CODE_AUTH_FAILURE = 244, //"auth failure"),
  41. ERROR_CODE_CLIENT_COUNT_OUT_OF_LIMIT = 245, //"client count out of limit"),
  42. ERROR_CODE_IN_BLACK_LIST = 246, //"user in balck list"),
  43. ERROR_CODE_FORBIDDEN_SEND_MSG = 247, //"forbidden send msg globally"),
  44. ERROR_CODE_NOT_RIGHT = 248, //"no right to operate"),
  45. ERROR_CODE_TIMEOUT = 249, //"timeout"),
  46. ERROR_CODE_OVER_FREQUENCY = 250, //"over frequency"),
  47. ERROR_CODE_INVALID_PARAMETER = 251, //"Invalid parameter"),
  48. ERROR_CODE_NOT_EXIST = 253, //"not exist"),
  49. ERROR_CODE_NOT_IMPLEMENT = 254, //"not implement"),
  50. //负值为mars返回错误
  51. ERROR_CODE_Local_TaskTimeout = -1,
  52. ERROR_CODE_Local_TaskRetry = -2,
  53. ERROR_CODE_Local_StartTaskFail = -3,
  54. ERROR_CODE_Local_AntiAvalanche = -4,
  55. ERROR_CODE_Local_ChannelSelect = -5,
  56. ERROR_CODE_Local_NoNet = -6,
  57. ERROR_CODE_Local_Cancel = -7,
  58. ERROR_CODE_Local_Clear = -8,
  59. ERROR_CODE_Local_Reset = -9,
  60. ERROR_CODE_Local_TaskParam = -12,
  61. ERROR_CODE_Local_CgiFrequcencyLimit = -13,
  62. ERROR_CODE_Local_ChannelID = -14,
  63. ERROR_CODE_Long_FirstPkgTimeout = -500,
  64. ERROR_CODE_Long_PkgPkgTimeout = -501,
  65. ERROR_CODE_Long_ReadWriteTimeout = -502,
  66. ERROR_CODE_Long_TaskTimeout = -503,
  67. ERROR_CODE_Socket_NetworkChange = -10086,
  68. ERROR_CODE_Socket_MakeSocketPrepared = -10087,
  69. ERROR_CODE_Socket_WritenWithNonBlock = -10088,
  70. ERROR_CODE_Socket_ReadOnce = -10089,
  71. ERROR_CODE_Socket_RecvErr = -10091,
  72. ERROR_CODE_Socket_SendErr = -10092,
  73. ERROR_CODE_Socket_NoopTimeout = -10093,
  74. ERROR_CODE_Socket_NoopAlarmTooLate = -10094,
  75. ERROR_CODE_Http_SplitHttpHeadAndBody = -10194,
  76. ERROR_CODE_Http_ParseStatusLine = -10195,
  77. ERROR_CODE_Net_MsgXPHandleBufferErr = -10504,
  78. ERROR_CODE_Dns_MakeSocketPrepared = -10606,
  79. //proto error code
  80. ERROR_CODE_Proto_CorruptData = -100001,
  81. ERROR_CODE_Proto_InvalideParameter = -100002,
  82. //消息内容超过最大值,最大值为200KB,建议不超过15KB。
  83. ERROR_CODE_Proto_Content_Exceed_Max_Size = -100003,
  84. //媒体内容超过最大值,最大值为100MB
  85. ERROR_CODE_Proto_Media_Exceed_Max_Size = -100004,
  86. };
  87. /**
  88. 添加好友来源
  89. - FriendSource_Unknown: 未知
  90. - FriendSource_Search: 搜索
  91. - FriendSource_Group: 群组,targetId为群主ID
  92. - FriendSource_QrCode: 二维码,targetId为分享二维码的用户Id
  93. - FriendSource_Card: 用户名片,targetId为分享名片的用户Id
  94. */
  95. typedef NS_ENUM(NSInteger, WFCCFriendSourceType) {
  96. FriendSource_Unknown,
  97. FriendSource_Search,
  98. FriendSource_Group,
  99. FriendSource_QrCode,
  100. FriendSource_Card,
  101. };
  102. /**
  103. 群成员来源
  104. - GroupMemberSource_Unknown: 搜索
  105. - GroupMemberSource_Search: 搜索
  106. - GroupMemberSource_Invite: 邀请,targetId为邀请人的用户id
  107. - GroupMemberSource_QrCode: 二维码,targetId为分享群二维码的用户id
  108. - GroupMemberSource_Card: 群名片,targetId为分享群名片的用户Id
  109. */
  110. typedef NS_ENUM(NSInteger, WFCCGroupMemberSourceType) {
  111. GroupMemberSource_Unknown,
  112. GroupMemberSource_Search,
  113. GroupMemberSource_Invite,
  114. GroupMemberSource_QrCode,
  115. GroupMemberSource_Card,
  116. };
  117. #endif /* WFCCEnums_h */