meowlib/client/helpers/storageHelper.go

16 lines
392 B
Go
Raw Normal View History

2024-04-06 12:55:27 +02:00
package helpers
import (
"forge.redroom.link/yves/meowlib/client"
)
2024-05-28 16:47:04 +02:00
func LoadMessagesHistory(peer_uid string) ([]client.InternalUserMessage, string, error) {
2024-04-06 12:55:27 +02:00
id := client.GetConfig().GetIdentity()
2024-05-28 16:47:04 +02:00
peer := id.Peers.GetFromUid(peer_uid)
2024-04-06 12:55:27 +02:00
msgs, err := peer.LoadMessagesHistory(0, 0, 50)
if err != nil {
return nil, "LoadLastMessages: LoadMessagesHistory", err
}
return msgs, "", nil
}