File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -878,11 +878,14 @@ extension IMConversation {
878878 // MARK: Message Reading
879879
880880 private func _read( message: IMMessage ? ) {
881- guard self . unreadMessageCount > 0 ,
881+ guard
882+ self . convType != . transient,
883+ self . unreadMessageCount > 0 ,
882884 let message = message ?? self . lastMessage,
883885 let messageID = message. ID,
884- let timestamp = message. sentTimestamp else {
885- return
886+ let timestamp = message. sentTimestamp
887+ else {
888+ return
886889 }
887890 self . isUnreadMessageContainMention = false
888891 self . client? . sendCommand ( constructor: { ( ) -> IMGenericCommand in
@@ -1169,6 +1172,17 @@ extension IMConversation {
11691172 reason: " Not support, client options not contains \( IMClient . Options. receiveUnreadMessageCountAfterSessionDidOpen) . " )
11701173 }
11711174 }
1175+ guard
1176+ self . convType != . transient,
1177+ self . convType != . system
1178+ else {
1179+ let convClassName = ( self . convType == . transient)
1180+ ? " \( IMChatRoom . self) "
1181+ : " \( IMServiceConversation . self) "
1182+ throw LCError (
1183+ code: . inconsistency,
1184+ reason: " \( convClassName) NOT support this function. " )
1185+ }
11721186 self . client? . sendCommand ( constructor: { ( ) -> IMGenericCommand in
11731187 var outCommand = IMGenericCommand ( )
11741188 outCommand. cmd = . conv
You can’t perform that action at this time.
0 commit comments