Options
All
  • Public
  • Public/Protected
  • All
Menu

Module SessionServiceInterface

Index

Type aliases

GetSessionsOptions: { desc?: boolean; lastSessionId?: string; limit?: number }

Type declaration

  • Optional desc?: boolean

    是否逆序获取

    为 true 则逆序,获取 lastSessionId 所在记录之后的 limit 个 为 false 则正序,获取 lastSessionId 所在记录之前的 limit 个

  • Optional lastSessionId?: string

    查询的上一批最后一条 sessionId

  • Optional limit?: number

    一页的限制数量,默认 100

Session: { ack?: number; id: string; lastMsg?: IMMessage | null; msgReceiptTime?: number; scene: TMsgScene; to: string; unread: number; unreadMsgs?: IMMessage[]; updateTime: number }

Type declaration

  • Optional ack?: number

    自己已读过的最近一条消息的时间

    用于判别自己已读到哪条消息了

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441

  • Optional lastMsg?: IMMessage | null

    上一条消息.

    若 lastMsg 为 undefined ,那么可能是从未设置过的,会话不完整。getSessions 将过滤掉此会话

    若 lastMsg 为 null,lastMsg 为 null 则可能是撤回消息,也可能是清除了这个会话的历史消息

  • Optional msgReceiptTime?: number

    聊天对象所读过的最近一条消息的时间

    与 msg.time 对比就能得知某条消息是否被对方已读

  • scene: TMsgScene

    会话场景

    p2p 单聊 team 群组 superTeam 超大群

  • to: string

    聊天对象,

    若 scene 为 p2p 单聊,则 to 为聊天对象的账号 若 scene 为 team 或者 superTeam,则 to 为 群ID

  • unread: number

    未读数

  • Optional unreadMsgs?: IMMessage[]

    自己还没读过的此会话消息

  • updateTime: number

    更新时间

SessionIdOptions: { id: string }

Type declaration

  • id: string

    sessionId

    例如 p2p-cs1、team-113879441