Add command to delete session information to force logout when the bridge gets stuck

This commit is contained in:
Tulir Asokan
2019-05-16 18:00:46 +03:00
parent c1e1964fc5
commit 5d0edda04a
3 changed files with 25 additions and 3 deletions

View File

@ -36,6 +36,8 @@ type Command struct {
*ProfilePicInfo
Kind string `json:"kind"`
Raw json.RawMessage `json:"-"`
}
type CommandHandler interface {
@ -50,6 +52,7 @@ func (ext *ExtendedConn) handleMessageCommand(message []byte) {
ext.jsonParseError(err)
return
}
event.Raw = message
event.JID = strings.Replace(event.JID, OldUserSuffix, NewUserSuffix, 1)
for _, handler := range ext.handlers {
commandHandler, ok := handler.(CommandHandler)