Use isupport informations to know the user modes when joining

Also remove the duplicate send_self_join methods, user only send_user_join
This commit is contained in:
Florent Le Coz
2014-01-04 01:59:36 +01:00
parent a075517824
commit acf769d83a
9 changed files with 68 additions and 76 deletions
+11 -7
View File
@@ -189,14 +189,18 @@ void Bridge::send_xmpp_message(const std::string& from, const std::string& autho
void Bridge::send_user_join(const std::string& hostname,
const std::string& chan_name,
const IrcUser* user)
const IrcUser* user,
const bool self)
{
this->xmpp->send_user_join(chan_name + "%" + hostname, user->nick, user->host, this->user_jid);
}
void Bridge::send_self_join(const std::string& hostname, const std::string& chan_name, const std::string nick)
{
this->xmpp->send_self_join(chan_name + "%" + hostname, nick, this->user_jid);
std::string affiliation = "participant";
std::string role = "none";
if (user->modes.find('o') != user->modes.end())
{
affiliation = "admin";
role = "moderator";
}
this->xmpp->send_user_join(chan_name + "%" + hostname, user->nick, user->host,
affiliation, role, this->user_jid, self);
}
void Bridge::send_topic(const std::string& hostname, const std::string& chan_name, const std::string topic)