Changeset 74f1cde for irc_send.c


Ignore:
Timestamp:
2010-03-27T18:05:38Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
410bf6d
Parents:
280c56a
Message:

irc_usermsg() works a little bit again. Have to figure out how and where
to restore multiline support though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_send.c

    r280c56a r74f1cde  
    109109}
    110110
    111 /* FIXME/REPLACEME */
    112111void irc_usermsg( irc_t *irc, char *format, ... )
    113112{
     113        irc_channel_t *ic;
     114        irc_user_t *iu;
    114115        char text[1024];
    115116        va_list params;
    116         //irc_user_t *iu;
    117117       
    118118        va_start( params, format );
     
    120120        va_end( params );
    121121       
    122         fprintf( stderr, "%s\n", text );
     122        if( irc->last_root_cmd &&
     123            irc_channel_name_ok( irc->last_root_cmd ) &&
     124            ( ic = irc_channel_by_name( irc, irc->last_root_cmd ) ) &&
     125            ic->flags & IRC_CHANNEL_JOINED )
     126                irc_send_msg( irc->root, "PRIVMSG", irc->last_root_cmd, text );
     127        else if( irc->last_root_cmd &&
     128                 ( iu = irc_user_by_name( irc, irc->last_root_cmd ) ) &&
     129                 iu->f == &irc_user_root_funcs )
     130                irc_send_msg( iu, "PRIVMSG", irc->user->nick, text );
     131        else
     132        {
     133                g_free( irc->last_root_cmd );
     134                irc->last_root_cmd = NULL;
     135               
     136                irc_send_msg( irc->root, "PRIVMSG", irc->user->nick, text );
     137        }
    123138       
    124139        /*return( irc_msgfrom( irc, u->nick, text ) );*/
Note: See TracChangeset for help on using the changeset viewer.