mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-13 14:16:08 +00:00
fix(channels): add display_name to session metadata for Feishu, Zalo, Slack (#536)
Sessions page shows raw IDs instead of sender names because these channels didn't include display_name in their message metadata. The gateway's extractSessionMetadata() already looks for this key but it was missing from Feishu, Zalo Personal, and Slack message payloads. Co-authored-by: Luvu182 <208665161+Luvu182@users.noreply.github.com>
This commit is contained in:
1 parent
a506b297cf
commit
97f4942943
3 files changed
+9
-5
No files matched your search
@@ -169,6 +169,7 @@ func (c *Channel) handleMessageEvent(ctx context.Context, event *MessageEvent) {
|
||||
"message_id": messageID,
|
||||
"chat_type": mc.ChatType,
|
||||
"sender_name": senderName,
|
||||
"display_name": senderName,
|
||||
"mentioned_bot": fmt.Sprintf("%t", mc.MentionedBot),
|
||||
"platform": channels.TypeFeishu,
|
||||
}
|
||||
|
||||
@@ -253,6 +253,7 @@ func (c *Channel) handleMessage(ev *slackevents.MessageEvent) {
|
||||
"message_id": ev.TimeStamp,
|
||||
"user_id": senderID,
|
||||
"username": displayName,
|
||||
"display_name": displayName,
|
||||
"channel_id": channelID,
|
||||
"is_dm": fmt.Sprintf("%t", isDM),
|
||||
"local_key": localKey,
|
||||
|
||||
@@ -68,8 +68,9 @@ func (c *Channel) handleDM(msg protocol.UserMessage) {
|
||||
}
|
||||
|
||||
metadata := map[string]string{
|
||||
"message_id": msg.Data.MsgID,
|
||||
"platform": channels.TypeZaloPersonal,
|
||||
"message_id": msg.Data.MsgID,
|
||||
"platform": channels.TypeZaloPersonal,
|
||||
"display_name": senderName,
|
||||
}
|
||||
c.HandleMessage(senderID, threadID, content, media, metadata, "direct")
|
||||
}
|
||||
@@ -147,9 +148,10 @@ func (c *Channel) handleGroupMessage(msg protocol.GroupMessage) {
|
||||
}
|
||||
|
||||
metadata := map[string]string{
|
||||
"message_id": msg.Data.MsgID,
|
||||
"platform": channels.TypeZaloPersonal,
|
||||
"group_id": threadID,
|
||||
"message_id": msg.Data.MsgID,
|
||||
"platform": channels.TypeZaloPersonal,
|
||||
"group_id": threadID,
|
||||
"display_name": senderName,
|
||||
}
|
||||
c.HandleMessage(senderID, threadID, finalContent, allMedia, metadata, "group")
|
||||
|
||||
|
||||
Reference in new issue
Block a user