diff --git a/puppet.go b/puppet.go index bcf5cd7..31543dd 100644 --- a/puppet.go +++ b/puppet.go @@ -272,7 +272,8 @@ func (puppet *Puppet) UpdateName(source *User, contact skype.Contact) bool { func (puppet *Puppet) updatePortalMeta(meta func(portal *Portal)) { if puppet.bridge.Config.Bridge.PrivateChatPortalMeta { - for _, portal := range puppet.bridge.GetAllPortalsByJID(puppet.JID) { + jid := strings.Replace(puppet.JID, whatsappExt.NewUserSuffix, "", 1) + for _, portal := range puppet.bridge.GetAllPortalsByJID(jid) { meta(portal) } } @@ -306,7 +307,6 @@ func (puppet *Puppet) updatePortalName() { } func (puppet *Puppet) Sync(source *User, contact skype.Contact) { - fmt.Println("sync") err := puppet.DefaultIntent().EnsureRegistered() if err != nil { puppet.log.Errorln("Failed to ensure registered:", err) diff --git a/user.go b/user.go index 826613a..cd8bc10 100644 --- a/user.go +++ b/user.go @@ -21,7 +21,6 @@ import ( waProto "github.com/Rhymen/go-whatsapp/binary/proto" "maunium.net/go/mautrix/event" - "maunium.net/go/mautrix/format" "maunium.net/go/mautrix/id" "github.com/kelaresg/matrix-skype/database" @@ -969,17 +968,18 @@ func (user *User) HandleCommand(cmd skypeExt.Command) { go portal.UpdateAvatar(user, cmd.ProfilePicInfo) } case skypeExt.CommandDisconnect: - var msg string - if cmd.Kind == "replaced" { - msg = "\u26a0 Your WhatsApp connection was closed by the server because you opened another WhatsApp Web client.\n\n" + - "Use the `reconnect` command to disconnect the other client and resume bridging." - } else { - user.log.Warnln("Unknown kind of disconnect:", string(cmd.Raw)) - msg = fmt.Sprintf("\u26a0 Your WhatsApp connection was closed by the server (reason code: %s).\n\n"+ - "Use the `reconnect` command to reconnect.", cmd.Kind) - } - user.cleanDisconnection = true - go user.bridge.Bot.SendMessageEvent(user.GetManagementRoom(), event.EventMessage, format.RenderMarkdown(msg, true, false)) + //var msg string + //if cmd.Kind == "replaced" { + // msg = "\u26a0 Your Skype connection was closed by the server because you opened another Skype Web client.\n\n" + + // "Use the `reconnect` command to disconnect the other client and resume bridging." + //} else { + // user.log.Warnln("Unknown kind of disconnect:", string(cmd.Raw)) + // msg = fmt.Sprintf("\u26a0 Your Skype connection was closed by the server (reason code: %s).\n\n"+ + // "Use the `reconnect` command to reconnect.", cmd.Kind) + //} + //msg = "can not disconnect" + //user.cleanDisconnection = true + //go user.bridge.Bot.SendMessageEvent(user.GetManagementRoom(), event.EventMessage, format.RenderMarkdown(msg, true, false)) } }