Changeset 823de9d for protocols


Ignore:
Timestamp:
2009-03-12T19:10:06Z (16 years ago)
Author:
Sven Moritz Hallberg <pesco@…>
Branches:
master
Children:
673a54c
Parents:
9b55485
Message:

commit updates by ashish shukla <wahjava@…>

Location:
protocols
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r9b55485 r823de9d  
    7070       
    7171        s = set_add( &acc->set, "server", NULL, set_eval_account, acc );
    72         s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY;
     72        s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
    7373       
    7474        s = set_add( &acc->set, "ssl", "false", set_eval_bool, acc );
  • protocols/jabber/jabber_util.c

    r9b55485 r823de9d  
    3737                /* Priority is a signed 8-bit integer, according to RFC 3921. */
    3838                if( i < -128 || i > 127 )
    39                         return NULL;
     39                        return SET_INVALID;
    4040        }
    4141        else
    42                 return NULL;
     42                return SET_INVALID;
    4343       
    4444        /* Only run this stuff if the account is online ATM,
  • protocols/msn/msn.c

    r9b55485 r823de9d  
    113113{
    114114        struct msn_switchboard *sb;
    115         struct msn_data *md = ic->proto_data;
    116115       
    117116        if( ( sb = msn_sb_by_handle( ic, who ) ) )
     
    122121        {
    123122                struct msn_message *m;
    124                 char buf[1024];
    125123               
    126124                /* Create a message. We have to arrange a usable switchboard, and send the message later. */
     
    129127                m->text = g_strdup( message );
    130128               
    131                 /* FIXME: *CHECK* the reliability of using spare sb's! */
    132                 if( ( sb = msn_sb_spare( ic ) ) )
    133                 {
    134                         debug( "Trying to use a spare switchboard to message %s", who );
    135                        
    136                         sb->who = g_strdup( who );
    137                         g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who );
    138                         if( msn_sb_write( sb, buf, strlen( buf ) ) )
    139                         {
    140                                 /* He/She should join the switchboard soon, let's queue the message. */
    141                                 sb->msgq = g_slist_append( sb->msgq, m );
    142                                 return( 1 );
    143                         }
    144                 }
    145                
    146                 debug( "Creating a new switchboard to message %s", who );
    147                
    148                 /* If we reach this line, there was no spare switchboard, so let's make one. */
    149                 g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId );
    150                 if( !msn_write( ic, buf, strlen( buf ) ) )
    151                 {
    152                         g_free( m->who );
    153                         g_free( m->text );
    154                         g_free( m );
    155                        
    156                         return( 0 );
    157                 }
    158                
    159                 /* And queue the message to md. We'll pick it up when the switchboard comes up. */
    160                 md->msgq = g_slist_append( md->msgq, m );
    161                
    162                 /* FIXME: If the switchboard creation fails, the message will not be sent. */
    163                
    164                 return( 1 );
     129                return msn_sb_write_msg( ic, m );
    165130        }
    166131       
     
    252217{
    253218        struct msn_switchboard *sb;
    254         struct msn_data *md = ic->proto_data;
    255         char buf[1024];
    256219       
    257220        if( ( sb = msn_sb_by_handle( ic, who ) ) )
     
    263226        {
    264227                struct msn_message *m;
    265                
    266                 if( ( sb = msn_sb_spare( ic ) ) )
    267                 {
    268                         debug( "Trying to reuse an existing switchboard as a groupchat with %s", who );
    269                         g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who );
    270                         if( msn_sb_write( sb, buf, strlen( buf ) ) )
    271                                 return msn_sb_to_chat( sb );
    272                 }
    273                
    274                 /* If the stuff above failed for some reason: */
    275                 debug( "Creating a new switchboard to groupchat with %s", who );
    276                
    277                 /* Request a new switchboard. */
    278                 g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId );
    279                 if( !msn_write( ic, buf, strlen( buf ) ) )
    280                         return( 0 );
    281228               
    282229                /* Create a magic message. This is quite hackish, but who cares? :-P */
     
    285232                m->text = g_strdup( GROUPCHAT_SWITCHBOARD_MESSAGE );
    286233               
    287                 /* Queue the magic message and cross your fingers. */
    288                 md->msgq = g_slist_append( md->msgq, m );
    289                
    290                 /* FIXME: Can I try to return something here already? */
     234                msn_sb_write_msg( ic, m );
     235
    291236                return NULL;
    292237        }
  • protocols/msn/msn.h

    r9b55485 r823de9d  
    2323  Suite 330, Boston, MA  02111-1307  USA
    2424*/
     25
     26#ifndef _MSN_H
     27#define _MSN_H
    2528
    2629/* Some hackish magicstrings to make special-purpose messages/switchboards.
     
    176179void msn_sb_destroy( struct msn_switchboard *sb );
    177180gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond );
     181int msn_sb_write_msg( struct im_connection *ic, struct msn_message *m );
     182
     183#endif //_MSN_H
  • protocols/msn/ns.c

    r9b55485 r823de9d  
    278278                if( num_parts == 5 )
    279279                {
    280                         int i, groupcount;
    281                        
    282                         groupcount = atoi( cmd[4] );
    283                         if( groupcount > 0 )
    284                         {
    285                                 /* valgrind says this is leaking memory, I'm guessing
    286                                    that this happens during server redirects. */
    287                                 if( md->grouplist )
    288                                 {
    289                                         for( i = 0; i < md->groupcount; i ++ )
    290                                                 g_free( md->grouplist[i] );
    291                                         g_free( md->grouplist );
    292                                 }
    293                                
    294                                 md->groupcount = groupcount;
     280                        md->buddycount = atoi( cmd[3] );
     281                        md->groupcount = atoi( cmd[4] );
     282                        if( md->groupcount > 0 )
    295283                                md->grouplist = g_new0( char *, md->groupcount );
    296                         }
    297                        
    298                         md->buddycount = atoi( cmd[3] );
     284                       
    299285                        if( !*cmd[3] || md->buddycount == 0 )
    300286                                msn_logged_in( ic );
     
    679665                                        imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
    680666                                }
    681                                
    682                                 g_free( inbox );
    683                                 g_free( folders );
    684667                        }
    685668                        else if( g_strncasecmp( ct, "text/x-msmsgsemailnotification", 30 ) == 0 )
  • protocols/msn/sb.c

    r9b55485 r823de9d  
    4444                return( 0 );
    4545        }
     46       
     47        return( 1 );
     48}
     49
     50int msn_sb_write_msg( struct im_connection *ic, struct msn_message *m )
     51{
     52        struct msn_data *md = ic->proto_data;
     53        struct msn_switchboard *sb;
     54        char buf[1024];
     55
     56        /* FIXME: *CHECK* the reliability of using spare sb's! */
     57        if( ( sb = msn_sb_spare( ic ) ) )
     58        {
     59                debug( "Trying to use a spare switchboard to message %s", m->who );
     60               
     61                sb->who = g_strdup( m->who );
     62                g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, m->who );
     63                if( msn_sb_write( sb, buf, strlen( buf ) ) )
     64                {
     65                        /* He/She should join the switchboard soon, let's queue the message. */
     66                        sb->msgq = g_slist_append( sb->msgq, m );
     67                        return( 1 );
     68                }
     69        }
     70       
     71        debug( "Creating a new switchboard to message %s", m->who );
     72       
     73        /* If we reach this line, there was no spare switchboard, so let's make one. */
     74        g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId );
     75        if( !msn_write( ic, buf, strlen( buf ) ) )
     76        {
     77                g_free( m->who );
     78                g_free( m->text );
     79                g_free( m );
     80               
     81                return( 0 );
     82        }
     83       
     84        /* And queue the message to md. We'll pick it up when the switchboard comes up. */
     85        md->msgq = g_slist_append( md->msgq, m );
     86       
     87        /* FIXME: If the switchboard creation fails, the message will not be sent. */
    4688       
    4789        return( 1 );
  • protocols/nogaim.c

    r9b55485 r823de9d  
    267267           protocols. */
    268268        imc_set_away( ic, u->away );
     269       
     270        /* Apparently we're connected successfully, so reset the
     271           exponential backoff timer. */
     272        ic->acc->auto_reconnect_delay = 0;
    269273}
    270274
     
    290294        user_t *t, *u;
    291295        account_t *a;
     296        int delay;
    292297       
    293298        /* Nested calls might happen sometimes, this is probably the best
     
    329334        }
    330335        else if( allow_reconnect && set_getbool( &irc->set, "auto_reconnect" ) &&
    331                  set_getbool( &a->set, "auto_reconnect" ) )
    332         {
    333                 int delay = set_getint( &irc->set, "auto_reconnect_delay" );
    334                
     336                 set_getbool( &a->set, "auto_reconnect" ) &&
     337                 ( delay = account_reconnect_delay( a ) ) > 0 )
     338        {
    335339                imcb_log( ic, "Reconnecting in %d seconds..", delay );
    336340                a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a );
  • protocols/yahoo/libyahoo2.c

    r9b55485 r823de9d  
    6969#ifdef __MINGW32__
    7070# include <winsock2.h>
     71# define write(a,b,c) send(a,b,c,0)
     72# define read(a,b,c)  recv(a,b,c,0)
    7173#endif
    7274
  • protocols/yahoo/yahoo.c

    r9b55485 r823de9d  
    666666       
    667667        imcb_error( ic, "%s", err );
    668        
    669         if( fatal )
    670                 imc_logout( ic, TRUE );
    671668}
    672669
  • protocols/yahoo/yahoo_httplib.c

    r9b55485 r823de9d  
    5151#ifdef __MINGW32__
    5252# include <winsock2.h>
     53# define write(a,b,c) send(a,b,c,0)
     54# define read(a,b,c)  recv(a,b,c,0)
    5355# define snprintf _snprintf
    5456#endif
Note: See TracChangeset for help on using the changeset viewer.