TIMConversation.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // TIMConversation.h
  3. // ImSDK
  4. //
  5. // Created by bodeng on 28/1/15.
  6. // Copyright (c) 2015 tencent. All rights reserved.
  7. //
  8. #ifndef ImSDK_TIMConversation_h
  9. #define ImSDK_TIMConversation_h
  10. #import "TIMComm.h"
  11. #import "TIMCallback.h"
  12. @class TIMMessage;
  13. /**
  14. * 会话
  15. */
  16. @interface TIMConversation : NSObject
  17. /**
  18. * 发送消息
  19. *
  20. * @param msg 消息体
  21. * @param succ 发送成功时回调
  22. * @param fail 发送失败时回调
  23. *
  24. * @return 0 本次操作成功
  25. */
  26. - (int)sendMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
  27. /**
  28. * 发送在线消息(服务器不保存消息)
  29. *
  30. * @param msg 消息体
  31. * @param succ 成功回调
  32. * @param fail 失败回调
  33. *
  34. * @return 0 成功
  35. */
  36. - (int)sendOnlineMessage:(TIMMessage*)msg succ:(TIMSucc)succ fail:(TIMFail)fail;
  37. /**
  38. * 获取会话人,单聊为对方账号,群聊为群组Id
  39. *
  40. * @return 会话人
  41. */
  42. - (NSString*)getReceiver;
  43. /**
  44. * 获取会话类型
  45. *
  46. * @return 会话类型
  47. */
  48. - (TIMConversationType)getType;
  49. /**
  50. * 获取该会话所属用户的id
  51. *
  52. * @return 用户id
  53. */
  54. - (NSString*)getSelfIdentifier;
  55. @end
  56. #endif