Changeset 84b045d for protocols/nogaim.c
- Timestamp:
- 2007-04-16T01:03:08Z (17 years ago)
- Branches:
- master
- Children:
- 6bbb939
- Parents:
- c2fb3809
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
rc2fb3809 r84b045d 145 145 /* multi.c */ 146 146 147 struct im_connection *imc _new( account_t *acc )147 struct im_connection *imcb_new( account_t *acc ) 148 148 { 149 149 struct im_connection *ic; … … 204 204 } 205 205 206 void imc _log( struct im_connection *ic, char *format, ... )206 void imcb_log( struct im_connection *ic, char *format, ... ) 207 207 { 208 208 va_list params; … … 221 221 } 222 222 223 void imc _error( struct im_connection *ic, char *format, ... )223 void imcb_error( struct im_connection *ic, char *format, ... ) 224 224 { 225 225 va_list params; … … 248 248 } 249 249 250 void imc _connected( struct im_connection *ic )250 void imcb_connected( struct im_connection *ic ) 251 251 { 252 252 user_t *u; … … 260 260 u = user_find( ic->irc, ic->irc->nick ); 261 261 262 imc _log( ic, "Logged in" );262 imcb_log( ic, "Logged in" ); 263 263 264 264 ic->keepalive = b_timeout_add( 60000, send_keepalive, ic ); … … 267 267 /* Also necessary when we're not away, at least for some of the 268 268 protocols. */ 269 bim_set_away( ic, u->away );269 imc_set_away( ic, u->away ); 270 270 } 271 271 … … 300 300 ic->flags |= OPT_LOGGING_OUT; 301 301 302 imc _log( ic, "Signing off.." );302 imcb_log( ic, "Signing off.." ); 303 303 304 304 b_event_remove( ic->keepalive ); … … 334 334 int delay = set_getint( &irc->set, "auto_reconnect_delay" ); 335 335 336 imc _log( ic, "Reconnecting in %d seconds..", delay );336 imcb_log( ic, "Reconnecting in %d seconds..", delay ); 337 337 a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a ); 338 338 } … … 344 344 /* dialogs.c */ 345 345 346 void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )346 void imcb_ask( struct im_connection *ic, char *msg, void *data, void *doit, void *dont ) 347 347 { 348 348 query_add( ic->irc, ic, msg, doit, dont, data ); … … 360 360 361 361 if( set_getbool( &irc->set, "debug" ) && 0 ) /* This message is too useless */ 362 imc _log( ic, "Receiving user add from handle: %s", handle );362 imcb_log( ic, "Receiving user add from handle: %s", handle ); 363 363 364 364 if( user_findhandle( ic, handle ) ) 365 365 { 366 366 if( set_getbool( &irc->set, "debug" ) ) 367 imc _log( ic, "User already exists, ignoring add request: %s", handle );367 imcb_log( ic, "User already exists, ignoring add request: %s", handle ); 368 368 369 369 return; … … 448 448 449 449 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) ) 450 imc _log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );450 imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname ); 451 451 } 452 452 } … … 475 475 } 476 476 477 void show_got_added( struct im_connection *ic, char *handle, const char *realname )477 void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ) 478 478 { 479 479 struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); … … 512 512 if( set_getbool( &ic->irc->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 ) 513 513 { 514 imc _log( ic, "serv_got_update() for handle %s:", handle );515 imc _log( ic, "loggedin = %d, type = %d", loggedin, type );514 imcb_log( ic, "serv_got_update() for handle %s:", handle ); 515 imcb_log( ic, "loggedin = %d, type = %d", loggedin, type ); 516 516 } 517 517 … … 551 551 { 552 552 u->away = g_strdup( "Away" ); 553 }554 else if( ( type & UC_UNAVAILABLE ) && ( strcmp( ic->acc->prpl->name, "jabber" ) == 0 ) )555 {556 if( type & UC_DND )557 u->away = g_strdup( "Do Not Disturb" );558 else if( type & UC_XA )559 u->away = g_strdup( "Extended Away" );560 else // if( type & UC_AWAY )561 u->away = g_strdup( "Away" );562 553 } 563 554 else if( ( type & UC_UNAVAILABLE ) && ic->acc->prpl->get_status_string ) … … 593 584 { 594 585 if( set_getbool( &irc->set, "debug" ) ) 595 imc _log( ic, "Ignoring message from unknown handle %s", handle );586 imcb_log( ic, "Ignoring message from unknown handle %s", handle ); 596 587 597 588 return; … … 615 606 else 616 607 { 617 imc _log( ic, "Message from unknown handle %s:", handle );608 imcb_log( ic, "Message from unknown handle %s:", handle ); 618 609 u = user_find( irc, irc->mynick ); 619 610 } … … 685 676 686 677 if( set_getbool( &ic->irc->set, "debug" ) ) 687 imc _log( ic, "You were removed from conversation 0x%x", (int) c );678 imcb_log( ic, "You were removed from conversation 0x%x", (int) c ); 688 679 689 680 if( c ) … … 733 724 irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", msg ); 734 725 else 735 imc _log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );726 imcb_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg ); 736 727 } 737 728 … … 755 746 756 747 if( set_getbool( &ic->irc->set, "debug" ) ) 757 imc _log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );748 imcb_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle ); 758 749 759 750 return c; … … 769 760 770 761 if( set_getbool( &b->ic->irc->set, "debug" ) ) 771 imc _log( b->ic, "User %s added to conversation 0x%x", handle, (int) b );762 imcb_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b ); 772 763 773 764 /* It might be yourself! */ … … 803 794 804 795 if( set_getbool( &b->ic->irc->set, "debug" ) ) 805 imc _log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );796 imcb_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" ); 806 797 807 798 /* It might be yourself! */ … … 929 920 them all from some wrappers. We'll start to define some down here: */ 930 921 931 int bim_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags )922 int imc_buddy_msg( struct im_connection *ic, char *handle, char *msg, int flags ) 932 923 { 933 924 char *buf = NULL; … … 946 937 } 947 938 948 int bim_chat_msg( struct groupchat *c, char *msg, int flags )939 int imc_chat_msg( struct groupchat *c, char *msg, int flags ) 949 940 { 950 941 char *buf = NULL; … … 962 953 } 963 954 964 static char * bim_away_alias_find( GList *gcm, char *away );965 966 int bim_set_away( struct im_connection *ic, char *away )955 static char *imc_away_alias_find( GList *gcm, char *away ); 956 957 int imc_set_away( struct im_connection *ic, char *away ) 967 958 { 968 959 GList *m, *ms; … … 995 986 else 996 987 { 997 s = bim_away_alias_find( ms, away );988 s = imc_away_alias_find( ms, away ); 998 989 if( s ) 999 990 { 1000 991 ic->acc->prpl->set_away( ic, s, away ); 1001 992 if( set_getbool( &ic->irc->set, "debug" ) ) 1002 imc _log( ic, "Setting away state to %s", s );993 imcb_log( ic, "Setting away state to %s", s ); 1003 994 } 1004 995 else … … 1009 1000 } 1010 1001 1011 static char * bim_away_alias_list[8][5] =1002 static char *imc_away_alias_list[8][5] = 1012 1003 { 1013 1004 { "Away from computer", "Away", "Extended away", NULL }, … … 1021 1012 }; 1022 1013 1023 static char * bim_away_alias_find( GList *gcm, char *away )1014 static char *imc_away_alias_find( GList *gcm, char *away ) 1024 1015 { 1025 1016 GList *m; 1026 1017 int i, j; 1027 1018 1028 for( i = 0; * bim_away_alias_list[i]; i ++ )1029 { 1030 for( j = 0; bim_away_alias_list[i][j]; j ++ )1031 if( g_strncasecmp( away, bim_away_alias_list[i][j], strlen( bim_away_alias_list[i][j] ) ) == 0 )1019 for( i = 0; *imc_away_alias_list[i]; i ++ ) 1020 { 1021 for( j = 0; imc_away_alias_list[i][j]; j ++ ) 1022 if( g_strncasecmp( away, imc_away_alias_list[i][j], strlen( imc_away_alias_list[i][j] ) ) == 0 ) 1032 1023 break; 1033 1024 1034 if( ! bim_away_alias_list[i][j] ) /* If we reach the end, this row */1025 if( !imc_away_alias_list[i][j] ) /* If we reach the end, this row */ 1035 1026 continue; /* is not what we want. Next! */ 1036 1027 1037 1028 /* Now find an entry in this row which exists in gcm */ 1038 for( j = 0; bim_away_alias_list[i][j]; j ++ )1029 for( j = 0; imc_away_alias_list[i][j]; j ++ ) 1039 1030 { 1040 1031 m = gcm; 1041 1032 while( m ) 1042 1033 { 1043 if( g_strcasecmp( bim_away_alias_list[i][j], m->data ) == 0 )1044 return( bim_away_alias_list[i][j] );1034 if( g_strcasecmp( imc_away_alias_list[i][j], m->data ) == 0 ) 1035 return( imc_away_alias_list[i][j] ); 1045 1036 m = m->next; 1046 1037 } … … 1051 1042 } 1052 1043 1053 void bim_add_allow( struct im_connection *ic, char *handle )1044 void imc_add_allow( struct im_connection *ic, char *handle ) 1054 1045 { 1055 1046 if( g_slist_find_custom( ic->permit, handle, (GCompareFunc) ic->acc->prpl->handle_cmp ) == NULL ) … … 1061 1052 } 1062 1053 1063 void bim_rem_allow( struct im_connection *ic, char *handle )1054 void imc_rem_allow( struct im_connection *ic, char *handle ) 1064 1055 { 1065 1056 GSList *l; … … 1074 1065 } 1075 1066 1076 void bim_add_block( struct im_connection *ic, char *handle )1067 void imc_add_block( struct im_connection *ic, char *handle ) 1077 1068 { 1078 1069 if( g_slist_find_custom( ic->deny, handle, (GCompareFunc) ic->acc->prpl->handle_cmp ) == NULL ) … … 1084 1075 } 1085 1076 1086 void bim_rem_block( struct im_connection *ic, char *handle )1077 void imc_rem_block( struct im_connection *ic, char *handle ) 1087 1078 { 1088 1079 GSList *l;
Note: See TracChangeset
for help on using the changeset viewer.