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,