Changeset 61ae52c for protocols


Ignore:
Timestamp:
2007-04-20T05:19:06Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b0eaa5b
Parents:
d323394c
Message:

Renamed/slightly changed syntax of groupchat callback functions.

Location:
protocols
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    rd323394c r61ae52c  
    184184        /* Create the groupchat structure. */
    185185        g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
    186         sb->chat = serv_got_joined_chat( ic, buf );
     186        sb->chat = imcb_chat_new( ic, buf );
    187187       
    188188        /* Populate the channel. */
    189         if( sb->who ) add_chat_buddy( sb->chat, sb->who );
    190         add_chat_buddy( sb->chat, ic->acc->user );
     189        if( sb->who ) imcb_chat_add_buddy( sb->chat, sb->who );
     190        imcb_chat_add_buddy( sb->chat, ic->acc->user );
    191191       
    192192        /* And make sure the switchboard doesn't look like a regular chat anymore. */
     
    232232        if( sb->chat )
    233233        {
    234                 serv_got_chat_left( sb->chat );
     234                imcb_chat_removed( sb->chat );
    235235        }
    236236       
     
    374374                        {
    375375                                g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
    376                                 sb->chat = serv_got_joined_chat( ic, buf );
     376                                sb->chat = imcb_chat_new( ic, buf );
    377377                               
    378378                                g_free( sb->who );
     
    380380                        }
    381381                       
    382                         add_chat_buddy( sb->chat, cmd[4] );
     382                        imcb_chat_add_buddy( sb->chat, cmd[4] );
    383383                       
    384384                        if( num == tot )
    385385                        {
    386                                 add_chat_buddy( sb->chat, ic->acc->user );
     386                                imcb_chat_add_buddy( sb->chat, ic->acc->user );
    387387                        }
    388388                }
     
    462462                        msn_sb_to_chat( sb );
    463463                       
    464                         add_chat_buddy( sb->chat, cmd[1] );
     464                        imcb_chat_add_buddy( sb->chat, cmd[1] );
    465465                }
    466466                else if( sb->chat )
    467467                {
    468                         add_chat_buddy( sb->chat, cmd[1] );
     468                        imcb_chat_add_buddy( sb->chat, cmd[1] );
    469469                        sb->ready = 1;
    470470                }
     
    516516                else if( sb->chat )
    517517                {
    518                         remove_chat_buddy( sb->chat, cmd[1], "" );
     518                        imcb_chat_remove_buddy( sb->chat, cmd[1], "" );
    519519                }
    520520                else
     
    611611                        else if( sb->chat )
    612612                        {
    613                                 serv_got_chat_in( sb->chat, cmd[1], 0, body, 0 );
     613                                imcb_chat_msg( sb->chat, cmd[1], body, 0, 0 );
    614614                        }
    615615                        else
     
    670670                        else if( sb->chat )
    671671                        {
    672                                 serv_got_chat_in( sb->chat, cmd[1], 0, buf, 0 );
     672                                imcb_chat_msg( sb->chat, cmd[1], buf, 0, 0 );
    673673                        }
    674674                        else
  • protocols/nogaim.c

    rd323394c r61ae52c  
    686686}
    687687
    688 void serv_got_chat_left( struct groupchat *c )
     688void imcb_chat_removed( struct groupchat *c )
    689689{
    690690        struct im_connection *ic = c->ic;
     
    723723}
    724724
    725 void serv_got_chat_in( struct groupchat *c, char *who, int whisper, char *msg, time_t mtime )
     725void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at )
    726726{
    727727        struct im_connection *ic = c->ic;
     
    744744}
    745745
    746 struct groupchat *serv_got_joined_chat( struct im_connection *ic, char *handle )
     746struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle )
    747747{
    748748        struct groupchat *c;
     
    771771/* buddy_chat.c */
    772772
    773 void add_chat_buddy( struct groupchat *b, char *handle )
     773void imcb_chat_add_buddy( struct groupchat *b, char *handle )
    774774{
    775775        user_t *u = user_findhandle( b->ic, handle );
     
    805805}
    806806
    807 void remove_chat_buddy( struct groupchat *b, char *handle, char *reason )
     807void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason )
    808808{
    809809        user_t *u;
  • protocols/nogaim.h

    rd323394c r61ae52c  
    9494};
    9595
    96 /* struct buddy_chat went away and got merged with this. */
    9796struct groupchat {
    9897        struct im_connection *ic;
     
    191190G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname );
    192191
    193 /* Groupchats */
    194 G_MODULE_EXPORT void add_chat_buddy( struct groupchat *b, char *handle );
    195 G_MODULE_EXPORT void remove_chat_buddy( struct groupchat *b, char *handle, char *reason );
    196 G_MODULE_EXPORT void serv_got_chat_invite( struct im_connection *ic, char *handle, char *who, char *msg, GList *data );
    197 G_MODULE_EXPORT struct groupchat *serv_got_joined_chat( struct im_connection *ic, char *handle );
    198 G_MODULE_EXPORT void serv_got_chat_in( struct groupchat *c, char *who, int whisper, char *msg, time_t mtime );
    199 G_MODULE_EXPORT void serv_got_chat_left( struct groupchat *c );
    200 struct groupchat *chat_by_channel( char *channel );
    201 
    202192/* Buddy management */
    203193G_MODULE_EXPORT void imcb_add_buddy( struct im_connection *ic, char *handle, char *group );
     
    212202G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags );
    213203
     204/* Groupchats */
     205G_MODULE_EXPORT void imcb_chat_invited( struct im_connection *ic, char *handle, char *who, char *msg, GList *data );
     206G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle );
     207G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle );
     208G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason );
     209G_MODULE_EXPORT void imcb_chat_msg( struct groupchat *c, char *who, char *msg, u_int32_t flags, time_t sent_at );
     210G_MODULE_EXPORT void imcb_chat_removed( struct groupchat *c );
     211struct groupchat *chat_by_channel( char *channel );
     212
    214213/* Actions, or whatever. */
    215214int imc_set_away( struct im_connection *ic, char *away );
  • protocols/oscar/oscar.c

    rd323394c r61ae52c  
    750750        chatcon = find_oscar_chat_by_conn(ic, fr->conn);
    751751        chatcon->id = id;
    752         chatcon->cnv = serv_got_joined_chat(ic, chatcon->show);
     752        chatcon->cnv = imcb_chat_new(ic, chatcon->show);
    753753        chatcon->cnv->data = chatcon;
    754754
     
    14611461
    14621462        for (i = 0; i < count; i++)
    1463                 add_chat_buddy(c->cnv, info[i].sn);
     1463                imcb_chat_add_buddy(c->cnv, info[i].sn);
    14641464
    14651465        return 1;
     
    14841484
    14851485        for (i = 0; i < count; i++)
    1486                 remove_chat_buddy(c->cnv, info[i].sn, NULL);
     1486                imcb_chat_remove_buddy(c->cnv, info[i].sn, NULL);
    14871487
    14881488        return 1;
     
    15351535        tmp = g_malloc(BUF_LONG);
    15361536        g_snprintf(tmp, BUF_LONG, "%s", msg);
    1537         serv_got_chat_in(ccon->cnv, info->sn, 0, tmp, time((time_t)NULL));
     1537        imcb_chat_msg(ccon->cnv, info->sn, tmp, 0, 0);
    15381538        g_free(tmp);
    15391539
     
    25132513
    25142514        /* Notify the conversation window that we've left the chat */
    2515         serv_got_chat_left(cc->cnv);
     2515        imcb_chat_removed(cc->cnv);
    25162516
    25172517        /* Destroy the chat_connection */
  • protocols/yahoo/yahoo.c

    rd323394c r61ae52c  
    146146       
    147147        while( ic->conversations )
    148                 serv_got_chat_left( ic->conversations );
     148                imcb_chat_removed( ic->conversations );
    149149       
    150150        for( l = yd->buddygroups; l; l = l->next )
     
    318318       
    319319        yahoo_conference_logoff( yd->y2_id, NULL, c->data, c->title );
    320         serv_got_chat_left( c );
     320        imcb_chat_removed( c );
    321321}
    322322
     
    330330        roomname = g_strdup_printf( "%s-Bee-%d", ic->acc->user, byahoo_chat_id );
    331331       
    332         c = serv_got_joined_chat( ic, roomname );
    333         add_chat_buddy( c, ic->acc->user );
     332        c = imcb_chat_new( ic, roomname );
     333        imcb_chat_add_buddy( c, ic->acc->user );
    334334       
    335335        /* FIXME: Free this thing when the chat's destroyed. We can't *always*
     
    790790{
    791791        yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
    792         add_chat_buddy( inv->c, inv->ic->acc->user );
     792        imcb_chat_add_buddy( inv->c, inv->ic->acc->user );
    793793        g_free( inv->name );
    794794        g_free( inv );
     
    798798{
    799799        yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
    800         serv_got_chat_left( inv->c );
     800        imcb_chat_removed( inv->c );
    801801        g_free( inv->name );
    802802        g_free( inv );
     
    814814        memset( inv, 0, sizeof( struct byahoo_conf_invitation ) );
    815815        inv->name = g_strdup( room );
    816         inv->c = serv_got_joined_chat( ic, (char*) room );
     816        inv->c = imcb_chat_new( ic, (char*) room );
    817817        inv->c->data = members;
    818818        inv->yid = id;
     
    822822        for( m = members; m; m = m->next )
    823823                if( g_strcasecmp( m->data, ic->acc->user ) != 0 )
    824                         add_chat_buddy( inv->c, m->data );
     824                        imcb_chat_add_buddy( inv->c, m->data );
    825825       
    826826        g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", room, who, msg );
     
    844844       
    845845        if( c )
    846                 add_chat_buddy( c, (char*) who );
     846                imcb_chat_add_buddy( c, (char*) who );
    847847}
    848848
     
    856856       
    857857        if( c )
    858                 remove_chat_buddy( c, (char*) who, "" );
     858                imcb_chat_remove_buddy( c, (char*) who, "" );
    859859}
    860860
     
    868868       
    869869        if( c )
    870                 serv_got_chat_in( c, (char*) who, 0, (char*) m, 0 );
     870                imcb_chat_msg( c, (char*) who, (char*) m, 0, 0 );
    871871        g_free( m );
    872872}
Note: See TracChangeset for help on using the changeset viewer.