fix: preserve p2p topic for IM system notices

This commit is contained in:
richjohnrambo
2026-09-13 16:00:58 +08:00
parent ccbd385d2f
commit f1279ac607
4 changed files with 116 additions and 20 deletions
+12 -8
View File
@@ -863,6 +863,9 @@ type ServerComMessage struct {
// Session ID to skip when sendng packet to sessions. Used to skip sending to original session.
// Could be either empty.
SkipSid string `json:"-"`
// PreserveTopicName prevents p2p/channel topic aliasing for server-generated
// messages which are already using the API-visible topic name.
PreserveTopicName bool `json:"-"`
// User id affected by this message.
uid types.Uid
}
@@ -874,14 +877,15 @@ func (src *ServerComMessage) copy() *ServerComMessage {
return nil
}
dst := &ServerComMessage{
TenantID: src.TenantID,
Id: src.Id,
RcptTo: src.RcptTo,
AsUser: src.AsUser,
Timestamp: src.Timestamp,
sess: src.sess,
SkipSid: src.SkipSid,
uid: src.uid,
TenantID: src.TenantID,
Id: src.Id,
RcptTo: src.RcptTo,
AsUser: src.AsUser,
Timestamp: src.Timestamp,
sess: src.sess,
SkipSid: src.SkipSid,
PreserveTopicName: src.PreserveTopicName,
uid: src.uid,
}
dst.Ctrl = src.Ctrl.copy()