- Timestamp:
- 2010-03-29T12:25:01Z (15 years ago)
- Branches:
- master
- Children:
- 81e04e1
- Parents:
- 38ee021
- Location:
- protocols
- Files:
-
- 1 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
r38ee021 r10a96f4 11 11 # [SH] Program variables 12 12 #objects = account.o nogaim.o user.o 13 objects = bee.o 13 objects = bee.o bee_user.o nogaim.o 14 14 15 15 -
protocols/bee.h
r38ee021 r10a96f4 1 typedef struct bee_ui 2 { 3 void *data; 4 } bee_ui_t; 1 /********************************************************************\ 2 * BitlBee -- An IRC to other IM-networks gateway * 3 * * 4 * Copyright 2002-2010 Wilmer van der Gaast and others * 5 \********************************************************************/ 6 7 /* Stuff to handle, save and search buddies */ 8 9 /* 10 This program is free software; you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 2 of the License, or 13 (at your option) any later version. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 You should have received a copy of the GNU General Public License with 21 the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL; 22 if not, write to the Free Software Foundation, Inc., 59 Temple Place, 23 Suite 330, Boston, MA 02111-1307 USA 24 */ 25 26 #ifndef __BEE_H__ 27 #define __BEE_H__ 28 29 struct bee_ui_funcs; 5 30 6 31 typedef struct bee … … 11 36 GSList *accounts; 12 37 13 //const bee_ui_funcs_t*ui;38 const struct bee_ui_funcs *ui; 14 39 void *ui_data; 15 40 } bee_t; … … 17 42 bee_t *bee_new(); 18 43 void bee_free( bee_t *b ); 44 45 typedef enum 46 { 47 BEE_USER_ONLINE = 1, 48 BEE_USER_AWAY = 2, 49 } bee_user_flags_t; 50 51 typedef struct bee_user 52 { 53 struct im_connection *ic; 54 char *handle; 55 char *fullname; 56 char *group; 57 58 char *away; 59 char *status_msg; 60 61 bee_t *bee; 62 void *ui_data; 63 } bee_user_t; 64 65 typedef struct bee_ui_funcs 66 { 67 gboolean (*user_new)( bee_t *bee, struct bee_user *bu ); 68 gboolean (*user_free)( bee_t *bee, struct bee_user *bu ); 69 } bee_ui_funcs_t; 70 71 72 /* bee.c */ 73 bee_t *bee_new(); 74 void bee_free( bee_t *b ); 75 76 /* bee_user.c */ 77 bee_user_t *bee_user_new( bee_t *bee, struct im_connection *ic, const char *handle ); 78 int bee_user_free( bee_t *bee, struct im_connection *ic, const char *handle ); 79 bee_user_t *bee_user_by_handle( bee_t *bee, struct im_connection *ic, const char *handle ); 80 81 #endif /* __BEE_H__ */ -
protocols/nogaim.c
r38ee021 r10a96f4 199 199 va_end( params ); 200 200 201 if( ( g_strcasecmp( set_getstr( &ic->irc-> set, "strip_html" ), "always" ) == 0 ) ||202 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc-> set, "strip_html" ) ) )201 if( ( g_strcasecmp( set_getstr( &ic->irc->b->set, "strip_html" ), "always" ) == 0 ) || 202 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->b->set, "strip_html" ) ) ) 203 203 strip_html( text ); 204 204 … … 265 265 irc_t *irc = ic->irc; 266 266 struct chat *c; 267 user_t *u;268 267 269 268 /* MSN servers sometimes redirect you to a different server and do … … 273 272 return; 274 273 275 u = user_find( ic->irc, ic->irc->nick );276 277 274 imcb_log( ic, "Logged in" ); 278 275 … … 287 284 ic->acc->auto_reconnect_delay = 0; 288 285 286 /* 289 287 for( c = irc->chatrooms; c; c = c->next ) 290 288 { … … 295 293 chat_join( irc, c, NULL ); 296 294 } 295 */ 297 296 } 298 297 … … 360 359 /* Uhm... This is very sick. */ 361 360 } 362 else if( allow_reconnect && set_getbool( &irc-> set, "auto_reconnect" ) &&361 else if( allow_reconnect && set_getbool( &irc->b->set, "auto_reconnect" ) && 363 362 set_getbool( &a->set, "auto_reconnect" ) && 364 363 ( delay = account_reconnect_delay( a ) ) > 0 ) … … 391 390 if( user_findhandle( ic, handle ) ) 392 391 { 393 if( set_getbool( &irc-> set, "debug" ) )392 if( set_getbool( &irc->b->set, "debug" ) ) 394 393 imcb_log( ic, "User already exists, ignoring add request: %s", handle ); 395 394 … … 470 469 u->realname = g_strdup( realname ); 471 470 472 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc-> set, "display_namechanges" ) )471 if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->b->set, "display_namechanges" ) ) 473 472 imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname ); 474 473 } … … 518 517 /* Some processing to make sure this string is a valid IRC nickname. */ 519 518 nick_strip( newnick ); 520 if( set_getbool( &ic->irc-> set, "lcnicks" ) )519 if( set_getbool( &ic->irc->b->set, "lcnicks" ) ) 521 520 nick_lc( newnick ); 522 521 … … 626 625 if( !u ) 627 626 { 628 if( g_strcasecmp( set_getstr( &ic->irc-> set, "handle_unknown" ), "add" ) == 0 )627 if( g_strcasecmp( set_getstr( &ic->irc->b->set, "handle_unknown" ), "add" ) == 0 ) 629 628 { 630 629 imcb_add_buddy( ic, (char*) handle, NULL ); … … 633 632 else 634 633 { 635 if( set_getbool( &ic->irc-> set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 )634 if( set_getbool( &ic->irc->b->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->b->set, "handle_unknown" ), "ignore" ) != 0 ) 636 635 { 637 636 imcb_log( ic, "imcb_buddy_status() for unknown handle %s:", handle ); … … 693 692 694 693 /* LISPy... */ 695 if( ( set_getbool( &ic->irc-> set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */694 if( ( set_getbool( &ic->irc->b->set, "away_devoice" ) ) && /* Don't do a thing when user doesn't want it */ 696 695 ( u->online ) && /* Don't touch offline people */ 697 696 ( ( ( u->online != oo ) && !u->away ) || /* Voice joining people */ … … 700 699 char *from; 701 700 702 if( set_getbool( &ic->irc-> set, "simulate_netsplit" ) )701 if( set_getbool( &ic->irc->b->set, "simulate_netsplit" ) ) 703 702 { 704 703 from = g_strdup( ic->irc->myhost ); … … 725 724 if( !u ) 726 725 { 727 char *h = set_getstr( &irc-> set, "handle_unknown" );726 char *h = set_getstr( &irc->b->set, "handle_unknown" ); 728 727 729 728 if( g_strcasecmp( h, "ignore" ) == 0 ) 730 729 { 731 if( set_getbool( &irc-> set, "debug" ) )730 if( set_getbool( &irc->b->set, "debug" ) ) 732 731 imcb_log( ic, "Ignoring message from unknown handle %s", handle ); 733 732 … … 736 735 else if( g_strncasecmp( h, "add", 3 ) == 0 ) 737 736 { 738 int private = set_getbool( &irc-> set, "private" );737 int private = set_getbool( &irc->b->set, "private" ); 739 738 740 739 if( h[3] ) … … 757 756 } 758 757 759 if( ( g_strcasecmp( set_getstr( &ic->irc-> set, "strip_html" ), "always" ) == 0 ) ||760 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc-> set, "strip_html" ) ) )758 if( ( g_strcasecmp( set_getstr( &ic->irc->b->set, "strip_html" ), "always" ) == 0 ) || 759 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->b->set, "strip_html" ) ) ) 761 760 strip_html( msg ); 762 761 … … 770 769 user_t *u; 771 770 772 if( !set_getbool( &ic->irc-> set, "typing_notice" ) )771 if( !set_getbool( &ic->irc->b->set, "typing_notice" ) ) 773 772 return; 774 773 … … 801 800 c->topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title ); 802 801 803 if( set_getbool( &ic->irc-> set, "debug" ) )802 if( set_getbool( &ic->irc->b->set, "debug" ) ) 804 803 imcb_log( ic, "Creating new conversation: (id=%p,handle=%s)", c, handle ); 805 804 … … 813 812 GList *ir; 814 813 815 if( set_getbool( &ic->irc-> set, "debug" ) )814 if( set_getbool( &ic->irc->b->set, "debug" ) ) 816 815 imcb_log( ic, "You were removed from conversation %p", c ); 817 816 … … 860 859 u = user_findhandle( ic, who ); 861 860 862 if( ( g_strcasecmp( set_getstr( &ic->irc-> set, "strip_html" ), "always" ) == 0 ) ||863 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc-> set, "strip_html" ) ) )861 if( ( g_strcasecmp( set_getstr( &ic->irc->b->set, "strip_html" ), "always" ) == 0 ) || 862 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->b->set, "strip_html" ) ) ) 864 863 strip_html( msg ); 865 864 … … 906 905 u = user_findhandle( ic, who ); 907 906 908 if( ( g_strcasecmp( set_getstr( &ic->irc-> set, "strip_html" ), "always" ) == 0 ) ||909 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc-> set, "strip_html" ) ) )907 if( ( g_strcasecmp( set_getstr( &ic->irc->b->set, "strip_html" ), "always" ) == 0 ) || 908 ( ( ic->flags & OPT_DOES_HTML ) && set_getbool( &ic->irc->b->set, "strip_html" ) ) ) 910 909 strip_html( topic ); 911 910 … … 925 924 int me = 0; 926 925 927 if( set_getbool( &b->ic->irc-> set, "debug" ) )926 if( set_getbool( &b->ic->irc->b->set, "debug" ) ) 928 927 imcb_log( b->ic, "User %s added to conversation %p", handle, b ); 929 928 … … 960 959 int me = 0; 961 960 962 if( set_getbool( &b->ic->irc-> set, "debug" ) )961 if( set_getbool( &b->ic->irc->b->set, "debug" ) ) 963 962 imcb_log( b->ic, "User %s removed from conversation %p (%s)", handle, b, reason ? reason : "" ); 964 963 … … 1018 1017 /* Horror.... */ 1019 1018 1020 if( st != set_getbool( &irc-> set, "away_devoice" ) )1019 if( st != set_getbool( &irc->b->set, "away_devoice" ) ) 1021 1020 { 1022 1021 char list[80] = ""; … … 1107 1106 1108 1107 away = set_getstr( &ic->acc->set, "away" ) ? 1109 : set_getstr( &ic->irc-> set, "away" );1108 : set_getstr( &ic->irc->b->set, "away" ); 1110 1109 if( away && *away ) 1111 1110 { … … 1118 1117 away = NULL; 1119 1118 msg = set_getstr( &ic->acc->set, "status" ) ? 1120 : set_getstr( &ic->irc-> set, "status" );1119 : set_getstr( &ic->irc->b->set, "status" ); 1121 1120 } 1122 1121
Note: See TracChangeset
for help on using the changeset viewer.