HandleMute: property set silent and MuteUntil
This commit is contained in:
@@ -1125,11 +1125,16 @@ func (t *TelegramClient) HandleMute(ctx context.Context, msg *bridgev2.MatrixMut
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
until := int(msg.Content.GetMutedUntilTime().Unix())
|
||||||
|
settings := tg.InputPeerNotifySettings{
|
||||||
|
Silent: until > 0,
|
||||||
|
MuteUntil: until,
|
||||||
|
}
|
||||||
|
|
||||||
_, err = t.client.API().AccountUpdateNotifySettings(ctx, &tg.AccountUpdateNotifySettingsRequest{
|
_, err = t.client.API().AccountUpdateNotifySettings(ctx, &tg.AccountUpdateNotifySettingsRequest{
|
||||||
Peer: &tg.InputNotifyPeer{Peer: inputPeer},
|
Peer: &tg.InputNotifyPeer{Peer: inputPeer},
|
||||||
Settings: tg.InputPeerNotifySettings{
|
Settings: settings,
|
||||||
MuteUntil: int(msg.Content.GetMutedUntilTime().Unix()),
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user