diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-03 23:25:45 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2022-02-03 23:25:45 +0300 |
commit | 10e5f31b740de70766618c87020254158c4520d4 (patch) | |
tree | 5939fb3e2e284494f2c1fe64d397b075c66223f0 | |
parent | fe5ca09c7c6827eaeecd09ad3448d0c0b3901427 (diff) |
Add MessageForwardOriginMessageImport support
-rw-r--r-- | telegram/utils.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index 48460e7..9b0ccba 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -204,7 +204,7 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, a c.cache.SetStatus(chatID, show, status) - gateway.SendPresence( + return gateway.SendPresence( c.xmpp, c.jid, gateway.SPFrom(strconv.FormatInt(chatID, 10)), @@ -213,8 +213,6 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, a gateway.SPPhoto(photo), gateway.SPImmed(gateway.SPImmed.Get(args)), ) - - return nil } func (c *Client) formatContact(chatID int64) string { @@ -330,6 +328,9 @@ func (c *Client) formatForward(fwd *client.MessageForwardInfo) string { signature = fmt.Sprintf(" (%s)", channel.AuthorSignature) } return c.formatContact(channel.ChatId)+signature + case client.TypeMessageForwardOriginMessageImport: + originImport := fwd.Origin.(*client.MessageForwardOriginMessageImport) + return originImport.SenderName } return "Unknown forward type" } @@ -659,6 +660,7 @@ func (c *Client) roster(resource string) { c.addResource(resource) } +// get last messages from specified chat func (c *Client) getLastMessages(id int64, query string, from int64, count int32) (*client.Messages, error) { return c.client.SearchChatMessages(&client.SearchChatMessagesRequest{ ChatId: id, |