diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-06-03 22:20:43 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2006-06-03 22:20:43 +0200 |
commit | 9779c186bd6d396a6fde61cc215f2438d453ee97 (patch) | |
tree | f213d656883f0c9f602b9d78bfe3ee9143744bdf /irc_commands.c | |
parent | a15c097fa32028394264cf66ef4fd31f56315eb3 (diff) | |
parent | fb62f81f947c74e274b05e32d2e88e3a4d7e2613 (diff) |
[merge] Wilmer
Diffstat (limited to 'irc_commands.c')
-rw-r--r-- | irc_commands.c | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/irc_commands.c b/irc_commands.c index 01b01dfb..dc59f7ee 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -176,7 +176,7 @@ static void irc_cmd_join( irc_t *irc, char **cmd ) if( !u->gc->prpl->chat_open( u->gc, u->handle ) ) { - irc_usermsg( irc, "Could not open a groupchat with %s, maybe you don't have a connection to him/her yet?", u->nick ); + irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick ); } } else if( u ) @@ -320,7 +320,7 @@ static void irc_cmd_userhost( irc_t *irc, char **cmd ) static void irc_cmd_ison( irc_t *irc, char **cmd ) { user_t *u; - char buff[IRC_MAX_LINE]; + char buff[IRC_MAX_LINE], *s; int lenleft, i; buff[0] = '\0'; @@ -330,28 +330,41 @@ static void irc_cmd_ison( irc_t *irc, char **cmd ) for( i = 1; cmd[i]; i ++ ) { - if( ( u = user_find( irc, cmd[i] ) ) && u->online ) + char *this, *next; + + this = cmd[i]; + while( *this ) { - /* [SH] Make sure we don't use too much buffer space. */ - lenleft -= strlen( u->nick ) + 1; + if( ( next = strchr( this, ' ' ) ) ) + *next = 0; - if( lenleft < 0 ) + if( ( u = user_find( irc, this ) ) && u->online ) { - break; + lenleft -= strlen( u->nick ) + 1; + + if( lenleft < 0 ) + break; + + strcat( buff, u->nick ); + strcat( buff, " " ); } - /* [SH] Add the nick to the buffer. Note - * that an extra space is always added. Even - * if it's the last nick in the list. Who - * cares? - */ - - strcat( buff, u->nick ); - strcat( buff, " " ); + if( next ) + { + *next = ' '; + this = next + 1; + } + else + { + break; + } } + + /* *sigh* */ + if( lenleft < 0 ) + break; } - /* [WvG] Well, maybe someone cares, so why not remove it? */ if( strlen( buff ) > 0 ) buff[strlen(buff)-1] = '\0'; @@ -384,9 +397,9 @@ static void irc_cmd_watch( irc_t *irc, char **cmd ) g_hash_table_insert( irc->watches, nick, nick ); if( u && u->online ) - irc_reply( irc, 604, "%s %s %s %d :%s", u->nick, u->user, u->host, time( NULL ), "is online" ); + irc_reply( irc, 604, "%s %s %s %d :%s", u->nick, u->user, u->host, (int) time( NULL ), "is online" ); else - irc_reply( irc, 605, "%s %s %s %d :%s", nick, "*", "*", time( NULL ), "is offline" ); + irc_reply( irc, 605, "%s %s %s %d :%s", nick, "*", "*", (int) time( NULL ), "is offline" ); } else if( cmd[i][0] == '-' ) { @@ -447,7 +460,7 @@ static void irc_cmd_away( irc_t *irc, char **cmd ) struct gaim_connection *gc = a->gc; if( gc && gc->flags & OPT_LOGGED_IN ) - proto_away( gc, u->away ); + bim_set_away( gc, u->away ); } } |