meowlib/client/helpers/storageHelper.go

16 lines
376 B
Go
Raw Normal View History

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