swiftui-shapes
swiftui-shapes copied to clipboard
TalkerId is not existed for some room messages
Background
talkerId is required for all Wechaty messages by desigin, or exceptions will be raised when call message.ready():
https://github.com/wechaty/wechaty/blob/435cefd90baf7f2a0c801010132e74f9e0575fc2/src/user-modules/message.ts#L270-L279
Problem
BUT, there are some exceptions that we cannot parse talkerId from message payload. AND these messages SHOULD not have any specified talkers logically, such as notification messages sent by the system.
One example: when you are creating a room with members that have deleted you unilaterally, then you will get a system message as warning:

{
"atList": [],
"binarypayload": "",
"content": "已向PadLocal发送群聊邀请,为了减少打扰,需对方同意邀请后才会进入群聊",
"createtime": 1654422381,
"fromusername": "xxx@chatroom",
"id": "xxx",
"pushcontent": "",
"tousername": "xxx",
"type": 10000
}
Suggest
I have following suggestions, #1 is preferred.
- I think we can accept
talkerIdis optional for room messages, so that Wechaty users can recevie these kind of message. - Set the
talkertopuppet.currentUserId, treating these messages are sent by self. - Add add a special symbol for
talkerIdto represent the system. This may need a lot of working and introduce new concept which is bad.