Changeset fa29d093 for protocols/nogaim.c
- Timestamp:
- 2007-03-28T05:53:11Z (17 years ago)
- Branches:
- master
- Children:
- 0da65d5
- Parents:
- 723e611
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
r723e611 rfa29d093 682 682 } 683 683 684 void serv_got_chat_left( struct gaim_connection *gc, int id ) 685 { 686 struct conversation *c, *l = NULL; 684 void serv_got_chat_left( struct conversation *c ) 685 { 686 struct gaim_connection *gc = c->gc; 687 struct conversation *l = NULL; 687 688 GList *ir; 688 689 689 690 if( set_getbool( &gc->irc->set, "debug" ) ) 690 serv_got_crap( gc, "You were removed from conversation %d", (int) id ); 691 692 for( c = gc->conversations; c && c->id != id; c = (l=c)->next ); 691 serv_got_crap( gc, "You were removed from conversation 0x%x", (int) c ); 693 692 694 693 if( c ) … … 720 719 } 721 720 722 void serv_got_chat_in( struct gaim_connection *gc, int id, char *who, int whisper, char *msg, time_t mtime )723 { 724 struct conversation *c;721 void serv_got_chat_in( struct conversation *c, char *who, int whisper, char *msg, time_t mtime ) 722 { 723 struct gaim_connection *gc = c->gc; 725 724 user_t *u; 726 725 … … 730 729 731 730 u = user_findhandle( gc, who ); 732 for( c = gc->conversations; c && c->id != id; c = c->next );733 731 734 732 if( ( g_strcasecmp( set_getstr( &gc->irc->set, "strip_html" ), "always" ) == 0 ) || … … 739 737 irc_privmsg( gc->irc, u, "PRIVMSG", c->channel, "", msg ); 740 738 else 741 serv_got_crap( gc, "Message from/to conversation %s@ %d (unknown conv/user): %s", who, id, msg );742 } 743 744 struct conversation *serv_got_joined_chat( struct gaim_connection *gc, int id,char *handle )739 serv_got_crap( gc, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg ); 740 } 741 742 struct conversation *serv_got_joined_chat( struct gaim_connection *gc, char *handle ) 745 743 { 746 744 struct conversation *c; 747 char *s;748 745 749 746 /* This one just creates the conversation structure, user won't see anything yet */ … … 755 752 } 756 753 else 757 gc->conversations = c = g_new0( struct conversation, 1); 758 759 c->id = id; 754 gc->conversations = c = g_new0( struct conversation, 1 ); 755 760 756 c->gc = gc; 761 757 c->title = g_strdup( handle ); 762 763 s = g_new( char, 16 ); 764 sprintf( s, "&chat_%03d", gc->irc->c_id++ ); 765 c->channel = g_strdup( s ); 766 g_free( s ); 758 c->channel = g_strdup_printf( "&chat_%03d", gc->irc->c_id++ ); 767 759 768 760 if( set_getbool( &gc->irc->set, "debug" ) ) 769 serv_got_crap( gc, "Creating new conversation: (id= %d,handle=%s)", id, handle );770 771 return ( c );761 serv_got_crap( gc, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle ); 762 763 return c; 772 764 } 773 765 … … 781 773 782 774 if( set_getbool( &b->gc->irc->set, "debug" ) ) 783 serv_got_crap( b->gc, "User %s added to conversation %d", handle, b->id);775 serv_got_crap( b->gc, "User %s added to conversation 0x%x", handle, (int) b ); 784 776 785 777 /* It might be yourself! */ … … 815 807 816 808 if( set_getbool( &b->gc->irc->set, "debug" ) ) 817 serv_got_crap( b->gc, "User %s removed from conversation %d (%s)", handle, b->id, reason ? reason : "" );809 serv_got_crap( b->gc, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" ); 818 810 819 811 /* It might be yourself! */ … … 858 850 /* Misc. BitlBee stuff which shouldn't really be here */ 859 851 860 struct conversation *c onv_findchannel( char *channel )852 struct conversation *chat_by_channel( char *channel ) 861 853 { 862 854 struct gaim_connection *gc; … … 870 862 for( c = gc->conversations; c && g_strcasecmp( c->channel, channel ) != 0; c = c->next ); 871 863 if( c ) 872 return ( c );873 } 874 875 return ( NULL );864 return c; 865 } 866 867 return NULL; 876 868 } 877 869 … … 958 950 } 959 951 960 int bim_chat_msg( struct gaim_connection *gc, int id, char *msg )952 int bim_chat_msg( struct conversation *c, char *msg ) 961 953 { 962 954 char *buf = NULL; 963 955 int st; 964 956 965 if( ( gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) )957 if( ( c->gc->flags & OPT_CONN_HTML ) && ( g_strncasecmp( msg, "<html>", 6 ) != 0 ) ) 966 958 { 967 959 buf = escape_html( msg ); … … 969 961 } 970 962 971 st = gc->acc->prpl->chat_send( gc, id, msg );963 st = c->gc->acc->prpl->chat_send( c, msg ); 972 964 g_free( buf ); 973 965
Note: See TracChangeset
for help on using the changeset viewer.