diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-19 00:47:08 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-19 00:47:08 +0300 |
commit | 22b46c71ce932cc97fa6d437a7473a653bb59a41 (patch) | |
tree | 5b247efdcf7afaba688cc4ab09945ccc3934a71e /telegram | |
parent | 281b9691af8dda2225c74efb99b98f4acc33c457 (diff) |
gofmt
Diffstat (limited to 'telegram')
-rw-r--r-- | telegram/commands.go | 8 | ||||
-rw-r--r-- | telegram/handlers.go | 2 | ||||
-rw-r--r-- | telegram/utils.go | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/telegram/commands.go b/telegram/commands.go index 368a461..2a72219 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -52,10 +52,10 @@ var transportCommands = map[string]command{ "setpassword": command{"[old] [new]", "set or remove password"}, "config": command{"[param] [value]", "view or update configuration options"}, "report": command{"[chat] [comment]", "report a chat by id or @username"}, - "add": command{"@username", "add @username to your chat list"}, - "join": command{"https://t.me/invite_link", "join to chat via invite link or @publicname"}, - "supergroup": command{"title description", "create new supergroup «title» with «description»"}, - "channel": command{"title description", "create new channel «title» with «description»"}, + "add": command{"@username", "add @username to your chat list"}, + "join": command{"https://t.me/invite_link", "join to chat via invite link or @publicname"}, + "supergroup": command{"title description", "create new supergroup «title» with «description»"}, + "channel": command{"title description", "create new channel «title» with «description»"}, } var chatCommands = map[string]command{ diff --git a/telegram/handlers.go b/telegram/handlers.go index 84e3748..bd768ae 100644 --- a/telegram/handlers.go +++ b/telegram/handlers.go @@ -242,7 +242,7 @@ func (c *Client) updateMessageContent(update *client.UpdateMessageContent) { textContent.Text.Entities, markupFunction, )) - gateway.SendMessage(c.jid, strconv.FormatInt(update.ChatId, 10), text, "e" + strconv.FormatInt(update.MessageId, 10), c.xmpp, nil, false) + gateway.SendMessage(c.jid, strconv.FormatInt(update.ChatId, 10), text, "e"+strconv.FormatInt(update.MessageId, 10), c.xmpp, nil, false) } } diff --git a/telegram/utils.go b/telegram/utils.go index 99492e1..905a97b 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -320,7 +320,7 @@ func (c *Client) getMessageReply(message *client.Message) (reply *gateway.Reply, return } - reply = &gateway.Reply { + reply = &gateway.Reply{ Author: fmt.Sprintf("%v@%s", c.getSenderId(replyMsg), gateway.Jid.Full()), Id: strconv.FormatInt(message.ReplyToMessageId, 10), } @@ -770,8 +770,8 @@ func (c *Client) messageToPrefix(message *client.Message, previewString string, } // reply to if message.ReplyToMessageId != 0 { - replyStart = c.countCharsInLines(&prefix) + (len(prefix) - 1) * len(messageHeaderSeparator) - replyLine := "reply: "+c.formatMessage(message.ChatId, message.ReplyToMessageId, true, replyMsg) + replyStart = c.countCharsInLines(&prefix) + (len(prefix)-1)*len(messageHeaderSeparator) + replyLine := "reply: " + c.formatMessage(message.ChatId, message.ReplyToMessageId, true, replyMsg) prefix = append(prefix, replyLine) replyEnd = replyStart + len(replyLine) + len(messageHeaderSeparator) } @@ -891,7 +891,7 @@ func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) { isOutgoing := isPM && message.IsOutgoing if isOutgoing { for resource := range c.resourcesRange() { - jids = append(jids, c.jid + "/" + resource) + jids = append(jids, c.jid+"/"+resource) } } else { jids = []string{c.jid} |