mirror of
https://github.com/anope/anope.git
synced 2026-07-03 05:53:12 +02:00
Move more stuff into the user class.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1189 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -1149,7 +1149,6 @@ E char *TS6SID;
|
||||
E char *TS6UPLINK;
|
||||
|
||||
E void update_host(User * user);
|
||||
E void change_user_host(User * user, const char *host);
|
||||
E void change_user_username(User * user, const char *username);
|
||||
E void change_user_realname(User * user, const char *realname);
|
||||
|
||||
|
||||
@@ -73,5 +73,10 @@ class User
|
||||
* called from ircd protocol.
|
||||
*/
|
||||
void SetNewNick(const std::string &newnick);
|
||||
|
||||
/** Update the displayed (vhost) of a user record.
|
||||
* This is used (if set) instead of real host.
|
||||
*/
|
||||
void SetDisplayedHost(const std::string &host);
|
||||
};
|
||||
|
||||
|
||||
+18
-18
@@ -105,10 +105,28 @@ void User::SetNewNick(const std::string &newnick)
|
||||
}
|
||||
}
|
||||
|
||||
void User::SetDisplayedHost(const std::string &host)
|
||||
{
|
||||
if (host.empty())
|
||||
throw "empty host? in MY services? it seems it's more likely than I thought.";
|
||||
|
||||
if (this->vhost)
|
||||
free(this->vhost);
|
||||
this->vhost = sstrdup(host.c_str());
|
||||
|
||||
if (debug)
|
||||
alog("debug: %s changes its vhost to %s", this->nick, host.c_str());
|
||||
|
||||
update_host(this);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* XXX: I don't like how this "smells". I think it belongs in NickAlias/NickCore.
|
||||
* -- w00t
|
||||
*/
|
||||
void update_host(User * user)
|
||||
{
|
||||
if (user->na && (nick_identified(user)
|
||||
@@ -130,24 +148,6 @@ void update_host(User * user)
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Change the (virtual) hostname of a user. */
|
||||
|
||||
void change_user_host(User * user, const char *host)
|
||||
{
|
||||
if (user->vhost)
|
||||
free(user->vhost);
|
||||
user->vhost = sstrdup(host);
|
||||
|
||||
if (debug)
|
||||
alog("debug: %s changes its vhost to %s", user->nick, host);
|
||||
|
||||
|
||||
|
||||
update_host(user);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/* Change the realname of a user. */
|
||||
|
||||
Reference in New Issue
Block a user