From c036ed1f512792bb6cf35bcc329300a522e18a0a Mon Sep 17 00:00:00 2001 From: "Robin Burchell w00t@inspircd.org" Date: Tue, 30 Sep 2008 18:45:09 +0000 Subject: Move more stuff into the user class. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1189 5417fbe8-f217-4b02-8779-1006273d7864 --- src/users.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/users.c') diff --git a/src/users.c b/src/users.c index 83897fecf..78626c060 100644 --- a/src/users.c +++ b/src/users.c @@ -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. */ -- cgit