Ignore:
Timestamp:
2010-04-07T00:27:51Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1014cab
Parents:
0519b0a
Message:

A little more cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    r0519b0a rd569019  
    3737#define TXL_ID 3
    3838
    39 static void twitter_imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at );
    40 
    4139struct twitter_xml_list {
    4240        int type;
     
    10199{
    102100        // Check if the buddy is allready in the buddy list.
    103         if (!user_findhandle( ic, name ))
     101        if (!imcb_find_buddy( ic, name ))
    104102        {
    105103                // The buddy is not in the list, add the buddy and set the status to logged in.
     
    409407                status = l->data;
    410408                twitter_add_buddy(ic, status->user->screen_name);
     409               
    411410                // Say it!
    412                 twitter_imcb_chat_msg (gc, status->user->screen_name, status->text, 0, 0 );
     411                if (g_strcasecmp(td->user, status->user->screen_name) == 0)
     412                        imcb_chat_log (gc, "Your Tweet: %s", status->text);
     413                else
     414                        imcb_chat_msg (gc, status->user->screen_name, status->text, 0, 0 );
     415               
    413416                // Update the home_timeline_id to hold the highest id, so that by the next request
    414417                // we won't pick up the updates allready in the list.
     
    597600//      g_free(args[3]);
    598601}
    599 
    600 
    601 /**
    602  * This function "overwrites" the imcb_chat_msg function. Because in the original the logged in user is filtered out.
    603  */
    604 static void twitter_imcb_chat_msg( struct groupchat *c, char *who, char *msg, uint32_t flags, time_t sent_at )
    605 {
    606         struct im_connection *ic = c->ic;
    607         char *wrapped;
    608         user_t *u;
    609 
    610         u = user_findhandle( ic, who );
    611         if( ( g_strcasecmp( set_getstr( &ic->irc->set, "strip_html" ), "always" ) == 0 )
    612                         || ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->set, "strip_html" ) ) )
    613                 strip_html( msg );
    614 
    615         wrapped = word_wrap( msg, 425 );
    616         if( c && u )
    617         {   
    618                 irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", wrapped );
    619         }
    620         else
    621         {   
    622                 imcb_log( ic, "Message from/to conversation %s@%p (unknown conv/user): %s", who, c, wrapped );
    623         }
    624         g_free( wrapped );
    625 }
    626 
Note: See TracChangeset for help on using the changeset viewer.