summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
commit253d5824c400ae77e728f7e4a1b3cede80414545 (patch)
tree77c4312b6a8d3a452081901d9c0b7adfdab9fc8f /src
parent726b74f3555c3b7def554f293cf7d6d12a3a3393 (diff)
Add User::SetRealname().
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1193 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/users.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/users.c b/src/users.c
index 83a337e38..408dba10b 100644
--- a/src/users.c
+++ b/src/users.c
@@ -103,6 +103,9 @@ void User::SetNewNick(const std::string &newnick)
if (this->na)
this->na->u = this;
}
+
+ if (debug)
+ alog("debug: %s changed nick to %s", this->nick, newnick.c_str());
}
void User::SetDisplayedHost(const std::string &host)
@@ -115,7 +118,7 @@ void User::SetDisplayedHost(const std::string &host)
this->vhost = sstrdup(host.c_str());
if (debug)
- alog("debug: %s changes its vhost to %s", this->nick, host.c_str());
+ alog("debug: %s changed vhost to %s", this->nick, host.c_str());
update_host(this);
}
@@ -135,25 +138,27 @@ void User::SetIdent(const std::string &ident)
update_host(this);
}
-
-
-void change_user_realname(User * user, const char *realname)
+void User::SetRealname(const std::string &realname)
{
- if (user->realname)
- free(user->realname);
- user->realname = sstrdup(realname);
+ if (realname.empty())
+ throw "realname empty in SetRealname";
- if (user->na && (nick_identified(user)
- || (!(user->na->nc->flags & NI_SECURE)
- && nick_recognized(user)))) {
- if (user->na->last_realname)
- free(user->na->last_realname);
- user->na->last_realname = sstrdup(realname);
- }
+ if (this->realname)
+ free(this->realname);
+ this->realname = sstrdup(realname);
- if (debug)
- alog("debug: %s changes its realname to %s", user->nick, realname);
+ if (this->na && (nick_identified(this) ||
+ (!(this->na->nc->flags & NI_SECURE) && nick_recognized(this))))
+ {
+ if (this->na->last_realname)
+ free(this->na->last_realname);
+ this->na->last_realname = sstrdup(realname);
+ }
+
+ if (debug)
+ alog("debug: %s changed realname to %s", this->nick, realname);
}
+
/*************************************************************************/
/*************************************************************************/