From 8483af9c0adedb60d8c283a81840997506fff093 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 25 Aug 2018 00:45:50 +0300 Subject: [PATCH] Stop setting room name for private chats --- portal.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/portal.go b/portal.go index 55ad18b..d7bfb01 100644 --- a/portal.go +++ b/portal.go @@ -227,9 +227,9 @@ func (portal *Portal) CreateMatrixRoom() error { name := portal.Name topic := portal.Topic isPrivateChat := false - if strings.HasSuffix(portal.JID, whatsapp_ext.NewUserSuffix) { - puppet := portal.user.GetPuppetByJID(portal.JID) - name = puppet.Displayname + invite := []string{portal.user.ID} + if portal.IsPrivateChat() { + name = "" topic = "WhatsApp private chat" isPrivateChat = true } @@ -237,7 +237,7 @@ func (portal *Portal) CreateMatrixRoom() error { Visibility: "private", Name: name, Topic: topic, - Invite: []string{portal.user.ID}, + Invite: invite, Preset: "private_chat", IsDirect: isPrivateChat, })