Convert received modes into roles and affiliations
This commit is contained in:
@@ -484,3 +484,25 @@ void XmppComponent::send_nickname_conflict_error(const std::string& muc_name,
|
||||
presence.close();
|
||||
this->send_stanza(presence);
|
||||
}
|
||||
|
||||
void XmppComponent::send_affiliation_role_change(const std::string& muc_name,
|
||||
const std::string& target,
|
||||
const std::string& affiliation,
|
||||
const std::string& role,
|
||||
const std::string& jid_to)
|
||||
{
|
||||
Stanza presence("presence");
|
||||
presence["from"] = muc_name + "@" + this->served_hostname + "/" + target;
|
||||
presence["to"] = jid_to;
|
||||
XmlNode x("x");
|
||||
x["xmlns"] = MUC_USER_NS;
|
||||
XmlNode item("item");
|
||||
item["affiliation"] = affiliation;
|
||||
item["role"] = role;
|
||||
item.close();
|
||||
x.add_child(std::move(item));
|
||||
x.close();
|
||||
presence.add_child(std::move(x));
|
||||
presence.close();
|
||||
this->send_stanza(presence);
|
||||
}
|
||||
|
||||
@@ -112,6 +112,15 @@ public:
|
||||
void send_nickname_conflict_error(const std::string& muc_name,
|
||||
const std::string& nickname,
|
||||
const std::string& jid_to);
|
||||
/**
|
||||
* Send a presence from the MUC indicating a change in the role and/or
|
||||
* affiliation of a participant
|
||||
*/
|
||||
void send_affiliation_role_change(const std::string& muc_name,
|
||||
const std::string& target,
|
||||
const std::string& affiliation,
|
||||
const std::string& role,
|
||||
const std::string& jid_to);
|
||||
/**
|
||||
* Handle the various stanza types
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user