Changes in / [f712188:ac55e50]
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
account.c
rf712188 rac55e50 28 28 #include "account.h" 29 29 30 account_t *account_add( irc_t *irc, int protocol, char *user, char *pass )30 account_t *account_add( irc_t *irc, struct prpl *prpl, char *user, char *pass ) 31 31 { 32 32 account_t *a; … … 42 42 } 43 43 44 a->pr otocol = protocol;44 a->prpl = prpl; 45 45 a->user = g_strdup( user ); 46 46 a->pass = g_strdup( pass ); … … 66 66 for( a = irc->accounts; a; a = a->next ) 67 67 { 68 if( g_strcasecmp( id, proto_name[a->protocol]) == 0 )68 if( g_strcasecmp( id, a->prpl->name ) == 0 ) 69 69 { 70 70 if( !ret ) … … 124 124 } 125 125 126 if ( proto_prpl[a->protocol]->login== NULL )126 if (a->prpl == NULL ) 127 127 { 128 irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", proto_name[a->protocol]);128 irc_usermsg( irc, "Support for protocol %s is not included in this BitlBee", a->prpl->name ); 129 129 return; 130 130 } … … 134 134 u = g_new0 ( struct aim_user, 1 ); 135 135 u->irc = irc; 136 u->pr otocol = a->protocol;136 u->prpl = a->prpl; 137 137 strncpy( u->username, a->user, sizeof( u->username ) - 1 ); 138 138 strncpy( u->password, a->pass, sizeof( u->password ) - 1 ); … … 142 142 a->reconnect = 0; 143 143 144 proto_prpl[a->protocol]->login( u );144 a->prpl->login( u ); 145 145 } 146 146 -
account.h
rf712188 rac55e50 29 29 typedef struct account 30 30 { 31 int protocol;31 struct prpl *prpl; 32 32 char *user; 33 33 char *pass; … … 41 41 } account_t; 42 42 43 account_t *account_add( irc_t *irc, int protocol, char *user, char *pass );43 account_t *account_add( irc_t *irc, struct prpl *prpl, char *user, char *pass ); 44 44 account_t *account_get( irc_t *irc, char *id ); 45 45 void account_del( irc_t *irc, account_t *acc ); -
bitlbee.c
rf712188 rac55e50 236 236 } 237 237 238 /* DO NOT USE THIS FUNCTION IN NEW CODE. This 239 * function is here merely because the save/load code still uses 240 * ids rather then names */ 241 struct prpl *find_protocol_by_id(int id) 242 { 243 switch (id) { 244 case 1: return find_protocol("oscar"); 245 case 4: return find_protocol("msn"); 246 case 2: return find_protocol("yahoo"); 247 case 8: return find_protocol("jabber"); 248 default: break; 249 } 250 return NULL; 251 } 252 238 253 int bitlbee_load( irc_t *irc, char* password ) 239 254 { 240 255 char s[512]; 241 256 char *line; 242 int proto;257 char proto[20]; 243 258 char nick[MAX_NICK_LENGTH+1]; 244 259 FILE *fp; … … 275 290 fp = fopen( s, "r" ); 276 291 if( !fp ) return( 0 ); 277 while( fscanf( fp, "%s %d %s", s, &proto, nick ) > 0 ) 278 { 292 while( fscanf( fp, "%s %s %s", s, proto, nick ) > 0 ) 293 { 294 struct prpl *prpl; 295 296 prpl = find_protocol(proto); 297 298 /* Older files saved the protocol number rather then the protocol name */ 299 if (!prpl && atoi(proto)) { 300 prpl = find_protocol_by_id(atoi(proto)); 301 } 302 303 if (!prpl) 304 continue; 305 279 306 http_decode( s ); 280 nick_set( irc, s, pr oto, nick );307 nick_set( irc, s, prpl, nick ); 281 308 } 282 309 fclose( fp ); … … 333 360 s[169] = 0; /* Prevent any overflow (169 ~ 512 / 3) */ 334 361 http_encode( s ); 335 g_snprintf( s + strlen( s ), 510 - strlen( s ), " % d %s", n->proto, n->nick );362 g_snprintf( s + strlen( s ), 510 - strlen( s ), " %s %s", n->proto->name, n->nick ); 336 363 if( fprintf( fp, "%s\n", s ) != strlen( s ) + 1 ) 337 364 { … … 375 402 for( a = irc->accounts; a; a = a->next ) 376 403 { 377 if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC)404 if( !strcmp( a->prpl->name, "oscar" ) ) 378 405 g_snprintf( s, sizeof( s ), "account add oscar \"%s\" \"%s\" %s", a->user, a->pass, a->server ); 379 406 else 380 407 g_snprintf( s, sizeof( s ), "account add %s \"%s\" \"%s\" \"%s\"", 381 proto_name[a->protocol], a->user, a->pass, a->server ? a->server : "" );408 a->prpl->name, a->user, a->pass, a->server ? a->server : "" ); 382 409 383 410 line = obfucrypt( irc, s ); -
commands.c
rf712188 rac55e50 184 184 if( g_strcasecmp( cmd[1], "add" ) == 0 ) 185 185 { 186 int prot;186 struct prpl *prpl; 187 187 188 188 if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL ) … … 192 192 } 193 193 194 for( prot = 0; prot < PROTO_MAX; prot ++ ) 195 if( proto_name[prot] && *proto_name[prot] && g_strcasecmp( proto_name[prot], cmd[2] ) == 0 ) 196 break; 197 198 if( ( prot == PROTO_MAX ) || ( proto_prpl[prot] == NULL ) ) 194 prpl = find_protocol(cmd[2]); 195 196 if( prpl == NULL ) 199 197 { 200 198 irc_usermsg( irc, "Unknown protocol" ); … … 202 200 } 203 201 204 if( prot == PROTO_OSCAR && cmd[5] == NULL ) 205 { 206 irc_usermsg( irc, "Not enough parameters" ); 207 return( 0 ); 208 } 209 210 a = account_add( irc, prot, cmd[3], cmd[4] ); 202 a = account_add( irc, prpl, cmd[3], cmd[4] ); 211 203 212 204 if( cmd[5] ) … … 252 244 con = ""; 253 245 254 if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC ) 255 irc_usermsg( irc, "%2d. OSCAR, %s on %s%s", i, a->user, a->server, con ); 256 else 257 irc_usermsg( irc, "%2d. %s, %s%s", i, proto_name[a->protocol], a->user, con ); 246 irc_usermsg( irc, "%2d. %s, %s%s", i, a->prpl->name, a->user, con ); 258 247 259 248 i ++; … … 372 361 else 373 362 { 374 nick_set( irc, cmd[2], a->gc->pr otocol, cmd[3] );363 nick_set( irc, cmd[2], a->gc->prpl, cmd[3] ); 375 364 } 376 365 } … … 453 442 else if( u->send_handler == buddy_send_handler ) 454 443 { 455 nick_set( irc, u->handle, u->gc->pr otocol, cmd[2] );444 nick_set( irc, u->handle, u->gc->prpl, cmd[2] ); 456 445 } 457 446 … … 664 653 if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away ) 665 654 { 666 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);655 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 667 656 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Online" ); 668 657 n_online ++; … … 671 660 if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away ) 672 661 { 673 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);662 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 674 663 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, u->away ); 675 664 n_away ++; … … 678 667 if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online ) 679 668 { 680 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol]);669 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name ); 681 670 irc_usermsg( irc, "%-16.16s %-40.40s %s", u->nick, s, "Offline" ); 682 671 n_offline ++; … … 739 728 for( num = 0; q; q = q->next, num ++ ) 740 729 if( q->gc ) /* Not necessary yet, but it might come later */ 741 irc_usermsg( irc, "%d, %s(%s): %s", num, proto_name[q->gc->protocol], q->gc->username, q->question );730 irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->prpl->name, q->gc->username, q->question ); 742 731 else 743 732 irc_usermsg( irc, "%d, BitlBee: %s", num, q->question ); … … 787 776 for( n = gc->irc->nicks; n; n = n->next ) 788 777 { 789 if( n->proto == gc->pr otocol && !user_findhandle( gc, n->handle ) )778 if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) ) 790 779 { 791 780 gc->prpl->add_buddy( gc, n->handle ); -
configure
rf712188 rac55e50 14 14 datadir='$prefix/share/bitlbee/' 15 15 config='/var/lib/bitlbee/' 16 plugindir='$prefix/lib/bitlbee' 16 17 17 18 msn=1 … … 45 46 --mandir=... $mandir 46 47 --datadir=... $datadir 48 --plugindir=... $plugindir 47 49 --config=... $config 48 50 … … 73 75 datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'` 74 76 config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'` 77 plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'` 75 78 76 79 cat<<EOF>Makefile.settings … … 81 84 MANDIR=$mandir 82 85 DATADIR=$datadir 86 PLUGINDIR=$plugindir 83 87 CONFIG=$config 84 88 … … 101 105 #define ETCDIR "$etcdir" 102 106 #define VARDIR "$datadir" 107 #define PLUGINDIR "$plugindir" 103 108 #define ARCH "$arch" 104 109 #define CPU "$cpu" … … 143 148 if type pkg-config > /dev/null 2>/dev/null && pkg-config glib-2.0; then 144 149 cat<<EOF>>Makefile.settings 145 EFLAGS+=`pkg-config --libs glib-2.0 `146 CFLAGS+=`pkg-config --cflags glib-2.0 `150 EFLAGS+=`pkg-config --libs glib-2.0 gmodule-2.0` 151 CFLAGS+=`pkg-config --cflags glib-2.0 gmodule-2.0` 147 152 EOF 148 153 echo '#define GLIB2' >> config.h -
irc.c
rf712188 rac55e50 1165 1165 if( u->gc ) 1166 1166 irc_reply( irc, 312, "%s %s.%s :%s network", u->nick, u->gc->user->username, 1167 *u->gc->user->proto_opt[0] ? u->gc->user->proto_opt[0] : "", proto_name[u->gc->user->protocol]);1167 *u->gc->user->proto_opt[0] ? u->gc->user->proto_opt[0] : "", u->gc->prpl->name ); 1168 1168 else 1169 1169 irc_reply( irc, 312, "%s %s :%s", u->nick, irc->myhost, IRCD_INFO ); -
nick.c
rf712188 rac55e50 27 27 #include "bitlbee.h" 28 28 29 void nick_set( irc_t *irc, char *handle, intproto, char *nick )29 void nick_set( irc_t *irc, char *handle, struct prpl *proto, char *nick ) 30 30 { 31 31 nick_t *m = NULL, *n = irc->nicks; … … 56 56 } 57 57 58 char *nick_get( irc_t *irc, char *handle, intproto, const char *realname )58 char *nick_get( irc_t *irc, char *handle, struct prpl *proto, const char *realname ) 59 59 { 60 60 static char nick[MAX_NICK_LENGTH+1]; -
nick.h
rf712188 rac55e50 27 27 { 28 28 char *handle; 29 intproto;29 struct prpl *proto; 30 30 char *nick; 31 31 struct __NICK *next; 32 32 } nick_t; 33 33 34 void nick_set( irc_t *irc, char *handle, intproto, char *nick );35 char *nick_get( irc_t *irc, char *handle, intproto, const char *realname );34 void nick_set( irc_t *irc, char *handle, struct prpl *proto, char *nick ); 35 char *nick_get( irc_t *irc, char *handle, struct prpl *proto, const char *realname ); 36 36 void nick_del( irc_t *irc, char *nick ); 37 37 void nick_strip( char *nick ); -
protocols/jabber/jabber.c
rf712188 rac55e50 157 157 #define JCS_CLOSED 3 /* closed */ 158 158 159 160 static char *jabber_name()161 {162 return "Jabber";163 }164 159 165 160 #define STATE_EVT(arg) if(gjc->on_state) { (gjc->on_state)(gjc, (arg) ); } … … 2365 2360 } 2366 2361 2367 static struct prpl *my_protocol = NULL; 2368 2369 void jabber_init(struct prpl *ret) 2370 { 2362 2363 void jabber_init() 2364 { 2365 struct prpl *ret = g_new0(struct prpl, 1); 2366 2371 2367 /* the NULL's aren't required but they're nice to have */ 2372 ret->protocol = PROTO_JABBER; 2373 ret->name = jabber_name; 2368 ret->name = "jabber"; 2374 2369 ret->away_states = jabber_away_states; 2375 2370 ret->actions = jabber_actions; … … 2395 2390 ret->cmp_buddynames = g_strcasecmp; 2396 2391 2397 my_protocol = ret;2398 } 2392 register_protocol (ret); 2393 } -
protocols/msn/msn.c
rf712188 rac55e50 26 26 #include "nogaim.h" 27 27 #include "msn.h" 28 29 static struct prpl *my_protocol = NULL;30 28 31 29 static void msn_login( struct aim_user *acct ) … … 375 373 } 376 374 377 void msn_init(struct prpl *ret) 378 { 379 ret->protocol = PROTO_MSN; 375 void msn_init() 376 { 377 struct prpl *ret = g_new0(struct prpl, 1); 378 ret->name = "msn"; 380 379 ret->login = msn_login; 381 380 ret->close = msn_close; … … 400 399 ret->cmp_buddynames = g_strcasecmp; 401 400 402 my_protocol = ret;403 } 401 register_protocol(ret); 402 } -
protocols/nogaim.c
rf712188 rac55e50 39 39 #include <iconv.h> 40 40 41 struct prpl *proto_prpl[PROTO_MAX];42 char proto_name[PROTO_MAX][8] = { "TOC", "OSCAR", "YAHOO", "ICQ", "MSN", "", "", "", "JABBER", "", "", "", "", "", "", "" };43 44 41 static char *proto_away_alias[7][5] = 45 42 { … … 58 55 GSList *connections; 59 56 57 #ifdef WITH_PLUGINS 58 gboolean load_plugin(char *path) 59 { 60 void (*init_function) (void); 61 62 GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); 63 64 if(!mod) { 65 log_message(LOGLVL_ERROR, "Can't find `%s', not loading", path); 66 return FALSE; 67 } 68 69 if(!g_module_symbol(mod,"init_plugin",(gpointer *) &init_function)) { 70 log_message(LOGLVL_WARNING, "Can't find function `init_plugin' in `%s'\n", path); 71 return FALSE; 72 } 73 74 init_function(); 75 76 return TRUE; 77 } 78 79 void load_plugins(void) 80 { 81 GDir *dir; 82 GError *error = NULL; 83 84 dir = g_dir_open(PLUGINDIR, 0, &error); 85 86 if (dir) { 87 const gchar *entry; 88 char *path; 89 90 while ((entry = g_dir_read_name(dir))) { 91 path = g_build_filename(PLUGINDIR, entry, NULL); 92 if(!path) { 93 log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry); 94 continue; 95 } 96 97 load_plugin(path); 98 99 g_free(path); 100 } 101 102 g_dir_close(dir); 103 } 104 } 105 #endif 60 106 61 107 /* nogaim.c */ 62 108 109 GList *protocols = NULL; 110 111 void register_protocol (struct prpl *p) 112 { 113 protocols = g_list_append(protocols, p); 114 } 115 116 117 struct prpl *find_protocol(const char *name) 118 { 119 GList *gl; 120 for (gl = protocols; gl; gl = gl->next) 121 { 122 struct prpl *proto = gl->data; 123 if(!g_strcasecmp(proto->name, name)) 124 return proto; 125 } 126 return NULL; 127 } 128 129 /* nogaim.c */ 63 130 void nogaim_init() 64 131 { 65 proto_prpl[PROTO_MSN] = g_new0 ( struct prpl, 1 ); 132 extern void msn_init(); 133 extern void oscar_init(); 134 extern void byahoo_init(); 135 extern void jabber_init(); 136 66 137 #ifdef WITH_MSN 67 msn_init( proto_prpl[PROTO_MSN]);138 msn_init(); 68 139 #endif 69 140 70 proto_prpl[PROTO_OSCAR] = g_new0( struct prpl, 1 );71 141 #ifdef WITH_OSCAR 72 oscar_init( proto_prpl[PROTO_OSCAR]);142 oscar_init(); 73 143 #endif 74 144 75 proto_prpl[PROTO_YAHOO] = g_new0( struct prpl, 1 );76 145 #ifdef WITH_YAHOO 77 byahoo_init( proto_prpl[PROTO_YAHOO]);146 byahoo_init(); 78 147 #endif 79 148 80 proto_prpl[PROTO_JABBER] = g_new0( struct prpl, 1 );81 149 #ifdef WITH_JABBER 82 jabber_init( proto_prpl[PROTO_JABBER] ); 150 jabber_init(); 151 #endif 152 153 #ifdef WITH_PLUGINS 154 load_plugins(); 83 155 #endif 84 156 } … … 172 244 gc = g_new0( struct gaim_connection, 1 ); 173 245 174 gc->protocol = user->protocol; 175 gc->prpl = proto_prpl[gc->protocol]; 246 gc->prpl = user->prpl; 176 247 g_snprintf( gc->username, sizeof( gc->username ), "%s", user->username ); 177 248 g_snprintf( gc->password, sizeof( gc->password ), "%s", user->password ); … … 254 325 /* Try to find a different connection on the same protocol. */ 255 326 for( a = gc->irc->accounts; a; a = a->next ) 256 if( proto_prpl[a->protocol]== gc->prpl && a->gc != gc )327 if( a->prpl == gc->prpl && a->gc != gc ) 257 328 break; 258 329 259 330 /* If we found one, add the screenname to the acc_id. */ 260 331 if( a ) 261 g_snprintf( acc_id, 32, "%s(%s)", proto_name[gc->protocol], gc->username );332 g_snprintf( acc_id, 32, "%s(%s)", gc->prpl->name, gc->username ); 262 333 else 263 g_snprintf( acc_id, 32, "%s", proto_name[gc->protocol]);334 g_snprintf( acc_id, 32, "%s", gc->prpl->name ); 264 335 265 336 irc_usermsg( gc->irc, "%s - %s", acc_id, msg ); … … 295 366 if( u && u->away ) proto_away( gc, u->away ); 296 367 297 if( gc->protocol == PROTO_ICQ)368 if( !strcmp(gc->prpl->name, "icq") ) 298 369 { 299 370 for( u = gc->irc->users; u; u = u->next ) … … 423 494 424 495 memset( nick, 0, MAX_NICK_LENGTH + 1 ); 425 strcpy( nick, nick_get( gc->irc, handle, gc->pr otocol, realname ) );496 strcpy( nick, nick_get( gc->irc, handle, gc->prpl, realname ) ); 426 497 427 498 u = user_add( gc->irc, nick ); … … 447 518 else 448 519 { 449 u->host = g_strdup( proto_name[gc->user->protocol]);520 u->host = g_strdup( gc->user->prpl->name ); 450 521 u->user = g_strdup( handle ); 451 522 } … … 576 647 } 577 648 578 if( ( type & UC_UNAVAILABLE ) && ( gc->protocol == PROTO_OSCAR || gc->protocol == PROTO_TOC) )649 if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "oscar") || !strcmp(gc->prpl->name, "icq")) ) 579 650 { 580 651 u->away = g_strdup( "Away" ); 581 652 } 582 else if( ( type & UC_UNAVAILABLE ) && ( gc->protocol == PROTO_JABBER) )653 else if( ( type & UC_UNAVAILABLE ) && ( !strcmp(gc->prpl->name, "jabber") ) ) 583 654 { 584 655 if( type & UC_DND ) -
protocols/nogaim.h
rf712188 rac55e50 72 72 /* we need to do either oscar or TOC */ 73 73 /* we make this as an int in case if we want to add more protocols later */ 74 int protocol;75 74 struct prpl *prpl; 76 75 guint32 flags; … … 152 151 char user_info[2048]; 153 152 int options; 154 int protocol;153 struct prpl *prpl; 155 154 /* prpls can use this to save information about the user, 156 155 * like which server to connect to, etc */ … … 161 160 }; 162 161 162 struct ft 163 { 164 const char *filename; 165 166 /* Total number of bytes in file */ 167 size_t total_bytes; 168 169 /* Current number of bytes received */ 170 size_t cur_bytes; 171 }; 172 173 struct ft_request 174 { 175 const char *filename; 176 struct gaim_connection *gc; 177 }; 178 179 typedef void (*ft_recv_handler) (struct ft *, void *data, size_t len); 180 163 181 struct prpl { 164 int protocol;165 182 int options; 166 c har *(* name)();183 const char *name; 167 184 168 185 /* for ICQ and Yahoo, who have off/on per-conversation options */ … … 217 234 void (* group_buddy) (struct gaim_connection *, char *who, char *old_group, char *new_group); 218 235 236 /* file transfers */ 237 struct ft_send_req *(* req_send_file) (struct gaim_connection *, const char *file); 238 void (* send_file_part) (struct gaim_connection *, struct ft*, void *data, size_t length); 239 void (* accept_recv_file) (struct gaim_connection *, struct ft*, ft_recv_handler); 240 219 241 void (* buddy_free) (struct buddy *); 220 242 … … 223 245 int (* cmp_buddynames) (const char *who1, const char *who2); 224 246 }; 225 226 #define PROTO_TOC 0227 #define PROTO_OSCAR 1228 #define PROTO_YAHOO 2229 #define PROTO_ICQ 3230 #define PROTO_MSN 4231 #define PROTO_IRC 5232 #define PROTO_FTP 6233 #define PROTO_VGATE 7234 #define PROTO_JABBER 8235 #define PROTO_NAPSTER 9236 #define PROTO_ZEPHYR 10237 #define PROTO_GADUGADU 11238 #define PROTO_MAX 16239 240 extern char proto_name[PROTO_MAX][8];241 247 242 248 #define UC_UNAVAILABLE 1 … … 249 255 250 256 G_MODULE_EXPORT GSList *get_connections(); 251 extern struct prpl *proto_prpl[16]; 257 G_MODULE_EXPORT struct prpl *find_protocol(const char *name); 258 G_MODULE_EXPORT void register_protocol(struct prpl *); 252 259 253 260 /* nogaim.c */ … … 319 326 G_MODULE_EXPORT void info_string_append(GString *str, char *newline, char *name, char *value); 320 327 321 #ifdef WITH_MSN 322 /* msn.c */ 323 G_MODULE_EXPORT void msn_init( struct prpl *ret ); 324 #endif 325 326 #ifdef WITH_OSCAR 327 /* oscar.c */ 328 G_MODULE_EXPORT void oscar_init( struct prpl *ret ); 329 #endif 330 331 #ifdef WITH_JABBER 332 /* jabber.c */ 333 G_MODULE_EXPORT void jabber_init( struct prpl *ret ); 334 #endif 335 336 #ifdef WITH_YAHOO 337 /* yahoo.c */ 338 G_MODULE_EXPORT void byahoo_init( struct prpl *ret ); 339 #endif 328 /* file transfers */ 329 G_MODULE_EXPORT void ft_progress( struct ft *, int); 330 G_MODULE_EXPORT void ft_incoming( struct ft_request * ); 331 G_MODULE_EXPORT void ft_accepted( struct ft_request *, struct ft *); 332 G_MODULE_EXPORT void ft_denied( struct ft_request *, const char *reason); 340 333 341 334 /* prefs.c */ -
protocols/oscar/oscar.c
rf712188 rac55e50 358 358 odata->icq = TRUE; 359 359 /* this is odd but it's necessary for a proper do_import and do_export */ 360 gc->protocol = PROTO_ICQ;361 360 gc->password[8] = 0; 362 361 } else { 363 gc->protocol = PROTO_TOC;364 362 gc->flags |= OPT_CONN_HTML; 365 363 } … … 2484 2482 } 2485 2483 2486 static struct prpl *my_protocol = NULL; 2487 2488 void oscar_init(struct prpl *ret) { 2489 ret-> protocol = PROTO_OSCAR;2484 void oscar_init() 2485 { 2486 struct prpl *ret = g_new0(struct prpl, 1); 2487 ret->name = "oscar"; 2490 2488 ret->away_states = oscar_away_states; 2491 2489 ret->login = oscar_login; … … 2505 2503 ret->cmp_buddynames = aim_sncmp; 2506 2504 ret->get_status_string = oscar_get_status_string; 2507 2508 2505 ret->send_typing = oscar_send_typing; 2509 2506 2510 my_protocol = ret;2511 } 2507 register_protocol(ret); 2508 } -
protocols/proxy.c
rf712188 rac55e50 50 50 #define GAIM_ERR_COND (G_IO_HUP | G_IO_ERR | G_IO_NVAL) 51 51 52 /*FIXME*53 #ifndef _WIN3254 if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {55 closesocket(fd);56 g_free(phb);57 return -1;58 }59 fcntl(fd, F_SETFL, 0);60 #endif*/61 62 52 char proxyhost[128] = ""; 63 53 int proxyport = 0; -
protocols/yahoo/yahoo.c
rf712188 rac55e50 64 64 }; 65 65 66 static char *yahoo_name()67 {68 return "Yahoo";69 }70 71 static struct prpl *my_protocol = NULL;72 66 static GSList *byahoo_inputs = NULL; 73 67 static int byahoo_chat_id = 0; … … 396 390 } 397 391 398 void byahoo_init( struct prpl *ret)399 { 400 ret->protocol = PROTO_YAHOO;401 ret->name = yahoo_name;392 void byahoo_init( ) 393 { 394 struct prpl *ret = g_new0(struct prpl, 1); 395 ret->name = "yahoo"; 402 396 403 397 ret->login = byahoo_login; 404 398 ret->close = byahoo_close; 405 399 ret->send_im = byahoo_send_im; 406 ret->send_typing = byahoo_send_typing;407 400 ret->get_info = byahoo_get_info; 408 401 ret->away_states = byahoo_away_states; … … 412 405 ret->remove_buddy = byahoo_remove_buddy; 413 406 ret->get_status_string = byahoo_get_status_string; 407 ret->send_typing = byahoo_send_typing; 414 408 415 409 ret->chat_send = byahoo_chat_send; … … 419 413 ret->cmp_buddynames = g_strcasecmp; 420 414 421 my_protocol = ret;415 register_protocol(ret); 422 416 } 423 417 … … 433 427 yd = gc->proto_data; 434 428 435 if( gc->protocol == PROTO_YAHOO&& yd->y2_id == id )429 if( !strcmp(gc->prpl->name, "yahoo") && yd->y2_id == id ) 436 430 return( gc ); 437 431 } -
unix.c
rf712188 rac55e50 47 47 48 48 log_init( ); 49 nogaim_init( ); 50 49 50 nogaim_init(); 51 51 52 CONF_FILE = g_strdup( CONF_FILE_DEF ); 52 53 -
url.h
rf712188 rac55e50 26 26 #include "bitlbee.h" 27 27 28 #define PROTO_HTTP 2 28 #define PROTO_FTP 1 29 #define PROTO_HTTP 2 29 30 #define PROTO_SOCKS4 3 30 31 #define PROTO_SOCKS5 4
Note: See TracChangeset
for help on using the changeset viewer.