Software /
code /
prosody
Diff
plugins/muc/mod_muc.lua @ 9240:f9a83aca4421
MUC: Add support for registering with a MUC, including reserving a nickname as per XEP-0045
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 03 Sep 2018 12:26:25 +0100 |
parent | 9237:b86c2e135797 |
child | 9626:4d3ab7153153 |
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua Mon Sep 03 12:19:42 2018 +0100 +++ b/plugins/muc/mod_muc.lua Mon Sep 03 12:26:25 2018 +0100 @@ -81,6 +81,11 @@ room_mt.get_historylength = history.get_length; room_mt.set_historylength = history.set_length; +local register = module:require "muc/register"; +room_mt.get_registered_nick = register.get_registered_nick; +room_mt.get_registered_jid = register.get_registered_jid; +room_mt.handle_register_iq = register.handle_register_iq; + local jid_split = require "util.jid".split; local jid_bare = require "util.jid".bare; local st = require "util.stanza"; @@ -401,6 +406,7 @@ ["iq-get/bare/http://jabber.org/protocol/muc#owner:query"] = "handle_owner_query_get_to_room" ; ["message/bare"] = "handle_message_to_room" ; ["presence/bare"] = "handle_presence_to_room" ; + ["iq/bare/jabber:iq:register:query"] = "handle_register_iq"; -- Host room ["iq-get/host/http://jabber.org/protocol/disco#info:query"] = "handle_disco_info_get_query" ; ["iq-get/host/http://jabber.org/protocol/disco#items:query"] = "handle_disco_items_get_query" ;