aboutsummaryrefslogtreecommitdiffstats
path: root/irc_send.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-03 00:44:33 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-03 00:44:33 +0100
commite54112f152c375df81a21181f755ced5f57165bc (patch)
treeeebdf4bd47b9e7fe81bb5ac109ac0d4928b3240d /irc_send.c
parentbce78c8e6b9363175943a1b10df76fdbd87ba0c8 (diff)
Put a channel userlist in irc_channel_user elements so we can save flags
(i.e. modes).
Diffstat (limited to 'irc_send.c')
-rw-r--r--irc_send.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/irc_send.c b/irc_send.c
index 0d9aba48..a1df68b2 100644
--- a/irc_send.c
+++ b/irc_send.c
@@ -162,7 +162,8 @@ void irc_send_names( irc_channel_t *ic )
channel is invalid, just give an empty reply. */
for( l = ic->users; l; l = l->next )
{
- irc_user_t *iu = l->data;
+ irc_channel_user_t *icu = l->data;
+ irc_user_t *iu = icu->iu;
if( strlen( namelist ) + strlen( iu->nick ) > sizeof( namelist ) - 4 )
{
@@ -242,9 +243,13 @@ void irc_send_whois( irc_user_t *iu )
void irc_send_who( irc_t *irc, GSList *l, const char *channel )
{
+ gboolean is_channel = strcmp( channel, "**" ) != 0;
+
while( l )
{
irc_user_t *iu = l->data;
+ if( is_channel )
+ iu = ((irc_channel_user_t*)iu)->iu;
/* TODO(wilmer): Restore away/channel information here */
irc_send_num( irc, 352, "%s %s %s %s %s %c :0 %s",
channel ? : "*", iu->user, iu->host, irc->root->host,