presence: Remove user.away, replaced by a metadata entry.

Cache the metadata retrieval value where feasible for minimal performance impact.
This commit is contained in:
William Pitcock 2009-06-02 02:03:51 -05:00
parent df2688426d
commit 884b5d41c1
10 changed files with 23 additions and 37 deletions

View file

@ -744,6 +744,7 @@ static void
msg_client(int p_or_n, const char *command,
struct Client *source_p, struct Client *target_p, const char *text)
{
const char *awaymsg;
int do_floodcount = 0;
if(MyClient(source_p))
@ -788,9 +789,9 @@ msg_client(int p_or_n, const char *command,
return;
}
if(MyConnect(source_p) && (p_or_n != NOTICE) && target_p->user && target_p->user->away)
if(MyConnect(source_p) && (p_or_n != NOTICE) && target_p->user && (awaymsg = get_metadata(target_p, "away")) != NULL)
sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),
target_p->name, target_p->user->away);
target_p->name, awaymsg);
if(MyClient(target_p))
{