Fix handle channel photo edits as well as group chats
This commit is contained in:
@@ -188,13 +188,19 @@ func (t *TelegramClient) onUpdateNewMessage(ctx context.Context, entities tg.Ent
|
|||||||
ChatInfoChange: &bridgev2.ChatInfoChange{ChatInfo: &bridgev2.ChatInfo{Name: &action.Title}},
|
ChatInfoChange: &bridgev2.ChatInfoChange{ChatInfo: &bridgev2.ChatInfo{Name: &action.Title}},
|
||||||
})
|
})
|
||||||
case *tg.MessageActionChatEditPhoto:
|
case *tg.MessageActionChatEditPhoto:
|
||||||
// FIXME
|
switch peer := msg.PeerID.(type) {
|
||||||
chatID := msg.PeerID.(*tg.PeerChat).ChatID
|
case *tg.PeerChat:
|
||||||
|
t.main.Bridge.QueueRemoteEvent(t.userLogin, &simplevent.ChatInfoChange{
|
||||||
|
EventMeta: eventMeta.WithType(bridgev2.RemoteEventChatInfoChange),
|
||||||
|
ChatInfoChange: &bridgev2.ChatInfoChange{ChatInfo: &bridgev2.ChatInfo{Avatar: t.avatarFromPhoto(ctx, ids.PeerTypeChat, peer.ChatID, action.Photo)}},
|
||||||
|
})
|
||||||
|
case *tg.PeerChannel:
|
||||||
|
t.main.Bridge.QueueRemoteEvent(t.userLogin, &simplevent.ChatInfoChange{
|
||||||
|
EventMeta: eventMeta.WithType(bridgev2.RemoteEventChatInfoChange),
|
||||||
|
ChatInfoChange: &bridgev2.ChatInfoChange{ChatInfo: &bridgev2.ChatInfo{Avatar: t.avatarFromPhoto(ctx, ids.PeerTypeChannel, peer.ChannelID, action.Photo)}},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
t.main.Bridge.QueueRemoteEvent(t.userLogin, &simplevent.ChatInfoChange{
|
|
||||||
EventMeta: eventMeta.WithType(bridgev2.RemoteEventChatInfoChange),
|
|
||||||
ChatInfoChange: &bridgev2.ChatInfoChange{ChatInfo: &bridgev2.ChatInfo{Avatar: t.avatarFromPhoto(ctx, ids.PeerTypeChat, chatID, action.Photo)}},
|
|
||||||
})
|
|
||||||
case *tg.MessageActionChatDeletePhoto:
|
case *tg.MessageActionChatDeletePhoto:
|
||||||
t.main.Bridge.QueueRemoteEvent(t.userLogin, &simplevent.ChatInfoChange{
|
t.main.Bridge.QueueRemoteEvent(t.userLogin, &simplevent.ChatInfoChange{
|
||||||
EventMeta: eventMeta.WithType(bridgev2.RemoteEventChatInfoChange),
|
EventMeta: eventMeta.WithType(bridgev2.RemoteEventChatInfoChange),
|
||||||
|
|||||||
Reference in New Issue
Block a user