From c03ccfdfb713d4fcb089600d9fd91f03e469daca Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Wed, 2 Aug 2023 17:08:06 -0400 Subject: Support urn:xmpp:privilege:2 --- telegram/commands.go | 2 +- telegram/utils.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'telegram') diff --git a/telegram/commands.go b/telegram/commands.go index 206e049..0c83945 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -384,7 +384,7 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string } case "config": if len(args) > 1 { - if !gateway.MessageOutgoingPermission && args[0] == "carbons" && args[1] == "true" { + if gateway.MessageOutgoingPermissionVersion == 0 && args[0] == "carbons" && args[1] == "true" { return "The server did not allow to enable carbons" } diff --git a/telegram/utils.go b/telegram/utils.go index 62ce945..4caf88c 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -842,7 +842,7 @@ func (c *Client) messageToPrefix(message *client.Message, previewString string, prefix := []string{} // message direction var directionChar string - if !isPM || !gateway.MessageOutgoingPermission || !c.Session.Carbons { + if !isPM || gateway.MessageOutgoingPermissionVersion == 0 || !c.Session.Carbons { if c.Session.AsciiArrows { if message.IsOutgoing { directionChar = "> " @@ -914,7 +914,7 @@ func (c *Client) ensureDownloadFile(file *client.File) *client.File { func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) { var isPM bool var err error - if gateway.MessageOutgoingPermission && c.Session.Carbons { + if gateway.MessageOutgoingPermissionVersion > 0 && c.Session.Carbons { isPM, err = c.IsPM(chatId) if err != nil { log.Errorf("Could not determine if chat is PM: %v", err) -- cgit v1.2.3