NIMRecentSession.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // NIMRecentSession.h
  3. // NIMLib
  4. //
  5. // Created by Netease.
  6. // Copyright (c) 2015 Netease. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @class NIMMessage;
  11. @class NIMSession;
  12. /**
  13. * 最近会话
  14. */
  15. @interface NIMRecentSession : NSObject
  16. /**
  17. * 当前会话
  18. */
  19. @property (nullable,nonatomic,readonly,copy) NIMSession *session;
  20. /**
  21. * 最后一条消息
  22. */
  23. @property (nullable,nonatomic,readonly,strong) NIMMessage *lastMessage;
  24. /**
  25. * 未读消息数
  26. */
  27. @property (nonatomic,assign) NSInteger unreadCount;
  28. /**
  29. * 本地扩展
  30. */
  31. @property (nullable,nonatomic,readonly,copy) NSDictionary *localExt;
  32. /**
  33. * 服务端会话的最新更新时间,本地会话无效
  34. */
  35. @property (nonatomic,readonly,assign) NSTimeInterval updateTime;
  36. /**
  37. * 会话服务扩展字段(本地会话该字段无效)
  38. */
  39. @property (nonatomic,copy) NSString *serverExt;
  40. @end
  41. /**
  42. * 检索最近会话选项
  43. */
  44. @interface NIMRecentSessionOption : NSObject
  45. /**
  46. * 最后一条消息过滤
  47. * @discusssion 最近会话里lastMessage为非过滤类型里的最后一条。例:@[@(NIMMessageTypeNotification)],
  48. * 表示返回的最近会话里lastMessage是最后一条非NIMMessageTypeNotification类型的消息。
  49. */
  50. @property (nonatomic, strong) NSArray<NSNumber *> *filterLastMessageTypes;
  51. @end
  52. /**
  53. * 获取服务端会话列表可选参数
  54. */
  55. @interface NIMFetchServerSessionOption : NSObject
  56. /**
  57. * 最小时间戳,作为请求参数时表示增量获取Session列表,单位毫秒
  58. */
  59. @property (nonatomic, assign) NSTimeInterval minTimestamp;
  60. /**
  61. * 最大时间戳,翻页时使用, 单位毫秒,默认为当前时间
  62. */
  63. @property (nonatomic, assign) NSTimeInterval maxTimestamp;
  64. /**
  65. * 是否需要lastMsg,默认 YES
  66. */
  67. @property (nonatomic, assign) BOOL needLastMessage;
  68. /**
  69. * 结果集limit,最大100,默认100
  70. */
  71. @property (nonatomic, assign) NSInteger limit;
  72. @end
  73. NS_ASSUME_NONNULL_END