handletelegram: improve chat migrate logs
This commit is contained in:
@@ -41,7 +41,7 @@ require (
|
||||
golang.org/x/sync v0.19.0
|
||||
golang.org/x/tools v0.40.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
maunium.net/go/mautrix v0.26.2-0.20251216172926-33eb00fde0e2
|
||||
maunium.net/go/mautrix v0.26.2-0.20251219110634-af06098723ba
|
||||
rsc.io/qr v0.2.0
|
||||
)
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
|
||||
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
|
||||
maunium.net/go/mautrix v0.26.2-0.20251216172926-33eb00fde0e2 h1:2Jrsbhl5RHcRsvWYVcgQ5nlgLuxqeM8U2fdU1LU18GI=
|
||||
maunium.net/go/mautrix v0.26.2-0.20251216172926-33eb00fde0e2/go.mod h1:UySSpb8OqXG1sMJ6dDqyzmfcqr2ayZK+KzwqOTAkAOM=
|
||||
maunium.net/go/mautrix v0.26.2-0.20251219110634-af06098723ba h1:vICZZxBRqLmBKjptFVmepUBtcSKdCAkUF9hU90aT4zQ=
|
||||
maunium.net/go/mautrix v0.26.2-0.20251219110634-af06098723ba/go.mod h1:UySSpb8OqXG1sMJ6dDqyzmfcqr2ayZK+KzwqOTAkAOM=
|
||||
rsc.io/qr v0.2.0 h1:6vBLea5/NRMVTz8V66gipeLycZMl/+UlFmk8DvqQ6WY=
|
||||
rsc.io/qr v0.2.0/go.mod h1:IF+uZjkb9fqyeF/4tlBoynqmQxUoPfWEKh921coOuXs=
|
||||
|
||||
@@ -274,7 +274,8 @@ func (t *TelegramClient) handleServiceMessage(ctx context.Context, msg *tg.Messa
|
||||
Str("sender", string(sender.Sender)).
|
||||
Str("sender_login", string(sender.SenderLogin)).
|
||||
Bool("is_from_me", sender.IsFromMe).
|
||||
Stringer("peer_id", msg.PeerID)
|
||||
Stringer("peer_id", msg.PeerID).
|
||||
Type("action_message_type", msg.Action)
|
||||
},
|
||||
StreamOrder: int64(msg.GetID()),
|
||||
}
|
||||
@@ -545,7 +546,10 @@ func (t *TelegramClient) handleServiceMessage(ctx context.Context, msg *tg.Messa
|
||||
return resultToError(res)
|
||||
|
||||
case *tg.MessageActionChatMigrateTo:
|
||||
log.Debug().Int64("channel_id", action.ChannelID).Msg("MessageActionChatMigrateTo")
|
||||
log.Debug().
|
||||
Str("old_portal_id", string(eventMeta.PortalKey.ID)).
|
||||
Int64("channel_id", action.ChannelID).
|
||||
Msg("MessageActionChatMigrateTo")
|
||||
newPortalKey := t.makePortalKeyFromID(ids.PeerTypeChannel, action.ChannelID, 0)
|
||||
if err := t.migrateChat(ctx, eventMeta.PortalKey, newPortalKey); err != nil {
|
||||
log.Err(err).Msg("Failed to migrate chat to channel")
|
||||
|
||||
Reference in New Issue
Block a user