@@ -77,6 +77,12 @@ The configuration file uses a simple format of the form
|
|||||||
users join their own IRC server using an XMPP client, while forbidding
|
users join their own IRC server using an XMPP client, while forbidding
|
||||||
access to any other IRC server.
|
access to any other IRC server.
|
||||||
|
|
||||||
|
`realname_customization`
|
||||||
|
|
||||||
|
If this option is set to “false” (default is “true”), the users will not be
|
||||||
|
able to use the ad-hoc commands that lets them configure their realname and
|
||||||
|
username.
|
||||||
|
|
||||||
`log_file`
|
`log_file`
|
||||||
|
|
||||||
A filename into which logs are written. If none is provided, the logs are
|
A filename into which logs are written. If none is provided, the logs are
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <irc/irc_user.hpp>
|
#include <irc/irc_user.hpp>
|
||||||
|
|
||||||
#include <logger/logger.hpp>
|
#include <logger/logger.hpp>
|
||||||
|
#include <config/config.hpp>
|
||||||
#include <utils/tolower.hpp>
|
#include <utils/tolower.hpp>
|
||||||
#include <utils/split.hpp>
|
#include <utils/split.hpp>
|
||||||
|
|
||||||
@@ -120,11 +121,14 @@ void IrcClient::on_connected()
|
|||||||
this->send_nick_command(this->username);
|
this->send_nick_command(this->username);
|
||||||
|
|
||||||
#ifdef USE_DATABASE
|
#ifdef USE_DATABASE
|
||||||
|
if (Config::get("realname_customization", "true") == "true")
|
||||||
|
{
|
||||||
if (!options.username.value().empty())
|
if (!options.username.value().empty())
|
||||||
this->username = options.username.value();
|
this->username = options.username.value();
|
||||||
if (!options.realname.value().empty())
|
if (!options.realname.value().empty())
|
||||||
this->realname = options.realname.value();
|
this->realname = options.realname.value();
|
||||||
this->send_user_command(username, realname);
|
this->send_user_command(username, realname);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
this->send_user_command(this->username, this->realname);
|
this->send_user_command(this->username, this->realname);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <xmpp/biboumi_adhoc_commands.hpp>
|
#include <xmpp/biboumi_adhoc_commands.hpp>
|
||||||
#include <xmpp/biboumi_component.hpp>
|
#include <xmpp/biboumi_component.hpp>
|
||||||
#include <bridge/bridge.hpp>
|
#include <bridge/bridge.hpp>
|
||||||
|
#include <config/config.hpp>
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
#include <utils/split.hpp>
|
#include <utils/split.hpp>
|
||||||
#include <xmpp/jid.hpp>
|
#include <xmpp/jid.hpp>
|
||||||
@@ -191,6 +192,8 @@ void ConfigureIrcServerStep1(XmppComponent*, AdhocSession& session, XmlNode& com
|
|||||||
after_cnt_cmd.add_child(required);
|
after_cnt_cmd.add_child(required);
|
||||||
x.add_child(std::move(after_cnt_cmd));
|
x.add_child(std::move(after_cnt_cmd));
|
||||||
|
|
||||||
|
if (Config::get("realname_customization", "true") == "true")
|
||||||
|
{
|
||||||
XmlNode username("field");
|
XmlNode username("field");
|
||||||
username["var"] = "username";
|
username["var"] = "username";
|
||||||
username["type"] = "text-single";
|
username["type"] = "text-single";
|
||||||
@@ -216,6 +219,7 @@ void ConfigureIrcServerStep1(XmppComponent*, AdhocSession& session, XmlNode& com
|
|||||||
}
|
}
|
||||||
realname.add_child(required);
|
realname.add_child(required);
|
||||||
x.add_child(std::move(realname));
|
x.add_child(std::move(realname));
|
||||||
|
}
|
||||||
|
|
||||||
command_node.add_child(std::move(x));
|
command_node.add_child(std::move(x));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user