Changeset 07874be
- Timestamp:
- 2010-08-14T13:44:35Z (14 years ago)
- Branches:
- master
- Children:
- e5854a8
- Parents:
- 5848675 (diff), 136c2bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user-guide/commands.xml
r5848675 r07874be 1432 1432 <bitlbee-command name="blist"> 1433 1433 <syntax>blist [all|online|offline|away]</syntax> 1434 <short-description>List all the buddies in your contact list</short-description>1435 1436 <description> 1437 <para> 1438 You can get a betterreadable buddy list using the <emphasis>blist</emphasis> command. If you want a complete list (including the offline users) you can use the <emphasis>all</emphasis> argument.1434 <short-description>List all the buddies in the current channel</short-description> 1435 1436 <description> 1437 <para> 1438 You can get a more readable buddy list using the <emphasis>blist</emphasis> command. If you want a complete list (including the offline users) you can use the <emphasis>all</emphasis> argument. 1439 1439 </para> 1440 1440 </description> -
irc.h
r5848675 r07874be 258 258 void irc_channel_update_ops( irc_channel_t *ic, char *value ); 259 259 char *set_eval_irc_channel_ops( struct set *set, char *value ); 260 gboolean irc_channel_wants_user( irc_channel_t *ic, irc_user_t *iu ); 260 261 261 262 /* irc_commands.c */ -
irc_channel.c
r5848675 r07874be 726 726 } 727 727 728 /* Figure out if a channel is supposed to have the user, assuming s/he is 729 online or otherwise also selected by the show_users setting. Only works 730 for control channels, but does *not* check if this channel is of that 731 type. Beware! */ 732 gboolean irc_channel_wants_user( irc_channel_t *ic, irc_user_t *iu ) 733 { 734 struct irc_control_channel *icc = ic->data; 735 736 if( iu->bu == NULL ) 737 return FALSE; 738 739 switch( icc->type ) 740 { 741 case IRC_CC_TYPE_GROUP: 742 return iu->bu->group == icc->group; 743 case IRC_CC_TYPE_ACCOUNT: 744 return iu->bu->ic->acc == icc->account; 745 case IRC_CC_TYPE_PROTOCOL: 746 return iu->bu->ic->acc->prpl == icc->protocol; 747 case IRC_CC_TYPE_DEFAULT: 748 default: 749 return TRUE; 750 } 751 } 752 728 753 static gboolean control_channel_free( irc_channel_t *ic ) 729 754 { -
irc_im.c
r5848675 r07874be 141 141 void bee_irc_channel_update( irc_t *irc, irc_channel_t *ic, irc_user_t *iu ) 142 142 { 143 struct irc_control_channel *icc;144 143 GSList *l; 145 gboolean match = FALSE;146 144 147 145 if( ic == NULL ) … … 168 166 } 169 167 170 icc = ic->data; 171 172 if( icc->type == IRC_CC_TYPE_DEFAULT ) 173 match = TRUE; 174 else if( icc->type == IRC_CC_TYPE_GROUP ) 175 match = iu->bu->group == icc->group; 176 else if( icc->type == IRC_CC_TYPE_ACCOUNT ) 177 match = iu->bu->ic->acc == icc->account; 178 else if( icc->type == IRC_CC_TYPE_PROTOCOL ) 179 match = iu->bu->ic->acc->prpl == icc->protocol; 180 181 if( !match ) 168 if( !irc_channel_wants_user( ic, iu ) ) 182 169 { 183 170 irc_channel_del_user( ic, iu, IRC_CDU_PART, NULL ); … … 185 172 else 186 173 { 174 struct irc_control_channel *icc = ic->data; 187 175 int mode = 0; 188 176 -
irc_send.c
r5848675 r07874be 44 44 irc_send_num( irc, 3, ":%s", IRCD_INFO ); 45 45 irc_send_num( irc, 4, "%s %s %s %s", irc->root->host, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES ); 46 irc_send_num( irc, 5, "PREFIX=(ov)@+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee " 47 "CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", 48 CTYPES, CMODES, MAX_NICK_LENGTH - 1 ); 46 irc_send_num( irc, 5, "PREFIX=(ohv)@%%+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d CHANNELLEN=%d " 47 "NETWORK=BitlBee SAFELIST CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 " 48 ":are supported by this server", 49 CTYPES, CMODES, MAX_NICK_LENGTH - 1, MAX_NICK_LENGTH - 1 ); 49 50 irc_send_motd( irc ); 50 51 } -
irc_user.c
r5848675 r07874be 211 211 212 212 for( l = iu->irc->channels; l; l = l->next ) 213 send_quit |= irc_channel_del_user( (irc_channel_t*) l->data, iu, IRC_CDU_SILENT, NULL ); 213 { 214 irc_channel_t *ic = l->data; 215 send_quit |= irc_channel_del_user( ic, iu, IRC_CDU_SILENT, NULL ) && 216 ( ic->flags & IRC_CHANNEL_JOINED ); 217 } 214 218 215 219 if( send_quit ) -
lib/misc.c
r5848675 r07874be 505 505 } 506 506 507 struct ns_srv_reply * srv_lookup( char *service, char *protocol, char *domain )507 struct ns_srv_reply **srv_lookup( char *service, char *protocol, char *domain ) 508 508 { 509 struct ns_srv_reply **replies = NULL; 510 #ifdef HAVE_RESOLV_A 509 511 struct ns_srv_reply *reply = NULL; 510 #ifdef HAVE_RESOLV_A511 512 char name[1024]; 512 513 unsigned char querybuf[1024]; … … 514 515 ns_msg nsh; 515 516 ns_rr rr; 516 int i, len, size;517 int i, n, len, size; 517 518 518 519 g_snprintf( name, sizeof( name ), "_%s._%s.%s", service, protocol, domain ); … … 524 525 return NULL; 525 526 526 if( ns_parserr( &nsh, ns_s_an, 0, &rr ) != 0 ) 527 return NULL; 528 529 size = ns_rr_rdlen( rr ); 530 buf = ns_rr_rdata( rr ); 531 532 len = 0; 533 for( i = 6; i < size && buf[i]; i += buf[i] + 1 ) 534 len += buf[i] + 1; 535 536 if( i > size ) 537 return NULL; 538 539 reply = g_malloc( sizeof( struct ns_srv_reply ) + len ); 540 memcpy( reply->name, buf + 7, len ); 541 542 for( i = buf[6]; i < len && buf[7+i]; i += buf[7+i] + 1 ) 543 reply->name[i] = '.'; 544 545 if( i > len ) 546 { 547 g_free( reply ); 548 return NULL; 549 } 550 551 reply->prio = ( buf[0] << 8 ) | buf[1]; 552 reply->weight = ( buf[2] << 8 ) | buf[3]; 553 reply->port = ( buf[4] << 8 ) | buf[5]; 527 n = 0; 528 while( ns_parserr( &nsh, ns_s_an, n, &rr ) == 0 ) 529 { 530 size = ns_rr_rdlen( rr ); 531 buf = ns_rr_rdata( rr ); 532 533 len = 0; 534 for( i = 6; i < size && buf[i]; i += buf[i] + 1 ) 535 len += buf[i] + 1; 536 537 if( i > size ) 538 break; 539 540 reply = g_malloc( sizeof( struct ns_srv_reply ) + len ); 541 memcpy( reply->name, buf + 7, len ); 542 543 for( i = buf[6]; i < len && buf[7+i]; i += buf[7+i] + 1 ) 544 reply->name[i] = '.'; 545 546 if( i > len ) 547 { 548 g_free( reply ); 549 break; 550 } 551 552 reply->prio = ( buf[0] << 8 ) | buf[1]; 553 reply->weight = ( buf[2] << 8 ) | buf[3]; 554 reply->port = ( buf[4] << 8 ) | buf[5]; 555 556 n ++; 557 replies = g_renew( struct ns_srv_reply *, replies, n + 1 ); 558 replies[n-1] = reply; 559 } 560 if( replies ) 561 replies[n] = NULL; 554 562 #endif 555 563 556 return reply; 564 return replies; 565 } 566 567 void srv_free( struct ns_srv_reply **srv ) 568 { 569 int i; 570 571 if( srv == NULL ) 572 return; 573 574 for( i = 0; srv[i]; i ++ ) 575 g_free( srv[i] ); 576 g_free( srv ); 557 577 } 558 578 -
lib/misc.h
r5848675 r07874be 61 61 G_MODULE_EXPORT int bool2int( char *value ); 62 62 63 G_MODULE_EXPORT struct ns_srv_reply *srv_lookup( char *service, char *protocol, char *domain ); 63 G_MODULE_EXPORT struct ns_srv_reply **srv_lookup( char *service, char *protocol, char *domain ); 64 G_MODULE_EXPORT void srv_free( struct ns_srv_reply **srv ); 64 65 65 66 G_MODULE_EXPORT char *word_wrap( const char *msg, int line_len ); -
protocols/jabber/jabber.c
r5848675 r07874be 96 96 struct im_connection *ic = imcb_new( acc ); 97 97 struct jabber_data *jd = g_new0( struct jabber_data, 1 ); 98 struct ns_srv_reply * srv = NULL;98 struct ns_srv_reply **srvl = NULL, *srv = NULL; 99 99 char *connect_to, *s; 100 100 int i; … … 196 196 if( acc->server && *acc->server ) 197 197 connect_to = acc->server; 198 else if( ( srv = srv_lookup( "xmpp-client", "tcp", jd->server ) ) || 199 ( srv = srv_lookup( "jabber-client", "tcp", jd->server ) ) ) 198 else if( ( srvl = srv_lookup( "xmpp-client", "tcp", jd->server ) ) || 199 ( srvl = srv_lookup( "jabber-client", "tcp", jd->server ) ) ) 200 { 201 /* Find the lowest-priority one. These usually come 202 back in random/shuffled order. Not looking at 203 weights etc for now. */ 204 srv = *srvl; 205 for( i = 1; srvl[i]; i ++ ) 206 if( srvl[i]->prio < srv->prio ) 207 srv = srvl[i]; 208 200 209 connect_to = srv->name; 210 } 201 211 else 202 212 connect_to = jd->server; … … 227 237 jd->fd = proxy_connect( connect_to, srv ? srv->port : set_getint( &acc->set, "port" ), jabber_connected_plain, ic ); 228 238 } 229 g_free( srv);239 srv_free( srvl ); 230 240 231 241 if( jd->fd == -1 ) -
protocols/twitter/twitter.c
r5848675 r07874be 257 257 258 258 // Set the status to logged out. 259 ic->flags = 0;259 ic->flags &= ~ OPT_LOGGED_IN; 260 260 261 261 // Remove the main_loop function from the function queue. -
protocols/twitter/twitter_lib.c
r5848675 r07874be 357 357 } 358 358 359 #ifdef __GLIBC__ 360 #define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S %z %Y" 361 #else 362 #define TWITTER_TIME_FORMAT "%a %b %d %H:%M:%S +0000 %Y" 363 #endif 359 364 360 365 /** … … 393 398 this field. :-( Also assumes the timezone used 394 399 is UTC since C time handling functions suck. */ 395 if( strptime( child->text, "%a %b %d %H:%M:%S %z %Y", &parsed ) != NULL )400 if( strptime( child->text, TWITTER_TIME_FORMAT, &parsed ) != NULL ) 396 401 txs->created_at = mktime_utc( &parsed ); 397 402 } -
root_commands.c
r5848675 r07874be 1008 1008 irc_usermsg( irc, format, "Nick", "Handle/Account", "Status" ); 1009 1009 1010 if( strcmp( set_getstr( &irc->root->last_channel->set, "type" ), "control" ) != 0 ) 1011 irc->root->last_channel = NULL; 1012 1010 1013 for( l = irc->users; l; l = l->next ) 1011 1014 { … … 1013 1016 bee_user_t *bu = iu->bu; 1014 1017 1015 if( !bu || ( bu->flags & ( BEE_USER_ONLINE | BEE_USER_AWAY ) ) != BEE_USER_ONLINE ) 1018 if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || 1019 ( bu->flags & ( BEE_USER_ONLINE | BEE_USER_AWAY ) ) != BEE_USER_ONLINE ) 1016 1020 continue; 1017 1021 … … 1035 1039 bee_user_t *bu = iu->bu; 1036 1040 1037 if( !bu || !( bu->flags & BEE_USER_ONLINE ) || !( bu->flags & BEE_USER_AWAY ) ) 1041 if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || 1042 !( bu->flags & BEE_USER_ONLINE ) || !( bu->flags & BEE_USER_AWAY ) ) 1038 1043 continue; 1039 1044 … … 1051 1056 bee_user_t *bu = iu->bu; 1052 1057 1053 if( !bu || bu->flags & BEE_USER_ONLINE ) 1058 if( !bu || ( irc->root->last_channel && !irc_channel_wants_user( irc->root->last_channel, iu ) ) || 1059 bu->flags & BEE_USER_ONLINE ) 1054 1060 continue; 1055 1061 -
sock.h
r5848675 r07874be 13 13 #ifndef EVENTS_LIBEVENT 14 14 #define closesocket(a) close(a) 15 #else 16 void closesocket( int fd ); 15 17 #endif 16 18 #else
Note: See TracChangeset
for help on using the changeset viewer.