EMConversation.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*!
  2. * \~chinese
  3. * @header EMConversation.h
  4. * @abstract 聊天会话
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMConversation.h
  10. * @abstract Chat conversation
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMMessageBody.h"
  16. /*
  17. * \~chinese
  18. * 会话类型
  19. *
  20. * \~english
  21. * Conversation type
  22. */
  23. typedef enum {
  24. EMConversationTypeChat = 0, /*! \~chinese 单聊会话 \~english one-to-one chat */
  25. EMConversationTypeGroupChat, /*! \~chinese 群聊会话 \~english group chat */
  26. EMConversationTypeChatRoom /*! \~chinese 聊天室会话 \~english chat room */
  27. } EMConversationType;
  28. /*
  29. * \~chinese
  30. * 消息搜索方向
  31. *
  32. * \~english
  33. * Message search direction
  34. */
  35. typedef enum {
  36. EMMessageSearchDirectionUp = 0, /*! \~chinese 向上搜索 \~english Search older messages */
  37. EMMessageSearchDirectionDown /*! \~chinese 向下搜索 \~english Search newer messages */
  38. } EMMessageSearchDirection;
  39. @class EMMessage;
  40. @class EMError;
  41. /*!
  42. * \~chinese
  43. * 聊天会话
  44. *
  45. * \~english
  46. * Chat conversation
  47. */
  48. @interface EMConversation : NSObject
  49. /*!
  50. * \~chinese
  51. * 会话ID
  52. * 对于单聊类型,会话ID同时也是对方用户的名称。
  53. * 对于群聊类型,会话ID同时也是对方群组的ID,并不同于群组的名称。
  54. * 对于聊天室类型,会话ID同时也是聊天室的ID,并不同于聊天室的名称。
  55. * 对于HelpDesk类型,会话ID与单聊类型相同,是对方用户的名称。
  56. *
  57. * \~english
  58. * conversation ID
  59. * For single chat,conversation ID is to chat user's name
  60. * For group chat, conversation ID is groupID(), different with getGroupName()
  61. * For chat room, conversation ID is chatroom ID, different with chat room name()
  62. * For help desk, it is same with single chat, conversationID is also chat user's name
  63. */
  64. @property (nonatomic, copy, readonly) NSString *conversationId;
  65. /*!
  66. * \~chinese
  67. * 会话类型
  68. *
  69. * \~english
  70. * Conversation type
  71. */
  72. @property (nonatomic, assign, readonly) EMConversationType type;
  73. /*!
  74. * \~chinese
  75. * 对话中未读取的消息数量
  76. *
  77. * \~english
  78. * unread message count
  79. */
  80. @property (nonatomic, assign, readonly) int unreadMessagesCount;
  81. /*!
  82. * \~chinese
  83. * 会话扩展属性
  84. *
  85. * \~english
  86. * Conversation extension property
  87. */
  88. @property (nonatomic, copy) NSDictionary *ext;
  89. /*!
  90. * \~chinese
  91. * 会话最新一条消息
  92. *
  93. * \~english
  94. * Conversation latest message
  95. */
  96. @property (nonatomic, strong, readonly) EMMessage *latestMessage;
  97. /*!
  98. * \~chinese
  99. * 收到的对方发送的最后一条消息,也是会话里的最新消息
  100. *
  101. * @result 消息实例
  102. *
  103. * \~english
  104. * Get last received message
  105. *
  106. * @result Message instance
  107. */
  108. - (EMMessage *)lastReceivedMessage;
  109. /*!
  110. * \~chinese
  111. * 插入一条消息,消息的conversationId应该和会话的conversationId一致,消息会被插入DB,并且更新会话的latestMessage等属性
  112. * insertMessage 会更新对应Conversation里的latestMessage
  113. * Method EMConversation insertMessage:error: = EMChatManager importMsessage:completion: + update conversation latest message
  114. *
  115. * @param aMessage 消息实例
  116. * @param pError 错误信息
  117. *
  118. * \~english
  119. * Insert a message to a conversation in local database and SDK will update the last message automatically
  120. * ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly. The inserting message will be inserted based on timestamp.
  121. * Method EMConversation insertMessage:error: = EMChatManager importMsessage:completion: + update conversation latest message
  122. *
  123. * @param aMessage Message
  124. * @param pError Error
  125. */
  126. - (void)insertMessage:(EMMessage *)aMessage
  127. error:(EMError **)pError;
  128. /*!
  129. * \~chinese
  130. * 插入一条消息到会话尾部,消息的conversationId应该和会话的conversationId一致,消息会被插入DB,并且更新会话的latestMessage等属性
  131. *
  132. * @param aMessage 消息实例
  133. * @param pError 错误信息
  134. *
  135. * \~english
  136. * Insert a message to the end of a conversation in local database. ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly.
  137. *
  138. * @param aMessage Message
  139. * @param pError Error
  140. *
  141. */
  142. - (void)appendMessage:(EMMessage *)aMessage
  143. error:(EMError **)pError;
  144. /*!
  145. * \~chinese
  146. * 删除一条消息
  147. *
  148. * @param aMessageId 要删除消失的ID
  149. * @param pError 错误信息
  150. *
  151. * \~english
  152. * Delete a message
  153. *
  154. * @param aMessageId Id of the message to be deleted
  155. * @param pError Error
  156. *
  157. */
  158. - (void)deleteMessageWithId:(NSString *)aMessageId
  159. error:(EMError **)pError;
  160. /*!
  161. * \~chinese
  162. * 删除该会话所有消息,同时清除内存和数据库中的消息
  163. *
  164. * @param pError 错误信息
  165. *
  166. * \~english
  167. * Delete all messages of the conversation from memory cache and local database
  168. *
  169. * @param pError Error
  170. */
  171. - (void)deleteAllMessages:(EMError **)pError;
  172. /*!
  173. * \~chinese
  174. * 更新本地的消息,不能更新消息ID,消息更新后,会话的latestMessage等属性进行相应更新
  175. *
  176. * @param aMessage 要更新的消息
  177. * @param pError 错误信息
  178. *
  179. * \~english
  180. * Use this method to update a message in local database. Changing properties will affect data in database
  181. * LatestMessage of the conversation and other properties will be updated accordingly. messageId of the message cannot be updated
  182. *
  183. * @param aMessage Message
  184. * @param pError Error
  185. *
  186. */
  187. - (void)updateMessageChange:(EMMessage *)aMessage
  188. error:(EMError **)pError;
  189. /*!
  190. * \~chinese
  191. * 将消息设置为已读
  192. *
  193. * @param aMessageId 要设置消息的ID
  194. * @param pError 错误信息
  195. *
  196. * \~english
  197. * Mark a message as read
  198. *
  199. * @param aMessageId MessageID
  200. * @param pError Error
  201. *
  202. */
  203. - (void)markMessageAsReadWithId:(NSString *)aMessageId
  204. error:(EMError **)pError;
  205. /*!
  206. * \~chinese
  207. * 将所有未读消息设置为已读
  208. *
  209. * @param pError 错误信息
  210. *
  211. * \~english
  212. * Mark all messages as read
  213. *
  214. * @param pError Error
  215. *
  216. */
  217. - (void)markAllMessagesAsRead:(EMError **)pError;
  218. #pragma mark - Load Messages Methods
  219. /*!
  220. * \~chinese
  221. * 获取指定ID的消息
  222. *
  223. * @param aMessageId 消息ID
  224. * @param pError 错误信息
  225. *
  226. * \~english
  227. * Get a message with the ID
  228. *
  229. * @param aMessageId MessageID
  230. * @param pError Error
  231. *
  232. */
  233. - (EMMessage *)loadMessageWithId:(NSString *)aMessageId
  234. error:(EMError **)pError;
  235. /*!
  236. * \~chinese
  237. * 从数据库获取指定数量的消息,取到的消息按时间排序,并且不包含参考的消息,如果参考消息的ID为空,则从最新消息取
  238. *
  239. * @param aMessageId 参考消息的ID
  240. * @param count 获取的条数
  241. * @param aDirection 消息搜索方向
  242. * @param aCompletionBlock 完成的回调
  243. *
  244. * \~english
  245. * Load messages starting from the specified message id from local database. Returning messages are sorted by receiving timestamp based on EMMessageSearchDirection. If the aMessageId is nil, will return starting from the latest message
  246. *
  247. * @param aMessageId Start loading messages from the specified message id
  248. * @param aCount Max number of messages to load
  249. * @param aDirection Message search direction.
  250. EMMessageSearchDirectionUp: get aCount of messages before aMessageId;
  251. EMMessageSearchDirectionDown: get aCount of messages after aMessageId
  252. * @param aCompletionBlock The callback of completion block
  253. *
  254. */
  255. - (void)loadMessagesStartFromId:(NSString *)aMessageId
  256. count:(int)aCount
  257. searchDirection:(EMMessageSearchDirection)aDirection
  258. completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
  259. /*!
  260. * \~chinese
  261. * 从数据库获取指定类型的消息,取到的消息按时间排序,如果参考的时间戳为负数,则从最新消息取,如果aCount小于等于0当作1处理
  262. *
  263. * @param aType 消息类型
  264. * @param aTimestamp 参考时间戳
  265. * @param aCount 获取的条数
  266. * @param aUsername 消息发送方,如果为空则忽略
  267. * @param aDirection 消息搜索方向
  268. * @param aCompletionBlock 完成的回调
  269. *
  270. * \~english
  271. * Load messages with specified message type from local database. Returning messages are sorted by receiving timestamp based on EMMessageSearchDirection.
  272. *
  273. * @param aType Message type to load
  274. * @param aTimestamp load based on reference timestamp. If aTimestamp=-1, will load from the most recent (the latest) message
  275. * @param aCount Max number of messages to load. if aCount<0, will be handled as count=1
  276. * @param aUsername Message sender (optional). Use aUsername=nil to ignore
  277. * @param aDirection Message search direction
  278. EMMessageSearchDirectionUp: get aCount of messages before aMessageId;
  279. EMMessageSearchDirectionDown: get aCount of messages after aMessageId
  280. * @param aCompletionBlock The callback of completion block
  281. *
  282. */
  283. - (void)loadMessagesWithType:(EMMessageBodyType)aType
  284. timestamp:(long long)aTimestamp
  285. count:(int)aCount
  286. fromUser:(NSString*)aUsername
  287. searchDirection:(EMMessageSearchDirection)aDirection
  288. completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
  289. /*!
  290. * \~chinese
  291. * 从数据库获取包含指定内容的消息,取到的消息按时间排序,如果参考的时间戳为负数,则从最新消息向前取,如果aCount小于等于0当作1处理
  292. *
  293. * @param aKeywords 搜索关键字,如果为空则忽略
  294. * @param aTimestamp 参考时间戳
  295. * @param aCount 获取的条数
  296. * @param aSender 消息发送方,如果为空则忽略
  297. * @param aDirection 消息搜索方向
  298. * @param aCompletionBlock 完成的回调
  299. *
  300. * \~english
  301. * Load messages with specified keyword from local database, returning messages are sorted by receiving timestamp based on EMMessageSearchDirection. If reference timestamp is negative, load from the latest messages; if message count is negative, will be handled as count=1
  302. *
  303. * @param aKeyword Search keyword. aKeyword=nil to ignore
  304. * @param aTimestamp load based on reference timestamp. If aTimestamp=-1, will load from the most recent (the latest) message
  305. * @param aCount Max number of messages to load
  306. * @param aSender Message sender (optional). Pass nil to ignore
  307. * @param aDirection Message search direction
  308. EMMessageSearchDirectionUp: get aCount of messages before aMessageId;
  309. EMMessageSearchDirectionDown: get aCount of messages after aMessageId * ----
  310. * @param aCompletionBlock The callback of completion block
  311. *
  312. */
  313. - (void)loadMessagesWithKeyword:(NSString*)aKeyword
  314. timestamp:(long long)aTimestamp
  315. count:(int)aCount
  316. fromUser:(NSString*)aSender
  317. searchDirection:(EMMessageSearchDirection)aDirection
  318. completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
  319. /*!
  320. * \~chinese
  321. * 从数据库获取指定时间段内的消息,取到的消息按时间排序,为了防止占用太多内存,用户应当制定加载消息的最大数
  322. *
  323. * @param aStartTimestamp 毫秒级开始时间
  324. * @param aEndTimestamp 结束时间
  325. * @param aCount 加载消息最大数
  326. * @param aCompletionBlock 完成的回调
  327. *
  328. * \~english
  329. * Load messages within specified time range from local database. Returning messages are sorted by sending timestamp
  330. *
  331. * @param aStartTimestamp Starting timestamp in miliseconds
  332. * @param aEndTimestamp Ending timestamp in miliseconds
  333. * @param aCount Max number of messages to load
  334. * @param aCompletionBlock The callback of completion block
  335. *
  336. */
  337. - (void)loadMessagesFrom:(long long)aStartTimestamp
  338. to:(long long)aEndTimestamp
  339. count:(int)aCount
  340. completion:(void (^)(NSArray *aMessages, EMError *aError))aCompletionBlock;
  341. #pragma mark - Deprecated methods
  342. /*!
  343. * \~chinese
  344. * 插入一条消息,消息的conversationId应该和会话的conversationId一致,消息会被插入DB,并且更新会话的latestMessage等属性
  345. *
  346. * @param aMessage 消息实例
  347. *
  348. * @result 是否成功
  349. *
  350. * \~english
  351. * Insert a message to a conversation. ConversationId of the message should be the same as conversationId of the conversation in order to insert the message into the conversation correctly.
  352. *
  353. * @param aMessage Message
  354. *
  355. * @result Message insert result, return YES or success, return No for failure.
  356. */
  357. - (BOOL)insertMessage:(EMMessage *)aMessage __deprecated_msg("Use -insertMessage:error:");
  358. /*!
  359. * \~chinese
  360. * 插入一条消息到会话尾部,消息的conversationId应该和会话的conversationId一致,消息会被插入DB,并且更新会话的latestMessage等属性
  361. *
  362. * @param aMessage 消息实例
  363. *
  364. * @result 是否成功
  365. *
  366. * \~english
  367. * Insert a message to the tail of conversation, message's conversationId should equle to conversation's conversationId, message will be inserted to DB, and update conversation's property
  368. *
  369. * @param aMessage Message
  370. *
  371. * @result Message insert result, YES: success, No: fail
  372. */
  373. - (BOOL)appendMessage:(EMMessage *)aMessage __deprecated_msg("Use -appendMessage:error:");
  374. /*!
  375. * \~chinese
  376. * 删除一条消息
  377. *
  378. * @param aMessageId 要删除消失的ID
  379. *
  380. * @result 是否成功
  381. *
  382. * \~english
  383. * Delete a message
  384. *
  385. * @param aMessageId Message's ID who will be deleted
  386. *
  387. * @result Message delete result, YES: success, No: fail
  388. */
  389. - (BOOL)deleteMessageWithId:(NSString *)aMessageId __deprecated_msg("Use -deleteMessageWithId:error:");
  390. /*!
  391. * \~chinese
  392. * 删除该会话所有消息
  393. *
  394. * @result 是否成功
  395. *
  396. * \~english
  397. * Delete all message of the conversation
  398. *
  399. * @result Delete result, YES: success, No: fail
  400. */
  401. - (BOOL)deleteAllMessages __deprecated_msg("Use -deleteAllMessages:");
  402. /*!
  403. * \~chinese
  404. * 更新一条消息,不能更新消息ID,消息更新后,会话的latestMessage等属性进行相应更新
  405. *
  406. * @param aMessage 要更新的消息
  407. *
  408. * @result 是否成功
  409. *
  410. * \~english
  411. * Update a message, can't update message's messageId, conversation's latestMessage and so on properties will update after update the message
  412. *
  413. * @param aMessage Message
  414. *
  415. * @result Message update result, YES: success, No: fail
  416. */
  417. - (BOOL)updateMessage:(EMMessage *)aMessage __deprecated_msg("Use -updateMessageChange:error:");
  418. /*!
  419. * \~chinese
  420. * 将消息设置为已读
  421. *
  422. * @param aMessageId 要设置消息的ID
  423. *
  424. * @result 是否成功
  425. *
  426. * \~english
  427. * Mark a message as read
  428. *
  429. * @param aMessageId Message's ID who will be set read status
  430. *
  431. * @result Result of mark message as read, YES: success, No: fail
  432. */
  433. - (BOOL)markMessageAsReadWithId:(NSString *)aMessageId __deprecated_msg("Use -markMessageAsReadWithId:error:");
  434. /*!
  435. * \~chinese
  436. * 将所有未读消息设置为已读
  437. *
  438. * @result 是否成功
  439. *
  440. * \~english
  441. * Mark all message as read
  442. *
  443. * @result Result of mark all message as read, YES: success, No: fail
  444. */
  445. - (BOOL)markAllMessagesAsRead __deprecated_msg("Use -markAllMessagesAsRead:");
  446. /*!
  447. * \~chinese
  448. * 更新会话扩展属性到DB
  449. *
  450. * @result 是否成功
  451. *
  452. * \~english
  453. * Update conversation extend properties to DB
  454. *
  455. * @result Extend properties update result, YES: success, No: fail
  456. */
  457. - (BOOL)updateConversationExtToDB __deprecated_msg("setExt: will update extend properties to DB");
  458. /*!
  459. * \~chinese
  460. * 获取指定ID的消息
  461. *
  462. * @param aMessageId 消息ID
  463. *
  464. * @result 消息
  465. *
  466. * \~english
  467. * Get a message with the ID
  468. *
  469. * @param aMessageId Message's id
  470. *
  471. * @result Message instance
  472. */
  473. - (EMMessage *)loadMessageWithId:(NSString *)aMessageId __deprecated_msg("Use -loadMessageWithId:error:");
  474. /*!
  475. * \~chinese
  476. * 从数据库获取指定数量的消息,取到的消息按时间排序,并且不包含参考的消息,如果参考消息的ID为空,则从最新消息向前取
  477. *
  478. * @param aMessageId 参考消息的ID
  479. * @param aLimit 获取的条数
  480. * @param aDirection 消息搜索方向
  481. *
  482. * @result 消息列表<EMMessage>
  483. *
  484. * \~english
  485. * Get more messages from DB, result messages are sorted by receive time, and NOT include the reference message, if reference messag's ID is nil, will fetch message from latest message
  486. *
  487. * @param aMessageId Reference message's ID
  488. * @param aLimit Count of messages to load
  489. * @param aDirection Message search direction
  490. *
  491. * @result Message list<EMMessage>
  492. */
  493. - (NSArray *)loadMoreMessagesFromId:(NSString *)aMessageId
  494. limit:(int)aLimit
  495. direction:(EMMessageSearchDirection)aDirection __deprecated_msg("Use -loadMessagesStartFromId:count:searchDirection:completion:");
  496. /*!
  497. * \~chinese
  498. * 从数据库获取指定类型的消息,取到的消息按时间排序,如果参考的时间戳为负数,则从最新消息向前取,如果aLimit是负数,则获取所有符合条件的消息
  499. *
  500. * @param aType 消息类型
  501. * @param aTimestamp 参考时间戳
  502. * @param aLimit 获取的条数
  503. * @param aSender 消息发送方,如果为空则忽略
  504. * @param aDirection 消息搜索方向
  505. *
  506. * @result 消息列表<EMMessage>
  507. *
  508. * \~english
  509. * Get more messages with specified type from DB, result messages are sorted by received time, if reference timestamp is negative, will fetch message from latest message, andd will fetch all messages that meet the condition if aLimit is negative
  510. *
  511. * @param aType Message type to load
  512. * @param aTimestamp Reference timestamp
  513. * @param aLimit Count of messages to load
  514. * @param aSender Message sender, will ignore it if it's empty
  515. * @param aDirection Message search direction
  516. *
  517. * @result Message list<EMMessage>
  518. */
  519. - (NSArray *)loadMoreMessagesWithType:(EMMessageBodyType)aType
  520. before:(long long)aTimestamp
  521. limit:(int)aLimit
  522. from:(NSString*)aSender
  523. direction:(EMMessageSearchDirection)aDirection __deprecated_msg("Use -loadMessagesWithType:timestamp:count:fromUser:searchDirection:completion:");
  524. /*!
  525. * \~chinese
  526. * 从数据库获取包含指定内容的消息,取到的消息按时间排序,如果参考的时间戳为负数,则从最新消息向前取,如果aLimit是负数,则获取所有符合条件的消息
  527. *
  528. * @param aKeywords 搜索关键字,如果为空则忽略
  529. * @param aTimestamp 参考时间戳
  530. * @param aLimit 获取的条数
  531. * @param aSender 消息发送方,如果为空则忽略
  532. * @param aDirection 消息搜索方向
  533. *
  534. * @result 消息列表<EMMessage>
  535. *
  536. * \~english
  537. * Get more messages contain specified keywords from DB, result messages are sorted by received time, if reference timestamp is negative, will fetch message from latest message, andd will fetch all messages that meet the condition if aLimit is negative
  538. *
  539. * @param aKeywords Search content, will ignore it if it's empty
  540. * @param aTimestamp Reference timestamp
  541. * @param aLimit Count of messages to load
  542. * @param aSender Message sender, will ignore it if it's empty
  543. * @param aDirection Message search direction
  544. *
  545. * @result Message list<EMMessage>
  546. */
  547. - (NSArray *)loadMoreMessagesContain:(NSString*)aKeywords
  548. before:(long long)aTimestamp
  549. limit:(int)aLimit
  550. from:(NSString*)aSender
  551. direction:(EMMessageSearchDirection)aDirection __deprecated_msg("Use -loadMessagesContainKeywords:timestamp:count:fromUser:searchDirection:completion:");
  552. /*!
  553. * \~chinese
  554. * 从数据库获取指定时间段内的消息,取到的消息按时间排序,为了防止占用太多内存,用户应当制定加载消息的最大数
  555. *
  556. * @param aStartTimestamp 毫秒级开始时间
  557. * @param aEndTimestamp 结束时间
  558. * @param aMaxCount 加载消息最大数
  559. *
  560. * @result 消息列表<EMMessage>
  561. *
  562. * \~english
  563. * Load messages from DB in duration, result messages are sorted by receive time, user should limit the max count to load to avoid memory issue
  564. *
  565. * @param aStartTimestamp Start time's timestamp in miliseconds
  566. * @param aEndTimestamp End time's timestamp in miliseconds
  567. * @param aMaxCount Message search direction
  568. *
  569. * @result Message list<EMMessage>
  570. */
  571. - (NSArray *)loadMoreMessagesFrom:(long long)aStartTimestamp
  572. to:(long long)aEndTimestamp
  573. maxCount:(int)aMaxCount __deprecated_msg("Use -loadMessagesFrom:to:count:completion:");
  574. /*!
  575. * \~chinese
  576. * 收到的对方发送的最后一条消息
  577. *
  578. * @result 消息实例
  579. *
  580. * \~english
  581. * Get latest message that received from others
  582. *
  583. * @result Message instance
  584. */
  585. - (EMMessage *)latestMessageFromOthers __deprecated_msg("Use -lastReceivedMessage");
  586. @end