# HG changeset patch # User Seve Ferrer # Date 1601649757 -7200 # Node ID cf31a5ef8a9bcf64055b912095711fcc2deb1341 # Parent 9813b17ee09677afd1d1a503759058740eb350b5 verse.plugins.groupchat: Add support for MUC passwords https://xmpp.org/extensions/xep-0045.html#example-27 diff -r 9813b17ee096 -r cf31a5ef8a9b plugins/groupchat.lua --- a/plugins/groupchat.lua Mon Jun 17 12:32:00 2019 +0100 +++ b/plugins/groupchat.lua Fri Oct 02 16:42:37 2020 +0200 @@ -38,7 +38,7 @@ end end, 500); - function stream:join_room(jid, nick, opts) + function stream:join_room(jid, nick, opts, password) if not nick then return false, "no nickname supplied" end @@ -104,6 +104,9 @@ end end, 2000); local join_st = verse.presence():tag("x",{xmlns = xmlns_muc}):reset(); + if password then + join_st:get_child("x", xmlns_muc):tag("password"):text(password):reset(); + end self:event("pre-groupchat/joining", join_st); room:send(join_st) self:event("groupchat/joining", room);