Changes in / [9c8ae50:cc9079e]


Ignore:
Files:
11 added
22 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r9c8ae50 rcc9079e  
    1111*.aps
    1212*.clw
    13 user-guide.txt
    14 user-guide.html
    15 help.txt
    1613debian
    17 build-arch-stamp
    1814tags
  • bitlbee.c

    r9c8ae50 rcc9079e  
    539539                }
    540540       
    541         irc_usermsg( irc, "Unknown command: %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[0] );
     541        irc_usermsg( irc, "Unknown command: %s. Please use help commands to get a list of available commands.", cmd[0] );
    542542       
    543543        return( 1 );
  • bitlbee.conf

    r9c8ae50 rcc9079e  
    1313##    stable enough to serve lots of users from one process. Because of this
    1414##    and other reasons, the use of daemon-mode is *STRONGLY* discouraged,
    15 ##    don't even *think* of reporting bugs when you use this.
     15##    don't think about reporting bugs when you use this!
    1616##
    1717# RunMode = Inetd
  • bitlbee.h

    r9c8ae50 rcc9079e  
    8181
    8282#define ROOT_NICK "root"
    83 #define ROOT_CHAN "&bitlbee"
     83#define ROOT_CHAN "#bitlbee"
    8484#define ROOT_FN "User manager"
    8585
  • commands.c

    r9c8ae50 rcc9079e  
    326326        else
    327327        {
    328                 irc_usermsg( irc, "Unknown command: account %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[1] );
     328                irc_usermsg( irc, "Unknown command: account %s. Please use help commands to get a list of available commands.", cmd[1] );
    329329        }
    330330       
     
    727727       
    728728        for( num = 0; q; q = q->next, num ++ )
    729                 if( q->gc ) /* Not necessary yet, but it might come later */
    730                         irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->prpl->name, q->gc->username, q->question );
    731                 else
    732                         irc_usermsg( irc, "%d, BitlBee: %s", num, q->question );
     729                irc_usermsg( irc, "%d, %s", num, q->question );
    733730       
    734731        return( 0 );
  • doc/CHANGES

    r9c8ae50 rcc9079e  
    22- Removed some crashy debugging code.
    33- QUIT command now works before logging in. (Mainly an RFC-compliancy fix.)
    4 - Hopefully slightly clearer handling of buddy add requests.
    5 - set buddy_sendbuffer_delay now also supports milisecond precision.
    6 - Renamed #bitlbee to &bitlbee to avoid confusion with the channel on OFTC.
    7 - Reviewed the xinetd file and installation instructions.
    8 - HTML stripping is configurable again.
    9 - Quit messages (at least on crashes) should appear again.
    104
    115Finished ...
  • doc/FAQ

    r9c8ae50 rcc9079e  
    3838   artistic creativity.
    3939
     40Q: Why is there no mailing list/CVS/<insert your favourite development tool
     41   here>?
     42A: Short answer: we don't need it.
     43   
     44   Longer answer: and we're not completely convinced of their merits.
     45   
     46   Long answer: we currently use some shell scripts which make sure all
     47   developers' copies are in sync with Wilmer's master copy. These shell
     48   scripts also produce development "releases" and packages, as well as
     49   stick them on a http-server. Patches are sent to Wilmer who decides
     50   whether or not a patch should be applied and if it may need some
     51   additional changes. This has the consistency advantage of a one-person
     52   project while having the capacity of more people available. The system
     53   works and we are kind of attached to it.
     54   
    4055Q: When is $random_feature going to be implemented?
    4156A: Please do consult doc/TODO (preferably in a development snapshot, which
  • doc/README

    r9c8ae50 rcc9079e  
    99make install will move all the files to the right places.
    1010
    11 --- inetd installation
    12 
    1311After installation you have to set up inetd (you got that one running,
    1412right? If not, just take a look at utils/bitlbeed.c) to start BitlBee. You
     
    2018of just 'nobody') might be a good idea.
    2119
    22 *BSD/Darwin/OSX NOTE: Most *BSD inetds are more scrict than the one that
    23 comes with Linux systems. Possibly all non-Linux inetds are like this. They
    24 don't allow you to specify a port number in the inetd.conf entry, instead
    25 you have to put a service name there (one that is also mentioned in
    26 /etc/services). So if there's no line in /services for 6667/tcp (or whatever
    27 you choose), add it and use that name in the inetd.conf entry.
    28 
    29 -- xinetd installation
    30 
    31 Most machines use xinetd instead of inetd these days. If your machine runs
    32 xinetd, you can copy the bitlbee.xinetd file from the doc/ directory to your
    33 xinetd.d/ directory. Most likely you'll have to change a thing or two before
    34 it'll work.
    35 
    36 After configuring your (x)inetd, send the daemon a SIGHUP and things should
    37 work. If not, see your syslogs, since both daemons will complain there when
    38 something's wrong.
    39 
    4020Also, don't forget to create the configuration directory (/var/lib/bitlbee/
    4121by default) and chown it to the UID BitlBee is running as. Make sure this
    4222directory is read-/writable by this user only.
     23
     24(For xinetd users a xinetd configuration file is included: doc/bitlbee.xinetd)
    4325
    4426
     
    6648==================
    6749
     50FreeBSD NOTE: It looks like FreeBSD does allow port numbers instead of service
     51names in inetd.conf, as long as the service for this port exists in
     52/etc/services. Linux isn't this strict. If you got problems in FreeBSD, just
     53add a line for your chosen port number to /etc/services.
     54
     55Darwin/Mac OS X is even more strict; you should add a bitlbee service to
     56/etc/services and use that name in inetd.conf. Not really a problem, since
     57that's the cleanest way of doing this on any operating system anyway.
     58
    6859Cygwin NOTE: You'll need a glib installation to run BitlBee. However, Cygwin
    6960doesn't provide a glib package. You can download a binary tar.gz from:
     
    7566Please do report them, we might be able to fix them if they're not too
    7667mysterious.
    77 
    78 Also, the configure script is known to not work very well with non-Bash
    79 shells, so if you experience problems, make sure you use bash to run the
    80 script. Same for the Makefile, it only works well with GNU make. (gmake on
    81 most BSD systems)
    82 
    83 If someone can tell us how to write Makefiles that work with both/all
    84 versions of make, we'd love to hear it, but it seems this just isn't
    85 possible.
    8668
    8769
  • doc/bitlbee.xinetd

    r9c8ae50 rcc9079e  
    22## user, port and/or binary location might be wrong.
    33
    4 ## This file assumes you have ircd somewhere in your /etc/services, if things
    5 ## don't work, check that file first.
    6 service ircd
     4service 6667
    75{
    86        socket_type     = stream
    97        protocol        = tcp
    108        wait            = no
    11        
    12         ## You most likely want to change these two
    139        user            = nobody
    1410        server          = /usr/local/sbin/bitlbee
    15        
    16         ## xinetd is fucking retarded, what's the use of this port flag if
    17         ## it HAS to be the same as in /etc/services ?
    18         # port          = 6667
     11        port            = 6667
    1912}
  • doc/user-guide/commands.xml

    r9c8ae50 rcc9079e  
    303303        </bitlbee-setting>
    304304
    305         <bitlbee-setting name="strip_html" type="boolean">
    306                 <default>True</default>
    307 
    308                 <description>
    309                         <para>
    310                                 Determines what BitlBee should do with HTML in messages. Normally this is turned on and HTML will be stripped from messages, if BitlBee thinks there is HTML.
    311                         </para>
    312                         <para>
    313                                 If BitlBee fails to detect this sometimes (most likely in AIM messages over an ICQ connection), you can set this setting to <emphasis>always</emphasis>, but this might sometimes accidentally strip non-HTML things too.
     305        <bitlbee-setting name="html" type="string">
     306                <default>nostrip</default>
     307                <possible-values>strip, nostrip</possible-values>
     308
     309                <description>
     310                        <para>
     311                                Determines what BitlBee should do with HTML in messages. If set to nostrip, HTML in messages will not be touched. If set to strip, all HTML will be stripped from messages. Unfortunately this sometimes strips too much.
    314312                        </para>
    315313                </description>
     
    464462
    465463        <bitlbee-setting name="buddy_sendbuffer_delay" type="integer">
    466                 <default>200</default>
    467 
    468                 <description>
    469 
    470                         <para>
    471                                 Tell BitlBee after how many (mili)seconds a buffered message should be sent. Values greater than 5 will be interpreted as miliseconds, 5 and lower as seconds.
     464                <description>
     465
     466                        <para>
     467                                Tell BitlBee after how many seconds a buffered message should be sent.
    472468                        </para>
    473469
  • irc.c

    r9c8ae50 rcc9079e  
    115115        set_add( irc, "auto_reconnect_delay", "300", set_eval_int );
    116116        set_add( irc, "buddy_sendbuffer", "false", set_eval_bool );
    117         set_add( irc, "buddy_sendbuffer_delay", "200", set_eval_int );
     117        set_add( irc, "buddy_sendbuffer_delay", "1", set_eval_int );
    118118        set_add( irc, "charset", "iso8859-1", set_eval_charset );
    119119        set_add( irc, "debug", "false", set_eval_bool );
     
    121121        set_add( irc, "display_namechanges", "false", set_eval_bool );
    122122        set_add( irc, "handle_unknown", "root", NULL );
     123        /* set_add( irc, "html", "nostrip", NULL ); */
    123124        set_add( irc, "lcnicks", "true", set_eval_bool );
    124125        set_add( irc, "ops", "both", set_eval_ops );
     
    126127        set_add( irc, "query_order", "lifo", NULL );
    127128        set_add( irc, "save_on_quit", "true", set_eval_bool );
    128         set_add( irc, "strip_html", "true", NULL );
    129129        set_add( irc, "to_char", ": ", set_eval_to_char );
    130130        set_add( irc, "typing_notice", "false", set_eval_bool );
     
    486486                        irc_reply( irc, 461, "%s :Need more parameters", cmd[0] );
    487487                }
    488                 else if( *cmd[1] == '#' || *cmd[1] == '&' )
     488                else if( *cmd[1] == '#' )
    489489                {
    490490                        if( cmd[2] )
     
    557557                else if( cmd[1] )
    558558                {
    559                         if( ( cmd[1][0] == '#' || cmd[1][0] == '&' ) && cmd[1][1] )
     559                        if( cmd[1][0] == '#' && cmd[1][1] )
    560560                        {
    561561                                user_t *u = user_find( irc, cmd[1] + 1 );
     
    931931}
    932932
    933 void irc_write_all( int now, char *format, ... )
     933void irc_write_all( char *format, ... )
    934934{
    935935        va_list params;
    936936        GSList *temp;   
    937        
     937
    938938        va_start( params, format );
    939        
     939
    940940        temp = irc_connection_list;
    941         while( temp != NULL )
    942         {
    943                 irc_t *irc = temp->data;
    944                
    945                 if( now )
    946                 {
    947                         g_free( irc->sendbuffer );
    948                         irc->sendbuffer = g_strdup( "\r\n" );
    949                 }
     941        while( temp!=NULL ) {
    950942                irc_vawrite( temp->data, format, params );
    951                 if( now )
    952                 {
    953                         bitlbee_io_current_client_write( irc->io_channel, G_IO_OUT, irc );
    954                 }
    955943                temp = temp->next;
    956944        }
    957        
     945
    958946        va_end( params );
    959947        return;
     
    10811069        irc_spawn( irc, u );
    10821070       
    1083         irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the \x02help\x02 command. Lots of FAQ's are answered there." );
     1071        irc_usermsg( irc, "Welcome to the BitlBee gateway!\n\nIf you've never used BitlBee before, please do read the help information using the help command. Lots of FAQ's are answered there." );
    10841072       
    10851073        irc->status = USTATUS_LOGGED_IN;
     
    13251313        user_t *u = NULL;
    13261314       
    1327         if( *nick == '#' || *nick == '&' )
     1315        if( *nick == '#' )
    13281316        {
    13291317                if( !( c = conv_findchannel( nick ) ) )
     
    14401428        if( set_getint( irc, "buddy_sendbuffer" ) && set_getint( irc, "buddy_sendbuffer_delay" ) > 0 )
    14411429        {
    1442                 int delay;
    1443                
    14441430                if( u->sendbuf_len > 0 && u->sendbuf_flags != flags)
    14451431                {
     
    14651451                strcat( u->sendbuf, "\n" );
    14661452               
    1467                 delay = set_getint( irc, "buddy_sendbuffer_delay" );
    1468                 if( delay <= 5 )
    1469                         delay *= 1000;
    1470                
    14711453                if( u->sendbuf_timer > 0 )
    14721454                        g_source_remove( u->sendbuf_timer );
    1473                 u->sendbuf_timer = g_timeout_add( delay, buddy_send_handler_delayed, u );
     1455                u->sendbuf_timer = g_timeout_add( set_getint( irc, "buddy_sendbuffer_delay" ) * 1000,
     1456                                                  buddy_send_handler_delayed, u );
    14741457               
    14751458                return( 1 );
  • irc.h

    r9c8ae50 rcc9079e  
    118118void irc_vawrite( irc_t *irc, char *format, va_list params );
    119119void irc_write( irc_t *irc, char *format, ... );
    120 void irc_write_all( int now, char *format, ... );
     120void irc_write_all( char *format, ... );
    121121void irc_reply( irc_t *irc, int code, char *format, ... );
    122122G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... );
  • log.c

    r9c8ae50 rcc9079e  
    134134static void log_irc(int level, char *message) {
    135135        if(level==LOGLVL_ERROR)
    136                 irc_write_all(1, "ERROR :Error: %s", message);
     136                irc_write_all("ERROR :Error: %s", message);
    137137        if(level==LOGLVL_WARNING)
    138                 irc_write_all(0, "ERROR :Warning: %s", message);
     138                irc_write_all("ERROR :Warning: %s", message);
    139139        if(level==LOGLVL_INFO)
    140                 irc_write_all(0, "ERROR :Informational: %s", message); 
     140                irc_write_all("ERROR :Informational: %s", message);     
    141141#ifdef DEBUG
    142142        if(level==LOGLVL_DEBUG)
    143                 irc_write_all(0, "ERROR :Debug: %s", message); 
     143                irc_write_all("ERROR :Debug: %s", message);     
    144144#endif 
    145145
  • protocols/jabber/jabber.c

    r9c8ae50 rcc9079e  
    11231123                 */
    11241124                struct jabber_add_permit *jap = g_new0(struct jabber_add_permit, 1);
    1125                 gchar *msg = g_strdup_printf(_("The user %s wants to add you to his/her buddy list."),
     1125                gchar *msg = g_strdup_printf(_("The user %s wants to add you to their buddy list."),
    11261126                                Jid);
    11271127
  • protocols/msn/msn_util.c

    r9c8ae50 rcc9079e  
    166166       
    167167        g_snprintf( buf, sizeof( buf ),
    168                     "The user %s (%s) wants to add you to his/her buddy list.",
     168                    "The user %s (%s) wants to add you to his/her buddy list. Do you want to allow this?",
    169169                    handle, realname );
    170170        do_ask_dialog( gc, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
  • protocols/nogaim.c

    r9c8ae50 rcc9079e  
    184184                        gc->prpl->set_away( gc, s, away );
    185185                        if( set_getint( gc->irc, "debug" ) )
    186                                 serv_got_crap( gc, "Setting away state to %s", s );
     186                                irc_usermsg( gc->irc, "Setting away state for %s to %s", gc->prpl->name, s );
    187187                }
    188188                else
     
    277277void set_login_progress( struct gaim_connection *gc, int step, char *msg )
    278278{
    279         serv_got_crap( gc, "Logging in: %s", msg );
     279        irc_usermsg( gc->irc, "%s(%s) - Logging in: %s", gc->prpl->name, gc->username, msg );
    280280}
    281281
     
    283283void hide_login_progress( struct gaim_connection *gc, char *msg )
    284284{
    285         serv_got_crap( gc, "Login error: %s", msg );
     285        irc_usermsg( gc->irc, "%s(%s) - Login error: %s", gc->prpl->name, gc->username, msg );
    286286}
    287287
     
    289289void hide_login_progress_error( struct gaim_connection *gc, char *msg )
    290290{
    291         serv_got_crap( gc, "Logged out: %s", msg );
     291        irc_usermsg( gc->irc, "%s(%s) - Logged out: %s", gc->prpl->name, gc->username, msg );
    292292}
    293293
     
    308308                msg = text;
    309309       
    310         if( ( g_strcasecmp( set_getstr( gc->irc, "strip_html" ), "always" ) == 0 ) ||
    311             ( ( gc->flags & OPT_CONN_HTML ) && set_getint( gc->irc, "strip_html" ) ) )
     310        /* if( g_strcasecmp( set_getstr(gc->irc, "html" ), "strip" ) == 0 ) */
     311        if( gc->flags & OPT_CONN_HTML )
    312312                strip_html( msg );
    313313       
     
    337337        u = user_find( gc->irc, gc->irc->nick );
    338338       
    339         serv_got_crap( gc, "Logged in" );
     339        irc_usermsg( gc->irc, "%s(%s) - Logged in", gc->prpl->name, gc->username );
    340340       
    341341        gc->keepalive = g_timeout_add( 60000, send_keepalive, gc );
     
    351351               
    352352                if( u == NULL )
    353                         serv_got_crap( gc, "\x02""***\x02"" BitlBee now supports ICQ server-side contact lists. "
     353                        irc_usermsg( gc->irc, "\x02""***\x02"" BitlBee now supports ICQ server-side contact lists. "
    354354                                              "See \x02""help import_buddies\x02"" for more information." );
    355355        }
     
    384384        account_t *a;
    385385       
    386         serv_got_crap( gc, "Signing off.." );
     386        irc_usermsg( gc->irc, "%s(%s) - Signing off..", gc->prpl->name, gc->username );
    387387
    388388        gaim_input_remove( gc->keepalive );
     
    416416        {
    417417                int delay = set_getint( irc, "auto_reconnect_delay" );
    418                 serv_got_crap( gc, "Reconnecting in %d seconds..", delay );
     418                irc_usermsg( gc->irc, "%s(%s) - Reconnecting in %d seconds..", gc->prpl->name, gc->username, delay);
    419419               
    420420                a->reconnect = 1;
     
    430430void do_error_dialog( struct gaim_connection *gc, char *msg, char *title )
    431431{
    432         serv_got_crap( gc, "Error: %s", msg );
     432        irc_usermsg( gc->irc, "%s(%s) - Error: %s", gc->prpl->name, gc->username, msg );
    433433}
    434434
     
    459459       
    460460        if( set_getint( irc, "debug" ) && 0 ) /* This message is too useless */
    461                 serv_got_crap( gc, "Receiving user add from handle: %s", handle );
     461                irc_usermsg( irc, "Receiving user add from protocol: %s", handle );
    462462       
    463463        if( user_findhandle( gc, handle ) )
    464464        {
    465465                if( set_getint( irc, "debug" ) )
    466                         serv_got_crap( gc, "User already exists, ignoring add request: %s", handle );
     466                        irc_usermsg( irc, "User already exists, ignoring add request: %s", handle );
    467467               
    468468                return;
     
    557557               
    558558                if( ( gc->flags & OPT_LOGGED_IN ) && set_getint( gc->irc, "display_namechanges" ) )
    559                         serv_got_crap( gc, "User `%s' changed name to `%s'", u->nick, u->realname );
     559                        irc_usermsg( gc->irc, "User `%s' changed name to `%s'", u->nick, u->realname );
    560560        }
    561561}
     
    590590                        if( set_getint( gc->irc, "debug" ) || g_strcasecmp( set_getstr( gc->irc, "handle_unknown" ), "ignore" ) != 0 )
    591591                        {
    592                                 serv_got_crap( gc, "serv_got_update() for handle %s:", handle );
    593                                 serv_got_crap( gc, "loggedin = %d, type = %d", loggedin, type );
     592                                irc_usermsg( gc->irc, "serv_got_update() for handle %s on connection %s(%s):", handle, gc->prpl->name, gc->username );
     593                                irc_usermsg( gc->irc, "loggedin = %d, type = %d", loggedin, type );
    594594                        }
    595595                       
     
    671671                {
    672672                        if( set_getint( irc, "debug" ) )
    673                                 serv_got_crap( gc, "Ignoring message from unknown handle %s", handle );
     673                                irc_usermsg( irc, "Ignoring message from unknown handle %s on connection %s(%s)", handle, gc->prpl->name, gc->username );
    674674                       
    675675                        return;
     
    693693                else
    694694                {
    695                         serv_got_crap( gc, "Message from unknown handle %s:", handle );
     695                        irc_usermsg( irc, "Message from unknown handle %s on connection %s(%s):", handle, gc->prpl->name, gc->username );
    696696                        u = user_find( irc, irc->mynick );
    697697                }
    698698        }
    699699       
    700         if( ( g_strcasecmp( set_getstr( gc->irc, "strip_html" ), "always" ) == 0 ) ||
    701             ( ( gc->flags & OPT_CONN_HTML ) && set_getint( gc->irc, "strip_html" ) ) )
     700        /* if( g_strcasecmp( set_getstr( irc, "html" ), "strip" ) == 0 ) */
     701        if( gc->flags & OPT_CONN_HTML )
    702702                strip_html( msg );
    703703
     
    753753       
    754754        if( set_getint( gc->irc, "debug" ) )
    755                 serv_got_crap( gc, "You were removed from conversation %d", (int) id );
     755                irc_usermsg( gc->irc, "You were removed from conversation %d", (int) id );
    756756       
    757757        for( c = gc->conversations; c && c->id != id; c = (l=c)->next );
     
    798798        for( c = gc->conversations; c && c->id != id; c = c->next );
    799799       
    800         if( ( g_strcasecmp( set_getstr( gc->irc, "strip_html" ), "always" ) == 0 ) ||
    801             ( ( gc->flags & OPT_CONN_HTML ) && set_getint( gc->irc, "strip_html" ) ) )
     800        /* if( g_strcasecmp( set_getstr( gc->irc, "html" ), "strip" ) == 0 ) */
     801        if( gc->flags & OPT_CONN_HTML )
    802802                strip_html( msg );
    803803       
     
    809809                irc_privmsg( gc->irc, u, "PRIVMSG", c->channel, "", msg );
    810810        else
    811                 serv_got_crap( gc, "Message from/to conversation %s@%d (unknown conv/user): %s", who, id, msg );
     811                irc_usermsg( gc->irc, "Message from/to conversation %s@%d (unknown conv/user): %s", who, id, msg );
    812812}
    813813
     
    832832       
    833833        s = g_new( char, 16 );
    834         sprintf( s, "&chat_%03d", gc->irc->c_id++ );
     834        sprintf( s, "#chat_%03d", gc->irc->c_id++ );
    835835        c->channel = g_strdup( s );
    836836        g_free( s );
    837837       
    838838        if( set_getint( gc->irc, "debug" ) )
    839                 serv_got_crap( gc, "Creating new conversation: (id=%d,handle=%s)", id, handle );
     839                irc_usermsg( gc->irc, "Creating new conversation: (id=%d,handle=%s)", id, handle );
    840840       
    841841        return( c );
     
    856856       
    857857        if( set_getint( b->gc->irc, "debug" ) )
    858                 serv_got_crap( b->gc, "User %s added to conversation %d", handle, b->id );
     858                irc_usermsg( b->gc->irc, "User %s added to conversation %d", handle, b->id );
    859859       
    860860        /* It might be yourself! */
     
    890890       
    891891        if( set_getint( b->gc->irc, "debug" ) )
    892                 serv_got_crap( b->gc, "User %s removed from conversation %d (%s)", handle, b->id, reason ? reason : "" );
     892                irc_usermsg( b->gc->irc, "User %s removed from conversation %d (%s)", handle, b->id, reason ? reason : "" );
    893893       
    894894        /* It might be yourself! */
     
    10311031                msg = buf;
    10321032
    1033         if( ( u->gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )
    1034         {
    1035                 char *html;
    1036                
    1037                 html = escape_html( msg );
    1038                 strncpy( buf, html, 8192 );
    1039                 g_free( html );
    1040                
    1041                 msg = buf;
     1033        if( u->gc->flags & OPT_CONN_HTML) {
     1034                char * html = escape_html(msg);
     1035                strncpy(buf, html, 8192);
     1036                g_free(html);
    10421037        }
    10431038       
  • protocols/oscar/im.c

    r9c8ae50 rcc9079e  
    19961996}
    19971997
    1998 /*
    1999  * Subtype 0x0014 - Send a mini typing notification (mtn) packet.
    2000  *
    2001  * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer,
    2002  * and Gaim 0.60 and newer.
    2003  *
    2004  */
    2005 int aim_im_sendmtn(aim_session_t *sess, guint16 type1, const char *sn, guint16 type2)
    2006 {
    2007         aim_conn_t *conn;
    2008         aim_frame_t *fr;
    2009         aim_snacid_t snacid;
    2010 
    2011         if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0002)))
    2012                 return -EINVAL;
    2013 
    2014         if (!sn)
    2015                 return -EINVAL;
    2016 
    2017         if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+11+strlen(sn)+2)))
    2018                 return -ENOMEM;
    2019 
    2020         snacid = aim_cachesnac(sess, 0x0004, 0x0014, 0x0000, NULL, 0);
    2021         aim_putsnac(&fr->data, 0x0004, 0x0014, 0x0000, snacid);
    2022 
    2023         /*
    2024          * 8 days of light
    2025          * Er, that is to say, 8 bytes of 0's
    2026          */
    2027         aimbs_put16(&fr->data, 0x0000);
    2028         aimbs_put16(&fr->data, 0x0000);
    2029         aimbs_put16(&fr->data, 0x0000);
    2030         aimbs_put16(&fr->data, 0x0000);
    2031 
    2032         /*
    2033          * Type 1 (should be 0x0001 for mtn)
    2034          */
    2035         aimbs_put16(&fr->data, type1);
    2036 
    2037         /*
    2038          * Dest sn
    2039          */
    2040         aimbs_put8(&fr->data, strlen(sn));
    2041         aimbs_putraw(&fr->data, sn, strlen(sn));
    2042 
    2043         /*
    2044          * Type 2 (should be 0x0000, 0x0001, or 0x0002 for mtn)
    2045          */
    2046         aimbs_put16(&fr->data, type2);
    2047 
    2048         aim_tx_enqueue(sess, fr);
    2049 
    2050         return 0;
    2051 }
    2052 
    2053 /*
    2054  * Subtype 0x0014 - Receive a mini typing notification (mtn) packet.
    2055  *
    2056  * This is supported by winaim5 and newer, MacAIM bleh and newer, iChat bleh and newer,
    2057  * and Gaim 0.60 and newer.
    2058  *
    2059  */
    2060 static int mtn_receive(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    2061 {
    2062         int ret = 0;
    2063         aim_rxcallback_t userfunc;
    2064         char *sn;
    2065         guint8 snlen;
    2066         guint16 type1, type2;
    2067 
    2068         aim_bstream_advance(bs, 8); /* Unknown - All 0's */
    2069         type1 = aimbs_get16(bs);
    2070         snlen = aimbs_get8(bs);
    2071         sn = aimbs_getstr(bs, snlen);
    2072         type2 = aimbs_get16(bs);
    2073 
    2074         if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
    2075                 ret = userfunc(sess, rx, type1, sn, type2);
    2076 
    2077         g_free(sn);
    2078 
    2079         return ret;
    2080 }
    2081 
    20821998static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
    20831999{
     
    20952011        else if (snac->subtype == 0x000c)
    20962012                return msgack(sess, mod, rx, snac, bs);
    2097         else if (snac->subtype == 0x0014)
    2098                 return mtn_receive(sess, mod, rx, snac, bs);
    20992013
    21002014        return 0;
  • protocols/oscar/im.h

    r9c8ae50 rcc9079e  
    1414#define AIM_CB_MSG_CLIENTAUTORESP 0x000b
    1515#define AIM_CB_MSG_ACK 0x000c
    16 #define AIM_CB_MSG_MTN 0x0014
    1716#define AIM_CB_MSG_DEFAULT 0xffff
    1817
     
    195194
    196195int aim_send_im_ch2_geticqmessage(aim_session_t *sess, const char *sn, int type);
    197 int aim_im_sendmtn(aim_session_t *sess, guint16 type1, const char *sn, guint16 type2);
    198196int aim_send_im_ch2_statusmessage(aim_session_t *sess, const char *sender, const guint8 *cookie, const char *message, const guint8 state, const guint16 dc);
    199197
  • protocols/oscar/oscar.c

    r9c8ae50 rcc9079e  
    221221static int gaim_ssi_parselist    (aim_session_t *, aim_frame_t *, ...);
    222222static int gaim_ssi_parseack     (aim_session_t *, aim_frame_t *, ...);
    223 static int gaim_parsemtn         (aim_session_t *, aim_frame_t *, ...);
     223
    224224static int gaim_icqinfo          (aim_session_t *, aim_frame_t *, ...);
    225225static int gaim_parseaiminfo     (aim_session_t *, aim_frame_t *, ...);
     
    556556        aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_SRVACK, gaim_ssi_parseack, 0);
    557557        aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parseaiminfo, 0);
    558         aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MTN, gaim_parsemtn, 0);
    559558
    560559        ((struct oscar_data *)gc->proto_data)->conn = bosconn;
     
    16771676
    16781677        /* Maybe senderwarn and recverwarn should be user preferences... */
    1679         params->flags = 0x0000000b;
    16801678        params->maxmsglen = 8000;
    16811679        params->minmsginterval = 0;
     
    24352433}
    24362434
    2437 int gaim_parsemtn(aim_session_t *sess, aim_frame_t *fr, ...)
    2438 {
    2439         struct gaim_connection * gc = sess->aux_data;
    2440         va_list ap;
    2441         guint16 type1, type2;
    2442         char * sn;
    2443 
    2444         va_start(ap, fr);
    2445         type1 = va_arg(ap, int);
    2446         sn = va_arg(ap, char*);
    2447         type2 = va_arg(ap, int);
    2448         va_end(ap);
    2449 
    2450         if(type2 == 0x0001 || type2 == 0x0002)
    2451                 serv_got_typing(gc, sn, 0);
    2452 
    2453         return 1;
    2454 }
    2455 
    24562435static char *oscar_get_status_string( struct gaim_connection *gc, int number )
    24572436{
     
    24802459                return( "Away" );
    24812460        }
    2482 }
    2483 
    2484 int oscar_send_typing(struct gaim_connection *gc, char * who, int typing)
    2485 {
    2486         struct oscar_data *od = gc->proto_data;
    2487         return( aim_im_sendmtn(od->sess, 1, who, typing ? 0x0002 : 0x0000) );
    24882461}
    24892462
     
    25092482        ret->cmp_buddynames = aim_sncmp;
    25102483        ret->get_status_string = oscar_get_status_string;
    2511         ret->send_typing = oscar_send_typing;
    25122484
    25132485        register_protocol(ret);
  • protocols/util.c

    r9c8ae50 rcc9079e  
    377377        if( html == NULL )
    378378                return( NULL );
     379        if( g_strncasecmp( html, "<html>", 6 ) == 0 )
     380                return( g_strdup( html ) );
    379381       
    380382        ret = g_string_new( "" );
  • protocols/yahoo/yahoo.c

    r9c8ae50 rcc9079e  
    845845        if( c )
    846846                add_chat_buddy( c, who );
     847        else if( set_getint( gc->irc, "debug" ) )
     848                serv_got_crap( gc, "Got ext_yahoo_conf_userjoin() from %s for unknown conference %s", who, room );
    847849}
    848850
     
    856858        if( c )
    857859                remove_chat_buddy( c, who, "" );
     860        else if( set_getint( gc->irc, "debug" ) )
     861                serv_got_crap( gc, "Got ext_yahoo_conf_userleave() from %s for unknown conference %s", who, room );
    858862}
    859863
  • query.c

    r9c8ae50 rcc9079e  
    127127                disp = 1;
    128128        }
    129         //Using irc_usermsg instead of serv_got_crap because \x02A is a char too, so a SPACE is needed.
     129       
    130130        if( ans )
    131131        {
    132132                q->yes( NULL, q->data );
    133                 serv_got_crap( q->gc, "Accepted: %s", q->question );
     133                irc_usermsg( irc, "Accepted: %s", q->question );
    134134        }
    135135        else
    136136        {
    137137                q->no( NULL, q->data );
    138                 serv_got_crap( q->gc, "Rejected: %s", q->question );
     138                irc_usermsg( irc, "Rejected: %s", q->question );
    139139        }
    140140        q->data = NULL;
     
    149149{
    150150        if( q->gc )
    151         {
    152                 serv_got_crap( q->gc, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
    153         }
     151                irc_usermsg( irc, "Question on %s connection (handle %s):", q->gc->prpl->name, q->gc->username );
    154152        else
    155         {
    156                 irc_usermsg( irc, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
    157         }
     153                irc_usermsg( irc, "Question:" );
     154       
     155        irc_usermsg( irc, "%s\nYou can use the yes/no commands to answer this question.", q->question );
    158156}
    159157
Note: See TracChangeset for help on using the changeset viewer.