Changeset 07874be for protocols


Ignore:
Timestamp:
2010-08-14T13:44:35Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e5854a8
Parents:
5848675 (diff), 136c2bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline stuff.

Location:
protocols
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r5848675 r07874be  
    9696        struct im_connection *ic = imcb_new( acc );
    9797        struct jabber_data *jd = g_new0( struct jabber_data, 1 );
    98         struct ns_srv_reply *srv = NULL;
     98        struct ns_srv_reply **srvl = NULL, *srv = NULL;
    9999        char *connect_to, *s;
    100100        int i;
     
    196196        if( acc->server && *acc->server )
    197197                connect_to = acc->server;
    198         else if( ( srv = srv_lookup( "xmpp-client", "tcp", jd->server ) ) ||
    199                  ( srv = srv_lookup( "jabber-client", "tcp", jd->server ) ) )
     198        else if( ( srvl = srv_lookup( "xmpp-client", "tcp", jd->server ) ) ||
     199                 ( srvl = srv_lookup( "jabber-client", "tcp", jd->server ) ) )
     200        {
     201                /* Find the lowest-priority one. These usually come
     202                   back in random/shuffled order. Not looking at
     203                   weights etc for now. */
     204                srv = *srvl;
     205                for( i = 1; srvl[i]; i ++ )
     206                        if( srvl[i]->prio < srv->prio )
     207                                srv = srvl[i];
     208               
    200209                connect_to = srv->name;
     210        }
    201211        else
    202212                connect_to = jd->server;
     
    227237                jd->fd = proxy_connect( connect_to, srv ? srv->port : set_getint( &acc->set, "port" ), jabber_connected_plain, ic );
    228238        }
    229         g_free( srv );
     239        srv_free( srvl );
    230240       
    231241        if( jd->fd == -1 )
  • protocols/twitter/twitter.c

    r5848675 r07874be  
    257257       
    258258        // Set the status to logged out.
    259         ic->flags = 0;
     259        ic->flags &= ~ OPT_LOGGED_IN;
    260260
    261261        // Remove the main_loop function from the function queue.
  • protocols/twitter/twitter_lib.c

    r5848675 r07874be  
    357357}
    358358
     359#ifdef __GLIBC__
     360#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S %z %Y"
     361#else
     362#define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S +0000 %Y"
     363#endif
    359364
    360365/**
     
    393398                           this field. :-( Also assumes the timezone used
    394399                           is UTC since C time handling functions suck. */
    395                         if( strptime( child->text, "%a %b %d %H:%M:%S %z %Y", &parsed ) != NULL )
     400                        if( strptime( child->text, TWITTER_TIME_FORMAT, &parsed ) != NULL )
    396401                                txs->created_at = mktime_utc( &parsed );
    397402                }
Note: See TracChangeset for help on using the changeset viewer.