|
|
|
@ -292,7 +292,7 @@ func HandlePresence(s xmpp.Sender, p stanza.Packet) {
|
|
|
|
|
var mucExt stanza.MucPresence
|
|
|
|
|
prs.Get(&mucExt)
|
|
|
|
|
if mucExt.XMLName.Space != "" {
|
|
|
|
|
handleMUCPresence(s, prs)
|
|
|
|
|
handleMUCPresence(s, prs, mucExt)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -403,7 +403,7 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func handleMUCPresence(s xmpp.Sender, p stanza.Presence) {
|
|
|
|
|
func handleMUCPresence(s xmpp.Sender, p stanza.Presence, mucExt stanza.MucPresence) {
|
|
|
|
|
log.WithFields(log.Fields{
|
|
|
|
|
"type": p.Type,
|
|
|
|
|
"from": p.From,
|
|
|
|
@ -458,7 +458,11 @@ func handleMUCPresence(s xmpp.Sender, p stanza.Presence) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
session.JoinMUC(chatId, fromResource)
|
|
|
|
|
limit, ok := mucExt.History.MaxStanzas.Get()
|
|
|
|
|
if !ok {
|
|
|
|
|
limit = 20
|
|
|
|
|
}
|
|
|
|
|
session.JoinMUC(chatId, fromResource, int32(limit))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|