From 261ea31c7502d8bd1dc8f8ae0b4cb235cf9dc3e8 Mon Sep 17 00:00:00 2001 From: zhaoYangguang <1163765691@qq.com> Date: Thu, 24 Sep 2020 20:22:06 +0800 Subject: [PATCH] sync up leave group from skype --- portal.go | 2 +- skype-ext/chat.go | 1 + user.go | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index f8cbaaa..efc9bf2 100644 --- a/portal.go +++ b/portal.go @@ -1127,7 +1127,7 @@ func (portal *Portal) CreateMatrixRoom(user *User) error { // content.Users[user.MXID] = 100 //} // When creating a room, make user self the highest level of authority - content.Users[user.MXID] = 100 + content.Users[user.MXID] = 99 initialState := []*event.Event{{ Type: event.StatePowerLevels, Content: event.Content{ diff --git a/skype-ext/chat.go b/skype-ext/chat.go index 5a41d6b..70453dd 100644 --- a/skype-ext/chat.go +++ b/skype-ext/chat.go @@ -49,6 +49,7 @@ const ( ChatActionAdd ChatActionType = "add" ChatActionIntroduce ChatActionType = "introduce" ChatActionCreate ChatActionType = "create" + ChatActionThread ChatActionType = "Thread" ) const ( diff --git a/user.go b/user.go index 552bb80..1ea6870 100644 --- a/user.go +++ b/user.go @@ -1087,6 +1087,14 @@ func (user *User) HandleChatUpdate(cmd skype.Resource) { go portal.membershipAdd(cmd.Content) case skypeExt.ChatMemberDelete: go portal.membershipRemove(cmd.Content) + case "": + if skypeExt.ChatActionType(cmd.Type) == skypeExt.ChatActionThread { + if len(cmd.ETag) > 0 && len(cmd.Properties.Capabilities) < 1{ + portal.Delete() + portal.Cleanup(false) + } + } + //case skypeExt.ChatActionAddTopic: // go portal.UpdateTopic(cmd.Data.AddTopic.Topic, cmd.Data.SenderJID) //case skypeExt.ChatActionRemoveTopic: