mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
hicli/send: add discardsession command
This commit is contained in:
parent
36ad528124
commit
14c9291c8d
1 changed files with 7 additions and 0 deletions
|
@ -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 ")
|
||||
|
|
Loading…
Add table
Reference in a new issue