TIMFriendshipManager.h 86 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731
  1. // Copyright (c) 2023 Tencent. All rights reserved.
  2. #ifndef SRC_PLATFORM_CROSS_PLATFORM_INCLUDE_TIM_FRIENDSHIP_MANAGER_H_
  3. #define SRC_PLATFORM_CROSS_PLATFORM_INCLUDE_TIM_FRIENDSHIP_MANAGER_H_
  4. #include "TIMCloudDef.h"
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. // 模块简介
  9. // - 关系链接口,包含好友的添加、删除,黑名单的添加、删除等功能
  10. //
  11. // 模块参数说明
  12. // - API 的参数采用 json 字符串格式,请使用文件中预先定义的 JsonKey 进行参数传递和解析
  13. // - 如果参数中包含非英文字符,请使用 UTF-8 编码
  14. //
  15. // 模块回调说明
  16. // 1. 回调的类型:
  17. // - 调用 API 时传入的 TIMCommCallback 回调,用于异步返回 API 的调用结果
  18. // - 调用 TIMSetXXXCallback 设置的全局回调,用于接收后台推送的通知
  19. // 2. 回调触发的线程:
  20. // - 对于 Windows 平台,当在主线程中调用 @ref TIMInit 接口时,SDK 会将所有回调抛到主线程,请确保主线程已创建消息循环;否则,回调将在 SDK 内部的逻辑线程触发
  21. // - 对于 Android 平台,当调用 @ref TIMInit 接口的线程支持消息循环时,SDK 会将所有回调抛到该线程;否则,回调将在 SDK 内部的逻辑线程触发
  22. // - 对于 iOS 和 MAC 平台,SDK 默认将所有回调抛到主线程
  23. // - 对于 Linux 平台,暂不支持将回调抛到主线程,回调将在 SDK 内部的逻辑线程触发
  24. /////////////////////////////////////////////////////////////////////////////////
  25. //
  26. // 一. 关系链相关配置选项定义
  27. //
  28. /////////////////////////////////////////////////////////////////////////////////
  29. // 1.1 好友类型
  30. enum TIMFriendType {
  31. // 单向好友:用户A的好友表中有用户B,但B的好友表中却没有A
  32. FriendTypeSingle,
  33. // 双向好友:用户A的好友表中有用户B,B的好友表中也有A
  34. FriendTypeBoth,
  35. };
  36. // 1.2 好友申请未决类型
  37. enum TIMFriendPendencyType {
  38. // 别人发给我的
  39. FriendPendencyTypeComeIn,
  40. // 我发给别人的
  41. FriendPendencyTypeSendOut,
  42. // 双向的
  43. FriendPendencyTypeBoth,
  44. };
  45. // 1.3 响应好友申请的动作类型
  46. enum TIMFriendResponseAction {
  47. // 同意
  48. ResponseActionAgree,
  49. // 同意并添加
  50. ResponseActionAgreeAndAdd,
  51. // 拒绝
  52. ResponseActionReject,
  53. };
  54. // 1.4 好友的类型
  55. enum TIMFriendCheckRelation {
  56. // 无关系
  57. FriendCheckNoRelation,
  58. // 仅A中有B
  59. FriendCheckAWithB,
  60. // 仅B中有A
  61. FriendCheckBWithA,
  62. // 双向
  63. FriendCheckBothWay,
  64. };
  65. // 1.5 好友搜索的枚举
  66. enum TIMFriendshipSearchFieldKey {
  67. // 用户 ID
  68. kTIMFriendshipSearchFieldKey_Identifier = 0x01,
  69. // 昵称
  70. kTIMFriendshipSearchFieldKey_NickName = 0x01 << 1,
  71. // 备注
  72. kTIMFriendshipSearchFieldKey_Remark = 0x01 << 2,
  73. };
  74. // 1.6 两个用户之间的好友关系
  75. enum TIMFriendshipRelationType {
  76. // 未知关系
  77. kTIMFriendshipRelationType_None,
  78. // 单向好友:对方是我的好友,我不是对方的好友
  79. kTIMFriendshipRelationType_InMyFriendList,
  80. // 单向好友:对方不是我的好友,我是对方的好友
  81. kTIMFriendshipRelationType_InOtherFriendList,
  82. // 双向好友
  83. kTIMFriendshipRelationType_BothFriend,
  84. };
  85. // 1.7 关注类型
  86. enum TIMFollowType {
  87. // 无任何关注关系
  88. kTIMFollowLTypeNone,
  89. // 对方在我的关注列表中
  90. kTIMFollowLTypeInMyFollowingList,
  91. // 对方在我的粉丝列表中
  92. kTIMFollowLTypeInMyFollowersList,
  93. // 对方与我互相关注
  94. kTIMFollowLTypeInBothFollowersList,
  95. };
  96. /////////////////////////////////////////////////////////////////////////////////
  97. //
  98. // 二. 关系链事件回调定义
  99. //
  100. /////////////////////////////////////////////////////////////////////////////////
  101. /**
  102. * 2.1 添加好友的回调
  103. *
  104. * @param json_identifier_array 添加好友列表
  105. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  106. *
  107. * __json_identifier_array 示例__
  108. * @code{.json}
  109. * [ "user15" ]
  110. * @endcode
  111. */
  112. typedef void(*TIMOnAddFriendCallback)(const char* json_identifier_array, const void* user_data);
  113. /**
  114. * 2.2 删除好友的回调
  115. *
  116. * @param json_identifier_array 删除好友列表
  117. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  118. *
  119. * __json_identifier_array 示例__
  120. * @code{.json}
  121. * [ "user15" ]
  122. * @endcode
  123. */
  124. typedef void(*TIMOnDeleteFriendCallback)(const char* json_identifier_array, const void* user_data);
  125. /**
  126. * 2.3 更新好友资料的回调
  127. *
  128. * @param json_friend_profile_update_array 好友资料更新列表
  129. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  130. *
  131. * __json_friend_profile_update_array 示例 (Json Key 请参考 @ref FriendProfileItem)__
  132. * @code{.json}
  133. * [
  134. * {
  135. * "friend_profile_update_identifier" : "user4",
  136. * "friend_profile_update_item" : {
  137. * "friend_profile_item_group_name_array" : [ "group1", "group2" ],
  138. * "friend_profile_item_remark" : "New Remark"
  139. * }
  140. * }
  141. * ]
  142. * @endcode
  143. */
  144. typedef void(*TIMUpdateFriendProfileCallback)(const char* json_friend_profile_update_array, const void* user_data);
  145. /**
  146. * 2.4 好友添加请求的回调
  147. *
  148. * @param json_friend_add_request_pendency_array 好友添加请求未决信息列表
  149. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  150. *
  151. * __json_friend_add_request_pendency_array 示例 (Json Key 请参考 @ref FriendAddPendency)__
  152. * @code{.json}
  153. * [
  154. * {
  155. * "friend_add_pendency_add_source" : "AddSource_Type_android",
  156. * "friend_add_pendency_add_wording" : "aaaa",
  157. * "friend_add_pendency_identifier" : "v222",
  158. * "friend_add_pendency_nick_name" : ""
  159. * }
  160. * ]
  161. * @endcode
  162. */
  163. typedef void(*TIMFriendAddRequestCallback)(const char* json_friend_add_request_pendency_array, const void* user_data);
  164. /**
  165. * 2.5 好友申请删除通知
  166. *
  167. * @param json_identifier_array 删除好友请求的 userid 列表
  168. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  169. *
  170. * @note
  171. * 以下四种情况会收到这个回调:
  172. * 1. 主动删除好友申请
  173. * 2. 拒绝好友申请
  174. * 3. 同意好友申请
  175. * 4. 申请加别人好友被拒绝
  176. *
  177. * __json_identifier_array 的示例__
  178. * @code{.json}
  179. * [ "user15" ]
  180. * @endcode
  181. */
  182. typedef void(*TIMFriendApplicationListDeletedCallback)(const char* json_identifier_array, const void* user_data);
  183. /**
  184. * 2.6 好友申请已读通知
  185. *
  186. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  187. *
  188. * @note
  189. * 如果调用 @ref TIMFriendshipReportPendencyReaded 设置好友申请列表已读,会收到这个回调(主要用于多端同步)
  190. */
  191. typedef void(*TIMFriendApplicationListReadCallback)(const void* user_data);
  192. /**
  193. * 2.7 黑名单新增通知
  194. *
  195. * @param json_friend_black_added_array 新增黑名单列表
  196. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  197. *
  198. * __json_friend_black_added_array 示例 (Json Key 请参考 @ref FriendProfile)__
  199. * @code{.json}
  200. * [{
  201. * "friend_profile_add_source": "",
  202. * "friend_profile_add_time": 0,
  203. * "friend_profile_add_wording": "",
  204. * "friend_profile_custom_string_array": [{
  205. * "friend_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
  206. * "friend_profile_custom_string_info_value": "test3-lamar-value"
  207. * }],
  208. * "friend_profile_group_name_array": [],
  209. * "friend_profile_identifier": "98826",
  210. * "friend_profile_remark": "",
  211. * "friend_profile_user_profile": {
  212. * "user_profile_add_permission": 1,
  213. * "user_profile_birthday": 2000,
  214. * "user_profile_custom_string_array": [{
  215. * "user_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
  216. * "user_profile_custom_string_info_value": "test3-lamar-value"
  217. * }],
  218. * "user_profile_face_url": "test1-www.google.com",
  219. * "user_profile_gender": 2,
  220. * "user_profile_identifier": "98826",
  221. * "user_profile_language": 1000,
  222. * "user_profile_level": 3000,
  223. * "user_profile_location": "shenzhen",
  224. * "user_profile_nick_name": "test change8888",
  225. * "user_profile_role": 4000,
  226. * "user_profile_self_signature": "1111111"
  227. * }
  228. * }]
  229. * @endcode
  230. */
  231. typedef void(*TIMFriendBlackListAddedCallback)(const char* json_friend_black_added_array, const void* user_data);
  232. /**
  233. * 2.8 黑名单删除通知
  234. *
  235. * @param json_identifier_array 黑名单列表
  236. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  237. *
  238. * __json_identifier_array 示例__
  239. * @code{.json}
  240. * [ "user15" ]
  241. * @endcode
  242. */
  243. typedef void(*TIMFriendBlackListDeletedCallback)(const char* json_identifier_array, const void* user_data);
  244. /**
  245. * 2.9 好友分组被创建的通知
  246. *
  247. * @param group_name 创建的好友分组名
  248. * @param json_friend_info_array 指定进入该分组的好友信息列表,好友资料 Json Key 请参考 @ref FriendProfile
  249. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  250. */
  251. typedef void(*TIMFriendGroupCreatedCallback)(const char* group_name, const char* json_friend_info_array, const void* user_data);
  252. /**
  253. * 2.10 好友分组被删除的通知
  254. *
  255. * @param json_group_name_array 删除的好友分组名列表
  256. */
  257. typedef void(*TIMFriendGroupDeletedCallback)(const char* json_group_name_array, const void* user_data);
  258. /**
  259. * 2.11 好友分组名变更的通知
  260. *
  261. * @param old_group_name 修改前的分组名
  262. * @param new_group_name 修改后的分组名
  263. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  264. */
  265. typedef void(*TIMFriendGroupNameChangedCallback)(const char* old_group_name, const char* new_group_name, const void* user_data);
  266. /**
  267. * 2.12 好友分组新增好友的通知
  268. *
  269. * @param group_name 好友分组名
  270. * @param json_friend_info_array 向该分组中添加的好友信息列表,好友资料 Json Key 请参考 @ref FriendProfile
  271. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  272. */
  273. typedef void(*TIMFriendsAddedToGroupCallback)(const char* group_name, const char* json_friend_info_array, const void* user_data);
  274. /**
  275. * 2.13 好友分组删除好友的通知
  276. *
  277. * @param group_name 好友分组名
  278. * @param json_friend_id_array 从该分组中删除的好友 ID 列表
  279. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  280. */
  281. typedef void(*TIMFriendsDeletedFromGroupCallback)(const char* group_name, const char* json_friend_id_array, const void* user_data);
  282. /**
  283. * 2.14 订阅公众号的回调
  284. *
  285. * @param json_official_account_info 公众号资料,Json Key 请参考 @ref OfficialAccountInfo
  286. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  287. */
  288. typedef void (*TIMOfficialAccountSubscribedCallback)(const char* json_official_account_info, const void* user_data);
  289. /**
  290. * 2.15 取消订阅公众号的回调
  291. *
  292. * @param official_account_id 公众号 ID
  293. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  294. */
  295. typedef void (*TIMOfficialAccountUnsubscribedCallback)(const char* official_account_id, const void* user_data);
  296. /**
  297. * 2.16 订阅的公众号被删除的回调
  298. *
  299. * @param official_account_id 公众号 ID
  300. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  301. */
  302. typedef void (*TIMOfficialAccountDeletedCallback)(const char* official_account_id, const void* user_data);
  303. /**
  304. * 2.17 订阅的公众号资料更新的回调
  305. *
  306. * @param json_official_account_info 公众号资料,Json Key 请参考 @ref OfficialAccountInfo
  307. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  308. */
  309. typedef void (*TIMOfficialAccountInfoChangedCallback)(const char* json_official_account_info, const void* user_data);
  310. /**
  311. * 2.18 关注列表变更的回调
  312. *
  313. * @param json_user_info_list 变更的用户列表,Json Key 请参考 @ref UserInfo
  314. * @param is_add 变更用户是否为新增
  315. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  316. */
  317. typedef void (*TIMMyFollowingListChangedCallback)(const char* json_user_info_list, bool is_add, const void* user_data);
  318. /**
  319. * 2.19 粉丝列表变更的回调
  320. *
  321. * @param json_user_info_list 变更的用户列表,Json Key 请参考 @ref UserInfo
  322. * @param is_add 变更用户是否为新增
  323. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  324. */
  325. typedef void (*TIMMyFollowersListChangedCallback)(const char* json_user_info_list, bool is_add, const void* user_data);
  326. /**
  327. * 2.20 互关列表变更的回调
  328. *
  329. * @param json_user_info_list 变更的用户列表,Json Key 请参考 @ref UserInfo
  330. * @param is_add 变更用户是否为新增
  331. * @param user_data ImSDK负责透传的用户自定义数据,未做任何处理
  332. */
  333. typedef void (*TIMMutualFollowersListChangedCallback)(const char* json_user_info_list, bool is_add, const void* user_data);
  334. /////////////////////////////////////////////////////////////////////////////////
  335. //
  336. // 三. 注册关系链事件回调 API
  337. //
  338. /////////////////////////////////////////////////////////////////////////////////
  339. /**
  340. * 3.1 设置添加好友的回调
  341. *
  342. * @param cb 添加好友回调,请参考 @ref TIMOnAddFriendCallback
  343. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  344. *
  345. * @note
  346. * 此回调为了多终端同步。例如A设备、B设备都登录了同一账号的ImSDK,A设备添加了好友,B设备ImSDK会收到添加好友的推送,ImSDK通过此回调告知开发者。
  347. */
  348. TIM_API void TIMSetOnAddFriendCallback(TIMOnAddFriendCallback cb, const void* user_data);
  349. /**
  350. * 3.2 设置删除好友的回调
  351. *
  352. * @param cb 删除好友回调,请参考 @ref TIMOnDeleteFriendCallback
  353. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  354. *
  355. * @note
  356. * 此回调为了多终端同步。例如A设备、B设备都登录了同一账号的ImSDK,A设备删除了好友,B设备ImSDK会收到删除好友的推送,ImSDK通过此回调告知开发者。
  357. */
  358. TIM_API void TIMSetOnDeleteFriendCallback(TIMOnDeleteFriendCallback cb, const void* user_data);
  359. /**
  360. * 3.3 设置更新好友资料的回调
  361. *
  362. * @param cb 更新好友资料回调,请参考 @ref TIMUpdateFriendProfileCallback
  363. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  364. *
  365. * @note
  366. * 此回调为了多终端同步。例如A设备、B设备都登录了同一账号的ImSDK,A设备更新了好友资料,B设备ImSDK会收到更新好友资料的推送,ImSDK通过此回调告知开发者。
  367. */
  368. TIM_API void TIMSetUpdateFriendProfileCallback(TIMUpdateFriendProfileCallback cb, const void* user_data);
  369. /**
  370. * 3.4 设置好友添加请求的回调
  371. *
  372. * @param cb 好友添加请求回调,请参考 @ref TIMFriendAddRequestCallback
  373. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  374. *
  375. * @note
  376. * 当前登入用户设置添加好友需要确认时,如果有用户请求加当前登入用户为好友,会收到好友添加请求的回调,ImSDK通过此回调告知开发者。如果多终端登入同一账号,每个终端都会收到这个回调。
  377. */
  378. TIM_API void TIMSetFriendAddRequestCallback(TIMFriendAddRequestCallback cb, const void* user_data);
  379. /**
  380. * 3.5 设置好友申请被删除的回调
  381. *
  382. * @param cb 好友申请删除回调,请参考 @ref TIMFriendApplicationListDeletedCallback
  383. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  384. *
  385. * @note
  386. * 以下四种情况会收到此回调:
  387. * 1. 主动删除好友申请
  388. * 2. 拒绝好友申请
  389. * 3. 同意好友申请
  390. * 4. 申请加别人好友被拒绝
  391. */
  392. TIM_API void TIMSetFriendApplicationListDeletedCallback(TIMFriendApplicationListDeletedCallback cb, const void* user_data);
  393. /**
  394. * 3.6 设置好友申请已读的回调
  395. *
  396. * @param cb 好友申请已读回调,请参考 @ref TIMFriendApplicationListReadCallback
  397. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  398. *
  399. * @note
  400. * 如果调用 @ref TIMFriendshipReportPendencyReaded 设置好友申请列表已读,会收到这个回调(主要用于多端同步)
  401. */
  402. TIM_API void TIMSetFriendApplicationListReadCallback(TIMFriendApplicationListReadCallback cb, const void* user_data);
  403. /**
  404. * 3.7 设置黑名单新增的回调
  405. *
  406. * @param cb 黑名单新增的回调,请参考 @ref TIMFriendBlackListAddedCallback
  407. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  408. */
  409. TIM_API void TIMSetFriendBlackListAddedCallback(TIMFriendBlackListAddedCallback cb, const void* user_data);
  410. /**
  411. * 3.8 设置黑名单删除的回调
  412. *
  413. * @param cb 黑名单删除的回调,请参考 @ref TIMFriendBlackListDeletedCallback
  414. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  415. */
  416. TIM_API void TIMSetFriendBlackListDeletedCallback(TIMFriendBlackListDeletedCallback cb, const void* user_data);
  417. /**
  418. * 3.9 设置好友分组被创建的回调
  419. *
  420. * @param cb 好友分组新增回调,请参考 @ref TIMFriendGroupCreatedCallback
  421. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  422. */
  423. TIM_API void TIMSetFriendGroupCreatedCallback(TIMFriendGroupCreatedCallback cb, const void* user_data);
  424. /**
  425. * 3.10 设置好友分组被删除的回调
  426. *
  427. * @param cb 好友分组删除回调,请参考 @ref TIMFriendGroupDeletedCallback
  428. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  429. */
  430. TIM_API void TIMSetFriendGroupDeletedCallback(TIMFriendGroupDeletedCallback cb, const void* user_data);
  431. /**
  432. * 3.11 好友分组名变更的回调
  433. *
  434. * @param cb 好友分组名变更回调,请参考 @ref TIMFriendGroupNameChangedCallback
  435. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  436. */
  437. TIM_API void TIMSetFriendGroupNameChangedCallback(TIMFriendGroupNameChangedCallback cb, const void* user_data);
  438. /**
  439. * 3.12 设置好友分组新增好友的回调
  440. *
  441. * @param cb 好友分组新增好友回调,请参考 @ref TIMFriendsAddedToGroupCallback
  442. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  443. */
  444. TIM_API void TIMSetFriendsAddedToGroupCallback(TIMFriendsAddedToGroupCallback cb, const void* user_data);
  445. /**
  446. * 3.13 设置好友分组删除好友的回调
  447. *
  448. * @param cb 好友分组删除好友回调,请参考 @ref TIMFriendsDeletedFromGroupCallback
  449. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  450. */
  451. TIM_API void TIMSetFriendsDeletedFromGroupCallback(TIMFriendsDeletedFromGroupCallback cb, const void* user_data);
  452. /**
  453. * 3.14 设置公众号订阅的回调
  454. *
  455. * @param cb 公众号订阅的回调,请参考 @ref TIMOfficialAccountSubscribedCallback
  456. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  457. */
  458. TIM_API void TIMSetOfficialAccountSubscribedCallback(TIMOfficialAccountSubscribedCallback cb, const void* user_data);
  459. /**
  460. * 3.15 设置公众号取消订阅的回调
  461. *
  462. * @param cb 公众号取消订阅的回调,请参考 @ref TIMOfficialAccountUnsubscribedCallback
  463. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  464. */
  465. TIM_API void TIMSetOfficialAccountUnsubscribedCallback(TIMOfficialAccountUnsubscribedCallback cb, const void *user_data);
  466. /**
  467. * 3.16 设置订阅的公众号被删除的回调
  468. *
  469. * @param cb 订阅的公众号被删除的回调,请参考 @ref TIMOfficialAccountDeletedCallback
  470. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  471. */
  472. TIM_API void TIMSetOfficialAccountDeletedCallback(TIMOfficialAccountDeletedCallback cb, const void *user_data);
  473. /**
  474. * 3.17 设置订阅的公众号资料更新的回调
  475. *
  476. * @param cb 订阅的公众号资料更新的回调,请参考 @ref TIMOfficialAccountInfoChangedCallback
  477. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  478. */
  479. TIM_API void TIMSetOfficialAccountInfoChangedCallback(TIMOfficialAccountInfoChangedCallback cb, const void *user_data);
  480. /**
  481. * 3.18 设置关注列表变更的回调
  482. *
  483. * @param cb 关注列表变更的回调,请参考 @ref TIMMyFollowingListChangedCallback
  484. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  485. */
  486. TIM_API void TIMSetMyFollowingListChangedCallback(TIMMyFollowingListChangedCallback cb, const void *user_data);
  487. /**
  488. * 3.19 设置粉丝列表变更的回调
  489. *
  490. * @param cb 关注列表变更的回调,请参考 @ref TIMMyFollowersListChangedCallback
  491. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  492. */
  493. TIM_API void TIMSetMyFollowersListChangedCallback(TIMMyFollowersListChangedCallback cb, const void *user_data);
  494. /**
  495. * 3.20 设置互关列表变更的回调
  496. *
  497. * @param cb 关注列表变更的回调,请参考 @ref TIMMutualFollowersListChangedCallback
  498. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  499. */
  500. TIM_API void TIMSetMutualFollowersListChangedCallback(TIMMutualFollowersListChangedCallback cb, const void *user_data);
  501. /////////////////////////////////////////////////////////////////////////////////
  502. //
  503. // 四. 好友添加、删除、列表获取、资料设置相关 API
  504. //
  505. /////////////////////////////////////////////////////////////////////////////////
  506. /**
  507. * 4.1 获取好友列表
  508. *
  509. * @param cb 获取好友列表成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  510. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  511. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  512. *
  513. * @note
  514. * 此接口通过回调返回所有好友资料 @ref FriendProfile
  515. */
  516. TIM_API int TIMFriendshipGetFriendProfileList(TIMCommCallback cb, const void* user_data);
  517. /**
  518. * 4.2 获取指定好友资料
  519. *
  520. * @param friend_id_list 获取好友的 userid 列表
  521. * @param cb 获取好友信息的回调。回调函数定义请参考 @ref TIMCommCallback
  522. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  523. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  524. *
  525. * __示例__
  526. * @code{.cpp}
  527. * json::Array json_array;
  528. * json_array.push_back("98826");
  529. * TIMFriendshipGetFriendsInfo(json_array.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
  530. * printf("GetFriendsInfo code:%d|desc:%s|json_param %s\r\n", code, desc, json_param);
  531. * }, nullptr);
  532. *
  533. * json_array.toStyledString().c_str() 得到 JSON 字符串如下:
  534. * ["98826"]
  535. * @endcode
  536. *
  537. * __回调的 json_param 示例 (Json Key 请参考 @ref FriendInfoGetResult)__
  538. * @code{.json}
  539. * [{
  540. * "friendship_friend_info_get_result_error_code": 0,
  541. * "friendship_friend_info_get_result_error_message": "OK",
  542. * "friendship_friend_info_get_result_field_info": {
  543. * "friend_profile_add_source": "AddSource_Type_contact",
  544. * "friend_profile_add_time": 1620786162,
  545. * "friend_profile_add_wording": "work together",
  546. * "friend_profile_custom_string_array": [{
  547. * "friend_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
  548. * "friend_profile_custom_string_info_value": "test3-lamar-value"
  549. * }],
  550. * "friend_profile_group_name_array": ["friend1"],
  551. * "friend_profile_identifier": "98826",
  552. * "friend_profile_remark": "shoujihao",
  553. * "friend_profile_user_profile": {
  554. * "user_profile_add_permission": 1,
  555. * "user_profile_birthday": 2000,
  556. * "user_profile_custom_string_array": [{
  557. * "user_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
  558. * "user_profile_custom_string_info_value": "test3-lamar-value"
  559. * }],
  560. * "user_profile_face_url": "test1-www.google.com",
  561. * "user_profile_gender": 2,
  562. * "user_profile_identifier": "98826",
  563. * "user_profile_language": 1000,
  564. * "user_profile_level": 3000,
  565. * "user_profile_location": "shenzhen",
  566. * "user_profile_nick_name": "test change8888",
  567. * "user_profile_role": 4000,
  568. * "user_profile_self_signature": "1111111"
  569. * }
  570. * },
  571. * "friendship_friend_info_get_result_relation_type": 3,
  572. * "friendship_friend_info_get_result_userid": "98826"
  573. * }]
  574. * @endcode
  575. */
  576. TIM_API int TIMFriendshipGetFriendsInfo(const char *friend_id_list, TIMCommCallback cb, const void* user_data);
  577. /**
  578. * 4.3 修改好友资料(备注等)
  579. *
  580. * @param json_modify_friend_info_param 更新好友资料接口参数的 Json 字符串, Json Key 请参考 @ref FriendProfileCustomStringInfo
  581. * @param cb 更新好友资料成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  582. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  583. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  584. *
  585. * @note
  586. * 修改好友资料,目前支持修改的字段请参考 @ref FriendProfileItem, 一次可修改多个字段。修改自定义字段时填入的key值可以添加 Tag_SNS_Custom_ 前缀,也可以不添加 Tag_SNS_Custom_ 前缀,当不添加时,SDK 内部会自动添加该前缀。
  587. *
  588. * __示例__
  589. * @code{.cpp}
  590. * json::Object json_modify_friend_profile_item;
  591. * json_modify_friend_profile_item[kTIMFriendProfileItemRemark] = "xxxx yyyy"; // 修改备注
  592. *
  593. * json::Array json_group_name_array;
  594. * json_group_name_array.push_back("group1");
  595. * json_group_name_array.push_back("group2");
  596. * json_modify_friend_profile_item[kTIMFriendProfileItemGroupNameArray] = json_group_name_array; // 修改好友分组名称列表
  597. *
  598. * json::Object json_custom_object;
  599. * json_custom_object[kTIMFriendProfileCustomStringInfoKey] = "Str"; // 修改好友资料自定义字段 " Str " 的值
  600. * json_custom_object[kTIMFriendProfileCustomStringInfoValue] = "this is changed value";
  601. *
  602. * json::Array json_custom_array;
  603. * json_custom_array.push_back(json_custom_object);
  604. * json_modify_friend_profile_item[kTIMFriendProfileItemCustomStringArray] = json_custom_array;
  605. *
  606. * json::Object json_modify_friend_info_param;
  607. * json_modify_friend_info_param[kTIMFriendshipModifyFriendProfileParamIdentifier] = "user4";
  608. * json_modify_friend_info_param[kTIMFriendshipModifyFriendProfileParamItem] = json_modify_friend_profile_item;
  609. * int ret = TIMFriendshipModifyFriendProfile(json::Serialize(json_modify_friend_info_param).c_str(), [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
  610. *
  611. * }, nullptr);
  612. * @endcode
  613. */
  614. TIM_API int TIMFriendshipModifyFriendProfile(const char* json_modify_friend_info_param, TIMCommCallback cb, const void* user_data);
  615. /**
  616. * 4.4 搜索好友(5.4.666 及以上版本支持,需要您购买旗舰版套餐)
  617. *
  618. * @param json_search_friends_param 搜索好友的关键字和域, Json Key 请参考 @ref FriendSearchParam
  619. * @param cb 搜索好友的回调。回调函数定义请参考 @ref TIMCommCallback
  620. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  621. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  622. *
  623. * @note
  624. * - 该接口返回的是本地存储的用户资料,包含好友和非好友资料.
  625. *
  626. * __示例__
  627. * @code{.cpp}
  628. * json::Object json_obj;
  629. *
  630. * json::Array json_keyword_list;
  631. * Json_keyword_list.push_back("98826");
  632. * json_obj[kTIMFriendshipSearchParamKeywordList] = json_keyword_list;
  633. *
  634. * json::Array json_search_field_list;
  635. * json_search_field_list.push_back(kTIMFriendshipSearchFieldKey_Identifier);
  636. * json_obj[kTIMFriendshipSearchParamSearchFieldList] = json_search_field_list;
  637. * TIMFriendshipSearchFriends(json_obj.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
  638. *
  639. * }, nullptr);
  640. *
  641. * json_obj.toStyledString().c_str() 得到 JSON 字符串如下:
  642. * {
  643. * "friendship_search_param_keyword_list": ["98826"],
  644. * "friendship_search_param_search_field_list": [1]
  645. * }
  646. * @endcode
  647. *
  648. * __回调的 json_param 示例 (Json Key 请参考 @ref FriendProfile)__
  649. * @code{.cpp}
  650. * [
  651. * {
  652. * "friend_profile_add_source":"AddSource_Type_contact",
  653. * "friend_profile_add_time":1620786162,
  654. * "friend_profile_add_wording":"work together",
  655. * "friend_profile_custom_string_array":[
  656. * {
  657. * "friend_profile_custom_string_info_key":"Tag_Profile_Custom_Str",
  658. * "friend_profile_custom_string_info_value":"test3-lamar-value"
  659. * }
  660. * ],
  661. * "friend_profile_group_name_array":[
  662. * "friend1"
  663. * ],
  664. * "friend_profile_identifier":"98826",
  665. * "friend_profile_remark":"shoujihao",
  666. * "friend_profile_user_profile":{
  667. * "user_profile_add_permission":1,
  668. * "user_profile_birthday":2000,
  669. * "user_profile_custom_string_array":[
  670. * {
  671. * "user_profile_custom_string_info_key":"Tag_Profile_Custom_Str",
  672. * "user_profile_custom_string_info_value":"test3-lamar-value"
  673. * }
  674. * ],
  675. * "user_profile_face_url":"test1-www.google.com",
  676. * "user_profile_gender":2,
  677. * "user_profile_identifier":"98826",
  678. * "user_profile_language":1000,
  679. * "user_profile_level":3000,
  680. * "user_profile_location":"深圳",
  681. * "user_profile_nick_name":"test change8888",
  682. * "user_profile_role":4000,
  683. * "user_profile_self_signature":"1111111"
  684. * }
  685. * }
  686. * ]
  687. * @endcode
  688. */
  689. TIM_API int TIMFriendshipSearchFriends(const char *json_search_friends_param, TIMCommCallback cb, const void* user_data);
  690. /**
  691. * 4.5 添加好友
  692. *
  693. * @param json_add_friend_param 添加好友接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipAddFriendParam
  694. * @param cb 添加好友成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  695. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  696. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  697. *
  698. * @note
  699. * 好友关系有单向和双向好友之分。详情请参考[添加好友](https://cloud.tencent.com/document/product/269/1501#.E6.B7.BB.E5.8A.A0.E5.A5.BD.E5.8F.8B).
  700. *
  701. * __示例__
  702. * @code{.cpp}
  703. * json::Object json_add_friend_param;
  704. * json_add_friend_param[kTIMFriendshipAddFriendParamIdentifier] = "user4";
  705. * json_add_friend_param[kTIMFriendshipAddFriendParamFriendType] = FriendTypeBoth;
  706. * json_add_friend_param[kTIMFriendshipAddFriendParamAddSource] = "Windows";
  707. * json_add_friend_param[kTIMFriendshipAddFriendParamAddWording] = "I am Iron Man";
  708. * int ret = TIMFriendshipAddFriend(json_add_friend_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  709. * if (ERR_SUCC != code) {
  710. * // 添加好友失败
  711. * return;
  712. * }
  713. * }, nullptr);
  714. * @endcode
  715. */
  716. TIM_API int TIMFriendshipAddFriend(const char* json_add_friend_param, TIMCommCallback cb, const void* user_data);
  717. /**
  718. * 4.6 删除好友
  719. *
  720. * @param json_delete_friend_param 删除好友接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipDeleteFriendParam
  721. * @param cb 删除好友成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  722. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  723. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  724. *
  725. * @note
  726. * 删除好友也有删除单向好友还是双向好友之分,[删除好友](https://cloud.tencent.com/document/product/269/1501#.E5.88.A0.E9.99.A4.E5.A5.BD.E5.8F.8B).
  727. *
  728. * __示例__
  729. * @code{.cpp}
  730. * json::Object json_delete_friend_param;
  731. * json_delete_friend_param[kTIMFriendshipDeleteFriendParamFriendType] = FriendTypeSingle;
  732. *
  733. * json::Array json_friend_array;
  734. * json_friend_array.push_back("user4");
  735. * json_delete_friend_param[kTIMFriendshipDeleteFriendParamIdentifierArray] = json_friend_array;
  736. * int ret = TIMFriendshipDeleteFriend(json_delete_friend_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  737. * if (ERR_SUCC != code) {
  738. * // 删除好友失败
  739. * return;
  740. * }
  741. * }, nullptr);
  742. * @endcode
  743. */
  744. TIM_API int TIMFriendshipDeleteFriend(const char* json_delete_friend_param, TIMCommCallback cb, const void* user_data);
  745. /**
  746. * 4.7 检测好友类型(单向或双向)
  747. *
  748. * @param json_check_friend_list_param 检测好友接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipCheckFriendTypeParam
  749. * @param cb 检测好友成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  750. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  751. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  752. *
  753. * @note
  754. * 开发者可以通过此接口检测给定的 UserID 列表跟当前账户的好友关系,检测好友相关内容请参考 [检测好友](https://cloud.tencent.com/document/product/269/1501#.E6.A0.A1.E9.AA.8C.E5.A5.BD.E5.8F.8B)。
  755. *
  756. * __示例__
  757. * @code{.cpp}
  758. * json::Object json_check_friend_list_param;
  759. * json_check_friend_list_param[kTIMFriendshipCheckFriendTypeParamCheckType] = FriendTypeBoth;
  760. *
  761. * json::Array json_friend_array;
  762. * json_friend_array.push_back("user4");
  763. * json_check_friend_list_param[kTIMFriendshipCheckFriendTypeParamIdentifierArray] = json_friend_array;
  764. * int ret = TIMFriendshipCheckFriendType(json_check_friend_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  765. *
  766. * }, nullptr);
  767. * @endcode
  768. */
  769. TIM_API int TIMFriendshipCheckFriendType(const char* json_check_friend_list_param, TIMCommCallback cb, const void* user_data);
  770. /////////////////////////////////////////////////////////////////////////////////
  771. //
  772. // 五. 好友申请、删除相关接口
  773. //
  774. /////////////////////////////////////////////////////////////////////////////////
  775. /**
  776. * 5.1 获取好友添加请求未决信息列表
  777. *
  778. * @param json_get_pendency_list_param 获取未决列表接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipGetPendencyListParam
  779. * @param cb 获取未决列表成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  780. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  781. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  782. *
  783. * @note
  784. * 好友添加请求未决信息是指好友添加请求未处理的操作。例如,开发者添加对方为好友,对方还没有处理;或者有人添加开发者为好友,开发者还没有处理,称之为好友添加请求未决信息
  785. *
  786. * __示例__
  787. * @code{.cpp}
  788. * json::Object json_get_pendency_list_param;
  789. * json_get_pendency_list_param[kTIMFriendshipGetPendencyListParamType] = FriendPendencyTypeBoth;
  790. * json_get_pendency_list_param[kTIMFriendshipGetPendencyListParamStartSeq] = 0;
  791. * int ret = TIMFriendshipGetPendencyList(json_get_pendency_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  792. *
  793. * }, nullptr);
  794. * @endcode
  795. */
  796. TIM_API int TIMFriendshipGetPendencyList(const char* json_get_pendency_list_param, TIMCommCallback cb, const void* user_data);
  797. /**
  798. * 5.2 处理好友请求
  799. *
  800. * @param json_handle_friend_add_param 处理好友请求接口参数的 Json 字符串, Json Key 请参考 @ref FriendResponse
  801. * @param cb 处理好友请求成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  802. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  803. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  804. *
  805. * @note
  806. * 当自己的个人资料的加好友权限 kTIMUserProfileAddPermission 设置为 kTIMProfileAddPermission_NeedConfirm 时,别人添加自己为好友时会收到一个加好友的请求,可通过此接口处理加好友的请求。
  807. *
  808. * __示例__
  809. * @code{.cpp}
  810. * Json::Value json_handle_friend_add_param;
  811. * json_handle_friend_add_param[kTIMFriendResponseIdentifier] = "user1";
  812. * json_handle_friend_add_param[kTIMFriendResponseAction] = ResponseActionAgreeAndAdd;
  813. * json_handle_friend_add_param[kTIMFriendResponseRemark] = "I am Captain China";
  814. * json_handle_friend_add_param[kTIMFriendResponseGroupName] = "schoolmate";
  815. * int ret = TIMFriendshipHandleFriendAddRequest(json_handle_friend_add_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  816. *
  817. * }, nullptr);
  818. * @endcode
  819. */
  820. TIM_API int TIMFriendshipHandleFriendAddRequest(const char* json_handle_friend_add_param, TIMCommCallback cb, const void* user_data);
  821. /**
  822. * 5.3 上报好友添加请求未决信息已读
  823. *
  824. * @param time_stamp 上报未决信息已读时间戳(单位秒),填 0 默认会获取当前的时间戳
  825. * @param cb 上报未决信息已读用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  826. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  827. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  828. *
  829. * __示例__
  830. * @code{.cpp}
  831. * TIMFriendshipReportPendencyReaded(0, [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
  832. *
  833. * }, nullptr);
  834. *
  835. * json_param 为空字符串,判断 code 确认结果即可
  836. * @endcode
  837. */
  838. TIM_API int TIMFriendshipReportPendencyReaded(uint64_t time_stamp, TIMCommCallback cb, const void* user_data);
  839. /**
  840. * 5.4 删除指定好友添加请求未决信息
  841. *
  842. * @param json_delete_pendency_param 删除指定未决信息接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipDeletePendencyParam
  843. * @param cb 删除指定未决信息成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  844. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  845. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  846. *
  847. * __示例__
  848. * @code{.cpp}
  849. * json::Object json_delete_pendency_param;
  850. * json_delete_pendency_param[kTIMFriendshipDeletePendencyParamType] = FriendPendencyTypeComeIn;
  851. *
  852. * json::Array json_application_array;
  853. * json_application_array.push_back("user1");
  854. * json_delete_pendency_param[kTIMFriendshipDeletePendencyParamIdentifierArray] = json_application_array;
  855. * int ret = TIMFriendshipDeletePendency(json_delete_pendency_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  856. *
  857. * }, nullptr);
  858. * @endcode
  859. */
  860. TIM_API int TIMFriendshipDeletePendency(const char* json_delete_pendency_param, TIMCommCallback cb, const void* user_data);
  861. /////////////////////////////////////////////////////////////////////////////////
  862. //
  863. // 六. 黑名单相关接口
  864. //
  865. /////////////////////////////////////////////////////////////////////////////////
  866. /**
  867. * 6.1 获取黑名单列表
  868. *
  869. * @param cb 获取黑名单列表成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  870. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  871. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  872. *
  873. */
  874. TIM_API int TIMFriendshipGetBlackList(TIMCommCallback cb, const void* user_data);
  875. /**
  876. * 6.2 添加指定用户到黑名单
  877. *
  878. * @param json_add_to_blacklist_param 添加指定用户到黑名单接口参数的 Json 字符串
  879. * @param cb 添加指定用户到黑名单成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  880. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  881. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  882. *
  883. * __示例__
  884. * @code{.cpp}
  885. * json::Array json_add_to_blacklist_param;
  886. * json_add_to_blacklist_param.push_back("user5");
  887. * json_add_to_blacklist_param.push_back("user10");
  888. * int ret = TIMFriendshipAddToBlackList(json_add_to_blacklist_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  889. *
  890. * }, nullptr);
  891. * @endcode
  892. */
  893. TIM_API int TIMFriendshipAddToBlackList(const char* json_add_to_blacklist_param, TIMCommCallback cb, const void* user_data);
  894. /**
  895. * 6.3 从黑名单中删除指定用户列表
  896. *
  897. * @param json_delete_from_blacklist_param 从黑名单中删除指定用户接口参数的 Json 字符串
  898. * @param cb 从黑名单中删除指定用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  899. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  900. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  901. *
  902. * __示例__
  903. * @code{.cpp}
  904. * json::Array json_delete_from_blacklist_param;
  905. * json_delete_from_blacklist_param.push_back("user5");
  906. * json_delete_from_blacklist_param.push_back("user10");
  907. * int ret = TIMFriendshipDeleteFromBlackList(json_delete_from_blacklist_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  908. *
  909. * }, nullptr);
  910. * @endcode
  911. */
  912. TIM_API int TIMFriendshipDeleteFromBlackList(const char* json_delete_from_blacklist_param, TIMCommCallback cb, const void* user_data);
  913. /////////////////////////////////////////////////////////////////////////////////
  914. //
  915. // 七. 好友分组相关接口
  916. //
  917. /////////////////////////////////////////////////////////////////////////////////
  918. /**
  919. * 7.1 创建好友分组
  920. *
  921. * @param json_create_friend_group_param 创建好友分组接口参数的 Json 字符串, Json Key 请参考 @ref CreateFriendGroupParam
  922. * @param cb 创建好友分组成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  923. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  924. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  925. *
  926. * @note
  927. * 不能创建已存在的分组
  928. *
  929. * __示例__
  930. * @code{.cpp}
  931. * json::Array json_group_name_array;
  932. * json_group_name_array.push_back("Group123");
  933. *
  934. * json::Array json_friend_array;
  935. * json_friend_array.push_back("user3");
  936. * json_friend_array.push_back("user4");
  937. *
  938. * json::Object json_create_friend_group_param;
  939. * json_create_friend_group_param[kTIMFriendshipCreateFriendGroupParamNameArray] = json_group_name_array;
  940. * json_create_friend_group_param[kTIMFriendshipCreateFriendGroupParamIdentifierArray] = json_friend_array;
  941. * int ret = TIMFriendshipCreateFriendGroup(json_create_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  942. *
  943. * }, nullptr);
  944. * @endcode
  945. */
  946. TIM_API int TIMFriendshipCreateFriendGroup(const char* json_create_friend_group_param, TIMCommCallback cb, const void* user_data);
  947. /**
  948. * 7.2 获取指定好友分组的分组信息
  949. *
  950. * @param json_get_friend_group_list_param 获取好友分组信息接口参数的 Json 字符串
  951. * @param cb 获取好友分组信息成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  952. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  953. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  954. *
  955. * __示例__
  956. * @code{.cpp}
  957. * json::Array json_get_friend_group_list_param;
  958. * json_get_friend_group_list_param.push_back("Group123");
  959. * int ret = TIMFriendshipGetFriendGroupList(json_get_friend_group_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  960. *
  961. * }, nullptr);
  962. * @endcode
  963. */
  964. TIM_API int TIMFriendshipGetFriendGroupList(const char* json_get_friend_group_list_param, TIMCommCallback cb, const void* user_data);
  965. /**
  966. * 7.3 删除好友分组
  967. *
  968. * @param json_delete_friend_group_param 删除好友分组接口参数的 Json 字符串
  969. * @param cb 删除好友分组成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  970. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  971. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  972. *
  973. * __示例__
  974. * @code{.cpp}
  975. * json::Array json_delete_friend_group_param;
  976. * json_delete_friend_group_param.push_back("GroupNewName");
  977. * int ret = TIMFriendshipDeleteFriendGroup(json_delete_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  978. *
  979. * }, nullptr);
  980. * @endcode
  981. */
  982. TIM_API int TIMFriendshipDeleteFriendGroup(const char* json_delete_friend_group_param, TIMCommCallback cb, const void* user_data);
  983. /**
  984. * 7.4 修改好友分组
  985. *
  986. * @param json_modify_friend_group_param 修改好友分组接口参数的 Json 字符串, Json Key 请参考 @ref FriendshipModifyFriendGroupParam
  987. * @param cb 修改好友分组成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  988. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  989. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  990. *
  991. * __示例__
  992. * @code{.cpp}
  993. * // 优先级 new_name > add_ids > delete_ids, 每次只能修改其中的一个,如果填写多个,则按优先级执行
  994. * json::Object json_modify_friend_group_param;
  995. * json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamName] = "Group123";
  996. * json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamNewName] = "GroupNewName";
  997. *
  998. * json::Array json_friend_add_array;
  999. * json_friend_add_array.push_back("user1");
  1000. * json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamAddIdentifierArray] = json_friend_add_array;
  1001. *
  1002. * json::Array json_friend_delete_array;
  1003. * json_friend_delete_array.push_back("user2");
  1004. * json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamDeleteIdentifierArray] = json_friend_delete_array;
  1005. *
  1006. * int ret = TIMFriendshipModifyFriendGroup(json_modify_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
  1007. *
  1008. * }, nullptr);
  1009. * @endcode
  1010. */
  1011. TIM_API int TIMFriendshipModifyFriendGroup(const char* json_modify_friend_group_param, TIMCommCallback cb, const void* user_data);
  1012. /////////////////////////////////////////////////////////////////////////////////
  1013. //
  1014. // 八. 公众号相关接口
  1015. //
  1016. /////////////////////////////////////////////////////////////////////////////////
  1017. /**
  1018. * 8.1 订阅公众号(7.6 及其以上版本支持)
  1019. *
  1020. * @param official_account_id 公众号 ID
  1021. * @param cb 订阅公众号成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1022. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1023. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1024. */
  1025. TIM_API int TIMSubscribeOfficialAccount(const char* official_account_id, TIMCommCallback cb, const void* user_data);
  1026. /**
  1027. * 8.2 取消订阅公众号(7.6 及其以上版本支持)
  1028. *
  1029. * @param unsubscribe_official_account_id 公众号 ID
  1030. * @param cb 取消订阅公众号成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1031. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1032. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1033. */
  1034. TIM_API int TIMUnsubscribeOfficialAccount(const char* unsubscribe_official_account_id, TIMCommCallback cb, const void* user_data);
  1035. /**
  1036. * 8.3 获取公众号列表(7.6 及其以上版本支持)
  1037. *
  1038. * @param json_official_account_id_list 公众号 ID 列表,传入列表为空表示获取全部已订阅的公众号
  1039. * @param cb 获取公众号列表成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1040. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1041. * @return int 返回TIM_SUCC表示接口调用成功(接口只有返回TIM_SUCC,回调cb才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1042. */
  1043. TIM_API int TIMGetOfficialAccountsInfo(const char* json_official_account_id_list, TIMCommCallback cb, const void* user_data);
  1044. /////////////////////////////////////////////////////////////////////////////////
  1045. //
  1046. // 九. 关注/粉丝功能相关接口
  1047. //
  1048. /////////////////////////////////////////////////////////////////////////////////
  1049. /**
  1050. * 9.1 关注用户 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1051. *
  1052. * @param json_user_id_list 待关注的用户 ID 列表
  1053. * @param cb 关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1054. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1055. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1056. *
  1057. * @note
  1058. * 一次最多支持关注 20 个用户
  1059. *
  1060. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowOperationResult)__
  1061. * @code{.json}
  1062. * [
  1063. * {
  1064. * "follow_operation_result_Info":"",
  1065. * "follow_operation_result_code":0,
  1066. * "follow_operation_result_user_id":"user1"
  1067. * },
  1068. * {
  1069. * "follow_operation_result_Info":"",
  1070. * "follow_operation_result_code":0,
  1071. * "follow_operation_result_user_id":"user2"
  1072. * }
  1073. * ]
  1074. * @endcode
  1075. */
  1076. TIM_API int TIMFollowUser(const char* json_user_id_list, TIMCommCallback cb, const void* user_data);
  1077. /**
  1078. * 9.2 取消关注用户 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1079. *
  1080. * @param json_user_id_list 待取消关注的用户 ID 列表
  1081. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1082. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1083. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1084. *
  1085. * @note
  1086. * 一次最多支持取消关注 20 个用户
  1087. *
  1088. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowOperationResult)__
  1089. * @code{.json}
  1090. * [
  1091. * {
  1092. * "follow_operation_result_Info":"",
  1093. * "follow_operation_result_code":0,
  1094. * "follow_operation_result_user_id":"user1"
  1095. * },
  1096. * {
  1097. * "follow_operation_result_Info":"",
  1098. * "follow_operation_result_code":0,
  1099. * "follow_operation_result_user_id":"user2"
  1100. * }
  1101. * ]
  1102. * @endcode
  1103. */
  1104. TIM_API int TIMUnfollowUser(const char* json_user_id_list, TIMCommCallback cb, const void* user_data);
  1105. /**
  1106. * 9.3 获取我的关注列表 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1107. *
  1108. * @param next_cursor 分页拉取标志,第一次拉取填 NULL 或者 "",回调中返回的 next_cursor 不为 "",则需要分页,可以传入该值再次拉取,直至返回为 ""
  1109. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1110. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1111. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1112. *
  1113. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowListResult)__
  1114. * @code{.json}
  1115. * {
  1116. * "follow_list_result_next_cursor":"", // 分页拉取的标志
  1117. * "follow_list_result_user_info_list":[
  1118. * Object{...}, // 用户资料信息
  1119. * Object{...} // 用户资料信息
  1120. * ]
  1121. * }
  1122. * @endcode
  1123. */
  1124. TIM_API int TIMGetMyFollowingList(const char* next_cursor, TIMCommCallback cb, const void* user_data);
  1125. /**
  1126. * 9.4 获取我的粉丝列表 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1127. *
  1128. * @param next_cursor 分页拉取标志,第一次拉取填 NULL 或者 "",回调中返回的 next_cursor 不为 "",则需要分页,可以传入该值再次拉取,直至返回为 ""
  1129. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1130. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1131. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1132. *
  1133. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowListResult)__
  1134. * @code{.json}
  1135. * {
  1136. * "follow_list_result_next_cursor":"", // 分页拉取的标志
  1137. * "follow_list_result_user_info_list":[
  1138. * Object{...}, // 用户资料信息
  1139. * Object{...} // 用户资料信息
  1140. * ]
  1141. * }
  1142. * @endcode
  1143. */
  1144. TIM_API int TIMGetMyFollowersList(const char* next_cursor, TIMCommCallback cb, const void* user_data);
  1145. /**
  1146. * 9.5 获取我的互关列表 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1147. *
  1148. * @param next_cursor 分页拉取标志,第一次拉取填 NULL 或者 "",回调中返回的 next_cursor 不为 "",则需要分页,可以传入该值再次拉取,直至返回为 ""
  1149. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1150. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1151. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1152. *
  1153. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowListResult)__
  1154. * @code{.json}
  1155. * {
  1156. * "follow_list_result_next_cursor":"", // 分页拉取的标志
  1157. * "follow_list_result_user_info_list":[
  1158. * Object{...}, // 用户资料信息
  1159. * Object{...} // 用户资料信息
  1160. * ]
  1161. * }
  1162. * @endcode
  1163. */
  1164. TIM_API int TIMGetMutualFollowersList(const char* next_cursor, TIMCommCallback cb, const void* user_data);
  1165. /**
  1166. * 9.6 获取指定用户的 关注/粉丝/互关 数量信息 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1167. *
  1168. * @param json_user_id_list 用户 ID 列表
  1169. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1170. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1171. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1172. *
  1173. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowInfo)__
  1174. * @code{.json}
  1175. * [
  1176. * {
  1177. * "follow_info_followers_count":6,
  1178. * "follow_info_following_count":6,
  1179. * "follow_info_mutual_followers_count":2,
  1180. * "follow_info_result_code":0,
  1181. * "follow_info_result_info":"",
  1182. * "follow_info_user_id":"user1"
  1183. * }
  1184. * ]
  1185. * @endcode
  1186. */
  1187. TIM_API int TIMGetUserFollowInfo(const char* json_user_id_list, TIMCommCallback cb, const void* user_data);
  1188. /**
  1189. * 9.7 检查指定用户的关注类型 (7.8 及其以上版本支持,需要您购买旗舰版套餐)
  1190. *
  1191. * @param json_user_id_list 用户 ID 列表
  1192. * @param cb 取消关注用户成功与否的回调。回调函数定义请参考 @ref TIMCommCallback
  1193. * @param user_data 用户自定义数据,ImSDK只负责传回给回调函数cb,不做任何处理
  1194. * @return int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 @ref TIMResult
  1195. *
  1196. * __回调中返回的 json_params 示例 (Json Key 请参考 @ref FollowTypeCheckResult)__
  1197. * @code{.json}
  1198. * [
  1199. * {
  1200. * "follow_type_check_result_code":0,
  1201. * "follow_type_check_result_follow_type":1,
  1202. * "follow_type_check_result_info":"OK",
  1203. * "follow_type_check_result_user_id":"user1"
  1204. * }
  1205. * ]
  1206. * @endcode
  1207. */
  1208. TIM_API int TIMCheckFollowType(const char* json_user_id_list, TIMCommCallback cb, const void* user_data);
  1209. /////////////////////////////////////////////////////////////////////////////////
  1210. //
  1211. // 十. 好友资料 API 参数相关的 Json Key 定义
  1212. //
  1213. /////////////////////////////////////////////////////////////////////////////////
  1214. //------------------------------------------------------------------------------
  1215. // 10.1 FriendProfileCustomStringInfo (好友自定义资料字段)
  1216. // string, 只写, 好友自定义资料字段key,首先要在 [控制台](https://console.cloud.tencent.com/im) (功能配置 -> 好友自定义字段) 配置好友自定义字段,key 可以添加 Tag_SNS_Custom_ 前缀,也可以不添加 Tag_SNS_Custom_ 前缀。
  1217. static const char* kTIMFriendProfileCustomStringInfoKey = "friend_profile_custom_string_info_key";
  1218. // string, 只写, 好友自定义资料字段value
  1219. static const char* kTIMFriendProfileCustomStringInfoValue = "friend_profile_custom_string_info_value";
  1220. //------------------------------------------------------------------------------
  1221. // 10.2 FriendProfile (好友资料)
  1222. // string, 只读, 好友UserID
  1223. static const char* kTIMFriendProfileIdentifier = "friend_profile_identifier";
  1224. // array string, 只读, 好友分组名称列表
  1225. static const char* kTIMFriendProfileGroupNameArray = "friend_profile_group_name_array";
  1226. // string, 只读, 好友备注,最大96字节,获取自己资料时,该字段为空
  1227. static const char* kTIMFriendProfileRemark = "friend_profile_remark";
  1228. // string, 只读, 好友申请时的添加理由
  1229. static const char* kTIMFriendProfileAddWording = "friend_profile_add_wording";
  1230. // string, 只读, 好友申请时的添加来源
  1231. static const char* kTIMFriendProfileAddSource = "friend_profile_add_source";
  1232. // uint64, 只读, 添加好友的 UTC 时间戳
  1233. static const char* kTIMFriendProfileAddTime = "friend_profile_add_time";
  1234. // object @ref UserProfile, 只读, 好友的个人资料
  1235. static const char* kTIMFriendProfileUserProfile = "friend_profile_user_profile";
  1236. // array @ref FriendProfileCustomStringInfo, 只读, [自定义好友字段](https://cloud.tencent.com/document/product/269/1501#.E8.87.AA.E5.AE.9A.E4.B9.89.E5.A5.BD.E5.8F.8B.E5.AD.97.E6.AE.B5)
  1237. static const char* kTIMFriendProfileCustomStringArray = "friend_profile_custom_string_array";
  1238. //------------------------------------------------------------------------------
  1239. // 10.3 FriendProfileItem (好友资料可修改的各个项)
  1240. // string, 只写, 修改好友备注
  1241. static const char* kTIMFriendProfileItemRemark = "friend_profile_item_remark";
  1242. // array string, 只写, 修改好友分组名称列表
  1243. static const char* kTIMFriendProfileItemGroupNameArray = "friend_profile_item_group_name_array";
  1244. // array @ref FriendProfileCustomStringInfo, 只写, 修改 [自定义好友字段](https://cloud.tencent.com/document/product/269/1501#.E8.87.AA.E5.AE.9A.E4.B9.89.E5.A5.BD.E5.8F.8B.E5.AD.97.E6.AE.B5)
  1245. static const char* kTIMFriendProfileItemCustomStringArray = "friend_profile_item_custom_string_array";
  1246. //------------------------------------------------------------------------------
  1247. // 10.4 FriendshipModifyFriendProfileParam (修改好友资料接口的参数)
  1248. // string, 只写, 被修改的好友的UserID
  1249. static const char* kTIMFriendshipModifyFriendProfileParamIdentifier = "friendship_modify_friend_profile_param_identifier";
  1250. // object @ref FriendProfileItem, 只写, 修改的好友资料各个选项
  1251. static const char* kTIMFriendshipModifyFriendProfileParamItem = "friendship_modify_friend_profile_param_item";
  1252. //------------------------------------------------------------------------------
  1253. // 10.5 FriendProfileUpdate (好友资料更新信息)
  1254. // string, 只写, 资料更新的好友的UserID
  1255. static const char* kTIMFriendProfileUpdateIdentifier = "friend_profile_update_identifier";
  1256. // object @ref FriendProfileItem, 只写, 资料更新的Item
  1257. static const char* kTIMFriendProfileUpdateItem = "friend_profile_update_item";
  1258. /////////////////////////////////////////////////////////////////////////////////
  1259. //
  1260. // 十一. 好友申请 API 参数相关的 Json Key 定义
  1261. //
  1262. /////////////////////////////////////////////////////////////////////////////////
  1263. //------------------------------------------------------------------------------
  1264. // 11.1 FriendshipAddFriendParam (添加好友接口的参数)
  1265. // string, 只写, 请求加好友对应的UserID
  1266. static const char* kTIMFriendshipAddFriendParamIdentifier = "friendship_add_friend_param_identifier";
  1267. // uint @ref TIMFriendType, 只写, 请求添加好友的好友类型
  1268. static const char* kTIMFriendshipAddFriendParamFriendType = "friendship_add_friend_param_friend_type";
  1269. // string, 只写, 预备注
  1270. static const char* kTIMFriendshipAddFriendParamRemark = "friendship_add_friend_param_remark";
  1271. // string, 只写, 预分组名
  1272. static const char* kTIMFriendshipAddFriendParamGroupName = "friendship_add_friend_param_group_name";
  1273. // string, 只写, 加好友来源描述
  1274. static const char* kTIMFriendshipAddFriendParamAddSource = "friendship_add_friend_param_add_source";
  1275. // string, 只写, 加好友附言
  1276. static const char* kTIMFriendshipAddFriendParamAddWording = "friendship_add_friend_param_add_wording";
  1277. //------------------------------------------------------------------------------
  1278. // 11.2 FriendshipDeleteFriendParam (删除好友接口的参数)
  1279. // uint @ref TIMFriendType, 只写, 删除好友,指定删除的好友类型
  1280. static const char* kTIMFriendshipDeleteFriendParamFriendType = "friendship_delete_friend_param_friend_type";
  1281. // array string, 只写(选填), 删除好友UserID列表
  1282. static const char* kTIMFriendshipDeleteFriendParamIdentifierArray = "friendship_delete_friend_param_identifier_array";
  1283. //------------------------------------------------------------------------------
  1284. // 11.3 FriendAddPendency (好友申请未决信息)
  1285. // uint @ref TIMFriendPendencyType, 只读, 好友申请未决的类型
  1286. static const char* kTIMFriendAddPendencyType = "friend_add_pendency_type";
  1287. // string, 只读, 好友申请未决的 UserID
  1288. static const char* kTIMFriendAddPendencyIdentifier = "friend_add_pendency_identifier";
  1289. // string, 只读, 好友申请未决的用户昵称
  1290. static const char* kTIMFriendAddPendencyNickName = "friend_add_pendency_nick_name";
  1291. // string, 只读, 好友申请未决的用户头像
  1292. static const char* kTIMFriendAddPendencyFaceUrl = "friend_add_pendency_face_url";
  1293. // uint64, 只读, 发起好友申请的时间
  1294. static const char* kTIMFriendAddPendencyAddTime = "friend_add_pendency_add_time";
  1295. // string, 只读, 好友申请未决的来源
  1296. static const char* kTIMFriendAddPendencyAddSource = "friend_add_pendency_add_source";
  1297. // string, 只读, 好友申请未决的附言
  1298. static const char* kTIMFriendAddPendencyAddWording = "friend_add_pendency_add_wording";
  1299. //------------------------------------------------------------------------------
  1300. // 11.4 FriendshipGetPendencyListParam (分页获取好友申请未决信息列表的参数)
  1301. // uint @ref TIMFriendPendencyType, 只写, 添加好友的未决请求类型
  1302. static const char* kTIMFriendshipGetPendencyListParamType = "friendship_get_pendency_list_param_type";
  1303. // uint64, 只写, 分页获取未决请求的起始 seq,返回的结果包含最大 seq,作为获取下一页的起始 seq
  1304. static const char* kTIMFriendshipGetPendencyListParamStartSeq = "friendship_get_pendency_list_param_start_seq";
  1305. // uint64, 只写, 获取未决信息的开始时间戳
  1306. static const char* kTIMFriendshipGetPendencyListParamStartTime = "friendship_get_pendency_list_param_start_time";
  1307. // int, 只写, 获取未决信息列表,每页的数量
  1308. static const char* kTIMFriendshipGetPendencyListParamLimitedSize = "friendship_get_pendency_list_param_limited_size";
  1309. //------------------------------------------------------------------------------
  1310. // 11.5 PendencyPage (好友申请未决信息页)
  1311. // uint64, 只读, 未决请求信息页的起始时间
  1312. static const char* kTIMPendencyPageStartTime = "pendency_page_start_time";
  1313. // uint64, 只读, 未决请求信息页的未读数量
  1314. static const char* kTIMPendencyPageUnReadNum = "pendency_page_unread_num";
  1315. // uint64, 只读, 未决请求信息页的当前Seq
  1316. static const char* kTIMPendencyPageCurrentSeq = "pendency_page_current_seq";
  1317. // array @ref FriendAddPendencyInfo, 只读, 未决请求信息页的未决信息列表
  1318. static const char* kTIMPendencyPagePendencyInfoArray = "pendency_page_pendency_info_array";
  1319. //------------------------------------------------------------------------------
  1320. // 11.6 FriendAddPendencyInfo (好友申请未决信息)
  1321. // uint @ref TIMFriendPendencyType, 只读, 好友添加请求未决类型
  1322. static const char* kTIMFriendAddPendencyInfoType = "friend_add_pendency_info_type";
  1323. // string, 只读, 好友添加请求未决的 UserID
  1324. static const char* kTIMFriendAddPendencyInfoIdentifier = "friend_add_pendency_info_identifier";
  1325. // string, 只读, 好友添加请求未决的昵称
  1326. static const char* kTIMFriendAddPendencyInfoNickName = "friend_add_pendency_info_nick_name";
  1327. // string, 只读, 好友添加请求未决的头像
  1328. static const char* kTIMFriendAddPendencyInfoFaceUrl = "friend_add_pendency_info_face_url";
  1329. // uint64, 只读, 发起好友申请的时间
  1330. static const char* kTIMFriendAddPendencyInfoAddTime = "friend_add_pendency_info_add_time";
  1331. // string, 只读, 好友添加请求未决的添加来源
  1332. static const char* kTIMFriendAddPendencyInfoAddSource = "friend_add_pendency_info_add_source";
  1333. // string, 只读, 好友添加请求未决的添加附言
  1334. static const char* kTIMFriendAddPendencyInfoAddWording = "friend_add_pendency_info_add_wording";
  1335. //------------------------------------------------------------------------------
  1336. // 11.7 FriendResponse (处理好友申请未决信息接口的参数)
  1337. // string, 只写(必填), 响应好友添加的UserID
  1338. static const char* kTIMFriendResponseIdentifier = "friend_response_identifier";
  1339. // uint @ref TIMFriendResponseAction, 只写(必填), 响应好友添加的动作
  1340. static const char* kTIMFriendResponseAction = "friend_response_action";
  1341. // string, 只写(选填), 好友备注
  1342. static const char* kTIMFriendResponseRemark = "friend_response_remark";
  1343. // string, 只写(选填), 好友分组列表
  1344. static const char* kTIMFriendResponseGroupName = "friend_response_group_name";
  1345. //------------------------------------------------------------------------------
  1346. // 11.8 FriendshipDeletePendencyParam (删除好友申请未决信息接口的参数)
  1347. // uint @ref TIMFriendPendencyType, 只读, 添加好友的未决请求类型
  1348. static const char* kTIMFriendshipDeletePendencyParamType = "friendship_delete_pendency_param_type";
  1349. // array string, 只读, 删除好友未决请求的 UserID 列表
  1350. static const char* kTIMFriendshipDeletePendencyParamIdentifierArray = "friendship_delete_pendency_param_identifier_array";
  1351. /////////////////////////////////////////////////////////////////////////////////
  1352. //
  1353. // 十二. 检查好友关系 API 参数相关的 Json Key 定义
  1354. //
  1355. /////////////////////////////////////////////////////////////////////////////////
  1356. //------------------------------------------------------------------------------
  1357. // 12.1 FriendshipCheckFriendTypeParam (检测好友的类型接口的参数)
  1358. // uint @ref TIMFriendType, 只写, 要检测的好友类型
  1359. static const char* kTIMFriendshipCheckFriendTypeParamCheckType = "friendship_check_friendtype_param_check_type";
  1360. // array string, 只写, 要检测的好友UserID列表
  1361. static const char* kTIMFriendshipCheckFriendTypeParamIdentifierArray = "friendship_check_friendtype_param_identifier_array";
  1362. //------------------------------------------------------------------------------
  1363. // 12.2 FriendshipCheckFriendTypeResult (检测好友的类型接口返回)
  1364. // string, 只读, 被检测的好友UserID
  1365. static const char* kTIMFriendshipCheckFriendTypeResultIdentifier = "friendship_check_friendtype_result_identifier";
  1366. // uint @ref TIMFriendCheckRelation, 只读, 检测成功时返回的好友的类型
  1367. static const char* kTIMFriendshipCheckFriendTypeResultRelation = "friendship_check_friendtype_result_relation";
  1368. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 检测的结果
  1369. static const char* kTIMFriendshipCheckFriendTypeResultCode = "friendship_check_friendtype_result_code";
  1370. // string, 只读, 检测好友失败的描述信息
  1371. static const char* kTIMFriendshipCheckFriendTypeResultDesc = "friendship_check_friendtype_result_desc";
  1372. /////////////////////////////////////////////////////////////////////////////////
  1373. //
  1374. // 十三. 好友操作(添加、删除、加黑名单等) API 参数相关的 Json Key 定义
  1375. //
  1376. /////////////////////////////////////////////////////////////////////////////////
  1377. //------------------------------------------------------------------------------
  1378. // 13.1 FriendResult (关系链操作接口的返回结果)
  1379. // string, 只读, 关系链操作的用户ID
  1380. static const char* kTIMFriendResultIdentifier = "friend_result_identifier";
  1381. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 关系链操作的结果
  1382. static const char* kTIMFriendResultCode = "friend_result_code";
  1383. // string, 只读, 关系链操作失败的详细描述
  1384. static const char* kTIMFriendResultDesc = "friend_result_desc";
  1385. /////////////////////////////////////////////////////////////////////////////////
  1386. //
  1387. // 十四. 好友分组 API 参数相关的 Json Key 定义
  1388. //
  1389. /////////////////////////////////////////////////////////////////////////////////
  1390. //------------------------------------------------------------------------------
  1391. // 14.1 CreateFriendGroupParam (创建好友分组接口参数)
  1392. // array string, 只写, 创建分组的名称列表
  1393. static const char* kTIMFriendshipCreateFriendGroupParamNameArray = "friendship_create_friend_group_param_name_array";
  1394. // array string, 只写, 要放到创建的分组的好友UserID列表
  1395. static const char* kTIMFriendshipCreateFriendGroupParamIdentifierArray = "friendship_create_friend_group_param_identifier_array";
  1396. //------------------------------------------------------------------------------
  1397. // 14.2 FriendGroupInfo (好友分组信息)
  1398. // string, 只读, 分组名称
  1399. static const char* kTIMFriendGroupInfoName = "friend_group_info_name";
  1400. // uint64, 只读, 当前分组的好友个数
  1401. static const char* kTIMFriendGroupInfoCount = "friend_group_info_count";
  1402. // array string, 只读, 当前分组内好友UserID列表
  1403. static const char* kTIMFriendGroupInfoIdentifierArray = "friend_group_info_identifier_array";
  1404. //------------------------------------------------------------------------------
  1405. // 14.3 FriendshipModifyFriendGroupParam (修改好友分组信息的接口参数)
  1406. // string, 只写, 要修改的分组名称
  1407. static const char* kTIMFriendshipModifyFriendGroupParamName = "friendship_modify_friend_group_param_name";
  1408. // string, 只写(选填), 修改后的分组名称
  1409. static const char* kTIMFriendshipModifyFriendGroupParamNewName = "friendship_modify_friend_group_param_new_name";
  1410. // array string, 只写(选填), 要从当前分组删除的好友UserID列表
  1411. static const char* kTIMFriendshipModifyFriendGroupParamDeleteIdentifierArray = "friendship_modify_friend_group_param_delete_identifier_array";
  1412. // array string, 只写(选填), 当前分组要新增的好友UserID列表
  1413. static const char* kTIMFriendshipModifyFriendGroupParamAddIdentifierArray = "friendship_modify_friend_group_param_add_identifier_array";
  1414. /////////////////////////////////////////////////////////////////////////////////
  1415. //
  1416. // 十五. 好友搜索 API 参数相关的 Json Key 定义
  1417. //
  1418. /////////////////////////////////////////////////////////////////////////////////
  1419. //------------------------------------------------------------------------------
  1420. // 15.1 FriendSearchParam (搜索好友的参数)
  1421. // array string, 只写, 搜索的关键字列表,关键字列表最多支持 5 个
  1422. static const char* kTIMFriendshipSearchParamKeywordList = "friendship_search_param_keyword_list";
  1423. // array uint @ref TIMFriendshipSearchFieldKey, 只写, 好友搜索类型
  1424. static const char* kTIMFriendshipSearchParamSearchFieldList = "friendship_search_param_search_field_list";
  1425. //------------------------------------------------------------------------------
  1426. // 15.2 FriendInfoGetResult (搜索好友结果)
  1427. // string, 只读, 好友 user_id
  1428. static const char* kTIMFriendshipFriendInfoGetResultIdentifier = "friendship_friend_info_get_result_identifier";
  1429. // uint @ref TIMFriendshipRelationType, 只读, 好友关系
  1430. static const char* kTIMFriendshipFriendInfoGetResultRelationType = "friendship_friend_info_get_result_relation_type";
  1431. // uint, 只读, 错误码
  1432. static const char* kTIMFriendshipFriendInfoGetResultErrorCode = "friendship_friend_info_get_result_error_code";
  1433. // string, 只读, 错误描述
  1434. static const char* kTIMFriendshipFriendInfoGetResultErrorMessage = "friendship_friend_info_get_result_error_message";
  1435. // array uint @ref FriendProfile, 只读, 好友资料
  1436. static const char* kTIMFriendshipFriendInfoGetResultFriendInfo = "friendship_friend_info_get_result_field_info";
  1437. /////////////////////////////////////////////////////////////////////////////////
  1438. //
  1439. // 十六. 公众号管理 API 参数相关的 Json Key 定义
  1440. //
  1441. /////////////////////////////////////////////////////////////////////////////////
  1442. //------------------------------------------------------------------------------
  1443. // 16.1 OfficialAccountInfo(公众号信息)
  1444. // string, 只读, 公众号 ID
  1445. static const char* kTIMOfficialAccountID = "official_account_id";
  1446. // string, 只读, 公众号名称
  1447. static const char* kTIMOfficialAccountName = "official_account_name";
  1448. // string, 只读, 公众号头像 URL
  1449. static const char* kTIMOfficialAccountFaceUrl = "official_account_face_url";
  1450. // string, 只读, 公众号所有者
  1451. static const char* kTIMOfficialAccountOwnerUserID = "official_account_owner_user_id";
  1452. // string, 只读, 公众号介绍
  1453. static const char* kTIMOfficialAccountIntroduction = "official_account_introduction";
  1454. // string, 只读, 公众号组织
  1455. static const char* kTIMOfficialAccountOrganization = "official_account_organization";
  1456. // uint64, 只读, 公众号创建时间,单位:秒
  1457. static const char* kTIMOfficialAccountCreateTime = "official_account_create_time";
  1458. // uint64, 只读, 公众号订阅者数量
  1459. static const char* kTIMOfficialAccountSubscriberCount = "official_account_subscriber_count";
  1460. // uint64, 只读, 公众号订阅时间,单位:秒
  1461. static const char* kTIMOfficialAccountSubscribeTime = "official_account_subscribe_time";
  1462. // string, 只读, 公众号自定义字段
  1463. static const char* kTIMOfficialAccountCustomData = "official_account_custom_data";
  1464. //------------------------------------------------------------------------------
  1465. // 16.2 GetOfficialAccountInfoResult(获取公众号信息列表接口的返回)
  1466. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 获取公众号详细资料的结果
  1467. static const char* kTIMGetOfficialAccountInfoResultCode = "get_official_accounts_info_result_code";
  1468. // string, 只读, 获取公众号详细资料失败的描述信息
  1469. static const char* kTIMGetOfficialAccountInfoResultDesc = "get_official_accounts_info_result_desc";
  1470. // object @ref OfficialAccountInfo, 只读, 公众号详细信息
  1471. static const char* kTIMGetOfficialAccountInfo = "get_official_accounts_info";
  1472. /////////////////////////////////////////////////////////////////////////////////
  1473. //
  1474. // 十七. 关注/粉丝 API 参数相关的 Json Key 定义
  1475. //
  1476. /////////////////////////////////////////////////////////////////////////////////
  1477. //------------------------------------------------------------------------------
  1478. // 17.1 FollowOperationResult (关注/取关操作接口的返回结果)
  1479. // string, 只读, 关注/取关操作的用户 ID
  1480. static const char* kTIMFollowOperationResultUserID = "follow_operation_result_user_id";
  1481. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 关注/取关的操作返回码
  1482. static const char* kTIMFollowOperationResultCode = "follow_operation_result_code";
  1483. // string, 只读, 关注/取关操作的返回结果描述
  1484. static const char* kTIMFollowOperationResultInfo = "follow_operation_result_Info";
  1485. //------------------------------------------------------------------------------
  1486. // 17.2 FollowListResult (获取 关注/粉丝/互关 列表的结果)
  1487. // string, 只读, 下一次拉要取列表的起始位置
  1488. static const char* kTIMFollowListResultNextCursor = "follow_list_result_next_cursor";
  1489. // array @ref UserProfile, 只读, 用户资料列表
  1490. static const char* kTIMFollowListResultUerInfoList = "follow_list_result_user_info_list";
  1491. //------------------------------------------------------------------------------
  1492. // 17.3 FollowInfo (用户关注信息)
  1493. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 获取用户关注数量信息的返回码
  1494. static const char* kTIMFollowInfoResultCode = "follow_info_result_code";
  1495. // string, 只读, 获取用户关注数量信息的返回结果描述
  1496. static const char* kTIMFollowInfoResultInfo = "follow_info_result_info";
  1497. // string, 只读, 用户 ID
  1498. static const char* kTIMFollowInfoUserID = "follow_info_user_id";
  1499. // uint64, 只读, 用户的关注数量
  1500. static const char* kTIMFollowInfoFollowingCount = "follow_info_following_count";
  1501. // uint64, 只读, 用户的粉丝数量
  1502. static const char* kTIMFollowInfoFollowersCount = "follow_info_followers_count";
  1503. // uint64, 只读, 用户的互关数量
  1504. static const char* kTIMFollowInfoMutualFollowersCount = "follow_info_mutual_followers_count";
  1505. //------------------------------------------------------------------------------
  1506. // 17.4 FollowTypeCheckResult (指定用户关注类型的检查结果)
  1507. // string, 只读, 用户 ID
  1508. static const char* kTIMFollowTypeCheckResultUserID = "follow_type_check_result_user_id";
  1509. // int [错误码](https://cloud.tencent.com/document/product/269/1671), 只读, 关注类型的检查的返回码
  1510. static const char* kTIMFollowTypeCheckResultCode = "follow_type_check_result_code";
  1511. // string, 只读, 关注类型的检查的返回结果描述
  1512. static const char* kTIMFollowTypeCheckResultInfo = "follow_type_check_result_info";
  1513. // uint @ref TIMFollowType, 只读, 关注类型
  1514. static const char* kTIMFollowTypeCheckResultFollowType = "follow_type_check_result_follow_type";
  1515. /////////////////////////////////////////////////////////////////////////////////
  1516. //
  1517. // 十八. 废弃字段
  1518. //
  1519. /////////////////////////////////////////////////////////////////////////////////
  1520. // 18.1 好友变更类型
  1521. enum TIMFriendChangeType {
  1522. // 未知类型
  1523. kTIMFriendChange_None,
  1524. // 新增好友
  1525. kTIMFriendChange_FriendAdd,
  1526. // 删除好友
  1527. kTIMFriendChange_FriendDel,
  1528. // 新增好友申请的未决
  1529. kTIMFriendChange_PendencyAdd,
  1530. // 删除好友申请的未决
  1531. kTIMFriendChange_PendencyDel,
  1532. // 加入黑名单
  1533. kTIMFriendChange_BlackListAdd,
  1534. // 从黑名单移除
  1535. kTIMFriendChange_BlackListDel,
  1536. // 未决已读上报
  1537. kTIMFriendChange_PendencyReadedReport,
  1538. // 好友数据更新
  1539. kTIMFriendChange_FriendProfileUpdate,
  1540. // 分组增加
  1541. kTIMFriendChange_FriendGroupAdd,
  1542. // 分组删除
  1543. kTIMFriendChange_FriendGroupDel,
  1544. // 分组修改
  1545. kTIMFriendChange_FriendGroupModify,
  1546. };
  1547. //------------------------------------------------------------------------------
  1548. // 18.2 FriendChangeElem (好友变更通知)
  1549. // uint @ref TIMFriendChangeType, 只读, 资料变更类型
  1550. static const char* kTIMFriendChangeElemChangeType = "friend_change_elem_change_type";
  1551. // array string, 只读, 新增的好友UserID列表,只有当 change_type 为 kTIMFriendChange_FriendAdd 时有效
  1552. static const char* kTIMFriendChangeElemFriendAddIdentifierArray = "friend_change_elem_friend_add_identifier_array";
  1553. // array string, 只读, 删除的好友UserID列表,只有当 change_type 为 kTIMFriendChange_FriendDel 时有效
  1554. static const char* kTIMFriendChangeElemFriendDelIdentifierArray = "friend_change_elem_friend_del_identifier_array";
  1555. // array @ref FriendAddPendency, 只读, 好友申请的未决列表, 只有当 change_type 为 kTIMFriendChange_PendencyAdd 时有效
  1556. static const char* kTIMFriendChangeElemFriendAddPendencyItemArray = "friend_change_elem_friend_add_pendency_array";
  1557. // array string, 只读, 被删除的好友申请的未决列表, 只有当 change_type 为 kTIMFriendChange_PendencyDel 时有效
  1558. static const char* kTIMFriendChangeElemPendencyDelIdentifierArray = "friend_change_elem_pendency_del_identifier_array";
  1559. // uint64, 只读, 未决已读上报时间戳, 只有当 change_type 为 kTIMFriendChange_PendencyReadedReport 时有效
  1560. static const char* kTIMFriendChangeElemPendencyReadedReportTimestamp = "friend_change_elem_pendency_readed_report_timestamp";
  1561. // array string, 只读, 新增的黑名单UserID列表,只有当 change_type 为 kTIMFriendChange_BlackListAdd 时有效
  1562. static const char* kTIMFriendChangeElemBlackListAddIdentifierArray = "friend_change_elem_blacklist_add_identifier_array";
  1563. // array string, 只读, 删除的黑名单UserID列表,只有当 change_type 为 kTIMFriendChange_BlackListDel 时有效
  1564. static const char* kTIMFriendChangeElemBlackListDelIdentifierArray = "friend_change_elem_blacklist_del_identifier_array";
  1565. // array @ref FriendProfileUpdate, 只读, 好友资料更新列表, 只有当 change_type 为 kTIMFriendChange_FriendProfileUpdate 时有效
  1566. static const char* kTIMFriendChangeElemFriendProfileUpdateItemArray = "friend_change_elem_friend_profile_update_item_array";
  1567. // array string, 只读, 新增的好友分组名称列表, 只有当 change_type 为 kTIMFriendChange_FriendGroupAdd 时有效
  1568. static const char* kTIMFriendChangeElemFriendGroupAddIdentifierArray = "friend_change_elem_friend_group_add_array";
  1569. // array string, 只读, 删除的好友分组名称列表, 只有当 change_type 为 kTIMFriendChange_FriendGroupDel 时有效
  1570. static const char* kTIMFriendChangeElemFriendGroupDelIdentifierArray = "friend_change_elem_friend_group_del_array";
  1571. // array string, 只读, 修改的好友分组名称列表, 只有当 change_type 为 kTIMFriendChange_FriendGroupModify 时有效
  1572. static const char* kTIMFriendChangeElemFriendGroupModifyIdentifierArray = "friend_change_elem_friend_group_update_array";
  1573. //------------------------------------------------------------------------------
  1574. // 18.3 以下为老版本拼写错误,为了兼容老版本而保留的宏定义
  1575. // enum TIMFriendType
  1576. #define FriendTypeSignle FriendTypeSingle
  1577. // enum TIMFriendshipSearchFieldKey
  1578. #define kTIMFriendshipSearchFieldKey_NikeName kTIMFriendshipSearchFieldKey_NickName
  1579. // FriendChangeElem JsonKey
  1580. #define kTIMFriendChangeElemFreindProfileUpdateItemArray kTIMFriendChangeElemFriendProfileUpdateItemArray
  1581. // FriendProfileCustomStringInfo JsonKey
  1582. #define kTIMFriendProfileCustemStringInfoKey kTIMFriendProfileCustomStringInfoKey
  1583. #define kTIMFriendProfileCustemStringInfoValue kTIMFriendProfileCustomStringInfoValue
  1584. // FriendResponse JsonKey
  1585. #define kTIMFriendResponeIdentifier kTIMFriendResponseIdentifier
  1586. #define kTIMFriendResponeAction kTIMFriendResponseAction
  1587. #define kTIMFriendResponeRemark kTIMFriendResponseRemark
  1588. #define kTIMFriendResponeGroupName kTIMFriendResponseGroupName
  1589. // FollowListResult JsonKey
  1590. #define KTIMFollowListResultNextCursor kTIMFollowListResultNextCursor
  1591. #define KTIMFollowListResultUerInfoList kTIMFollowListResultUerInfoList
  1592. #ifdef __cplusplus
  1593. }
  1594. #endif // __cplusplus
  1595. #endif // SRC_PLATFORM_CROSS_PLATFORM_INCLUDE_TIM_FRIENDSHIP_MANAGER_H_