aboutsummaryrefslogtreecommitdiffstats
path: root/irc_user.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-04-14 15:35:41 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2010-04-14 15:35:41 +0200
commit003a12bd2361cd1ce4d83eeaa1b81d95101ea778 (patch)
treedb8349d136c9beecdb8b85f08e81d2f7fa4816d2 /irc_user.c
parentd7d677dac118a1240ada9ddcc8617c49293e5a5e (diff)
Restored all remaining IRC commands that make some sense to have at this
point.
Diffstat (limited to 'irc_user.c')
-rw-r--r--irc_user.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/irc_user.c b/irc_user.c
index 7b2d4be1..13c6d5bd 100644
--- a/irc_user.c
+++ b/irc_user.c
@@ -132,6 +132,25 @@ gint irc_user_cmp( gconstpointer a_, gconstpointer b_ )
return strcmp( a->key, b->key );
}
+const char *irc_user_get_away( irc_user_t *iu )
+{
+ irc_t *irc = iu->irc;
+ bee_user_t *bu = iu->bu;
+
+ if( iu == irc->user )
+ return set_getstr( &irc->b->set, "away" );
+ else if( bu )
+ {
+ if( !bu->flags & BEE_USER_ONLINE )
+ return "Offline";
+ else if( bu->flags & BEE_USER_AWAY )
+ /* TODO: status msgs, etc. */
+ return bu->status;
+ }
+
+ return NULL;
+}
+
/* User-type dependent functions, for root/NickServ: */
static gboolean root_privmsg( irc_user_t *iu, const char *msg )
{