deleteSession static method

Future<NIMResult<void>> deleteSession(
  1. String sessionId,
  2. NIMSessionType sessionType,
  3. NIMSessionDeleteType deleteType,
  4. bool sendAck, {
  5. bool deleteHistory = false,
})

删除会话

Implementation

static Future<NIMResult<void>> deleteSession(String sessionId,
    NIMSessionType sessionType, NIMSessionDeleteType deleteType, bool sendAck,
    {bool deleteHistory = false}) {
  var messageService = NimCore.instance.messageService;
  return messageService
      .deleteSession(
          sessionInfo:
              NIMSessionInfo(sessionId: sessionId, sessionType: sessionType),
          deleteType: deleteType,
          sendAck: sendAck)
      .then((value) {
    if (value.isSuccess && deleteHistory) {
      messageService.clearServerHistory(sessionId, sessionType, false);
    }
    return value;
  });
}