diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-09-19 14:57:52 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-09-19 14:57:52 +0300 |
commit | b68c07025d1dd077c73ec3b4052ea453612e3e9c (patch) | |
tree | 2e1cc8733919633b7849f4b94371fc2863f00019 /telegram/utils.go | |
parent | e8bde731642f50c8d272c33343ec78ca70405377 (diff) |
Add MUC history limit (maxstanzas only)
Diffstat (limited to 'telegram/utils.go')
-rw-r--r-- | telegram/utils.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index fd7a433..40553a4 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -304,7 +304,7 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, o } // JoinMUC saves MUC join fact and sends initialization data -func (c *Client) JoinMUC(chatId int64, resource string) { +func (c *Client) JoinMUC(chatId int64, resource string, limit int32) { // save the nickname in this MUC, also as a marker of join c.locks.mucResourcesLock.Lock() oldMap, ok := c.mucResources[chatId] @@ -324,7 +324,7 @@ func (c *Client) JoinMUC(chatId int64, resource string) { c.sendMUCStatuses(chatId) - messages, err := c.getNLastMessages(chatId, 20) + messages, err := c.getNLastMessages(chatId, limit) if err == nil { c.sendMessagesReverse(chatId, messages, false, c.jid+"/"+resource) } |