hicli/send: add discardsession command

This commit is contained in:
Tulir Asokan 2025-02-07 19:23:36 +02:00
parent 36ad528124
commit 14c9291c8d

View file

@ -71,6 +71,13 @@ func (h *HiClient) SendMessage(
relatesTo *event.RelatesTo,
mentions *event.Mentions,
) (*database.Event, error) {
if text == "/discardsession" {
err := h.CryptoStore.RemoveOutboundGroupSession(ctx, roomID)
if err != nil {
return nil, err
}
return nil, fmt.Errorf("outbound megolm session successfully discarded")
}
var unencrypted bool
if strings.HasPrefix(text, "/unencrypted ") {
text = strings.TrimPrefix(text, "/unencrypted ")