Add MessageForwardOriginMessageImport support

calls
Bohdan Horbeshko 2 years ago
parent fe5ca09c7c
commit 10e5f31b74

@ -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,

Loading…
Cancel
Save