mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33: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,
|
relatesTo *event.RelatesTo,
|
||||||
mentions *event.Mentions,
|
mentions *event.Mentions,
|
||||||
) (*database.Event, error) {
|
) (*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
|
var unencrypted bool
|
||||||
if strings.HasPrefix(text, "/unencrypted ") {
|
if strings.HasPrefix(text, "/unencrypted ") {
|
||||||
text = strings.TrimPrefix(text, "/unencrypted ")
|
text = strings.TrimPrefix(text, "/unencrypted ")
|
||||||
|
|
Loading…
Add table
Reference in a new issue