Changeset cca0692


Ignore:
Timestamp:
2010-04-09T00:40:38Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
16592d8
Parents:
7a90d02
Message:

Added imcb_chat_nick_hint() and use it in the Twitter module to get saner
channel names.

This also closes bug #577, making the Skype module a bit nicer.

Location:
protocols
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r7a90d02 rcca0692  
    820820       
    821821        return c;
     822}
     823
     824void imcb_chat_name_hint( struct groupchat *c, const char *name )
     825{
     826        if( !c->joined )
     827        {
     828                struct im_connection *ic = c->ic;
     829                char stripped[MAX_NICK_LENGTH+1], *full_name;
     830               
     831                strncpy( stripped, name, MAX_NICK_LENGTH );
     832                stripped[MAX_NICK_LENGTH] = '\0';
     833                nick_strip( stripped );
     834                if( set_getbool( &ic->irc->set, "lcnicks" ) )
     835                        nick_lc( stripped );
     836               
     837                full_name = g_strdup_printf( "&%s", stripped );
     838               
     839                if( stripped[0] &&
     840                    nick_cmp( stripped, ic->irc->channel + 1 ) != 0 &&
     841                    irc_chat_by_channel( ic->irc, full_name ) == NULL )
     842                {
     843                        g_free( c->channel );
     844                        c->channel = full_name;
     845                }
     846                else
     847                {
     848                        g_free( full_name );
     849                }
     850        }
    822851}
    823852
  • protocols/nogaim.h

    r7a90d02 rcca0692  
    302302 *   user, too. */
    303303G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle );
     304G_MODULE_EXPORT void imcb_chat_name_hint( struct groupchat *c, const char *name );
    304305G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, const char *handle );
    305306/* To remove a handle from a group chat. Reason can be NULL. */
  • protocols/twitter/twitter_lib.c

    r7a90d02 rcca0692  
    407407        if (!td->home_timeline_gc)
    408408        {   
     409                char *name_hint = g_strdup_printf( "Twitter_%s", ic->acc->user );
    409410                td->home_timeline_gc = gc = imcb_chat_new( ic, "home/timeline" );
     411                imcb_chat_name_hint( gc, name_hint );
     412                g_free( name_hint );
    410413                // Add the current user to the chat...
    411414                imcb_chat_add_buddy( gc, ic->acc->user );
Note: See TracChangeset for help on using the changeset viewer.