Changeset 21c87a7
- Timestamp:
- 2010-04-14T09:27:50Z (15 years ago)
- Branches:
- master
- Children:
- d33679e
- Parents:
- 81186cab (diff), 156bbd7 (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:
-
- 8 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r81186cab r21c87a7 11 11 # Program variables 12 12 #objects = chat.o 13 objects = bitlbee.o dcc.o help.o ipc.o irc.o irc_im.o irc_channel.o irc_commands.o irc_send.o irc_user.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS)13 objects = bitlbee.o dcc.o help.o ipc.o irc.o irc_im.o irc_channel.o irc_commands.o irc_send.o irc_user.o irc_util.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) 14 14 headers = account.h bitlbee.h commands.h conf.h config.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/ftutil.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/ft.h protocols/nogaim.h 15 15 subdirs = lib protocols … … 127 127 ctags: 128 128 ctags `find . -name "*.c"` `find . -name "*.h"` 129 130 # Using this as a bogus Make target to test if a GNU-compatible version of 131 # make is available. 132 helloworld: 133 @echo Hello World -
bitlbee.c
r81186cab r21c87a7 42 42 FILE *fp; 43 43 44 log_link( LOGLVL_ERROR, LOGOUTPUT_ SYSLOG);45 log_link( LOGLVL_WARNING, LOGOUTPUT_ SYSLOG);44 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); 45 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); 46 46 47 47 memset( &hints, 0, sizeof( hints ) ); … … 70 70 continue; 71 71 72 #ifdef IPV6_V6ONLY 73 if( res->ai_family == AF_INET6 ) 74 { 75 i = 0; 76 setsockopt( global.listen_socket, IPPROTO_IPV6, IPV6_V6ONLY, 77 (char *) &i, sizeof( i ) ); 78 } 79 #endif 80 72 81 /* TIME_WAIT (?) sucks.. */ 73 82 i = 1; … … 80 89 return( -1 ); 81 90 } 82 83 91 break; 84 92 } … … 107 115 exit( 0 ); 108 116 117 setsid(); 109 118 chdir( "/" ); 110 119 … … 137 146 #endif 138 147 148 if( !global.conf->nofork ) 149 { 150 log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG ); 151 log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG ); 152 } 153 139 154 return( 0 ); 140 155 } -
bitlbee.h
r81186cab r21c87a7 35 35 36 36 #define PACKAGE "BitlBee" 37 #define BITLBEE_VERSION "1.2. 5"37 #define BITLBEE_VERSION "1.2.6" 38 38 #define VERSION BITLBEE_VERSION 39 #define BITLBEE_VER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 40 #define BITLBEE_VERSION_CODE BITLBEE_VER(1, 2, 6) 39 41 40 42 #define MAX_STRING 511 -
conf.c
r81186cab r21c87a7 82 82 } 83 83 84 while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:u: " ) ) >= 0 )84 while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:u:V" ) ) >= 0 ) 85 85 /* ^^^^ Just to make sure we skip this step from the REHASH handler. */ 86 86 { … … 148 148 " -d Specify alternative user configuration directory\n" 149 149 " -x Command-line interface to password encryption/hashing\n" 150 " -h Show this help page.\n" ); 150 " -h Show this help page.\n" 151 " -V Show version info.\n" ); 152 return NULL; 153 } 154 else if( opt == 'V' ) 155 { 156 printf( "BitlBee %s\nAPI version %06x\n", 157 BITLBEE_VERSION, BITLBEE_VERSION_CODE ); 151 158 return NULL; 152 159 } -
configure
r81186cab r21c87a7 26 26 oscar=1 27 27 yahoo=1 28 twitter=1 28 29 29 30 debug=0 … … 66 67 --oscar=0/1 Disable/enable Oscar part (ICQ, AIM) $oscar 67 68 --yahoo=0/1 Disable/enable Yahoo part $yahoo 69 --twitter=0/1 Disable/enable Twitter part $twitter 68 70 69 71 --debug=0/1 Disable/enable debugging $debug … … 267 269 detect_ldap() 268 270 { 269 TMPFILE=$(mktemp )271 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 270 272 if $CC -o $TMPFILE -shared -lldap 2>/dev/null >/dev/null; then 271 273 cat<<EOF>>Makefile.settings … … 295 297 detect_resolv_dynamic() 296 298 { 297 TMPFILE=$(mktemp )299 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 298 300 ret=1 299 301 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -lresolv >/dev/null 2>/dev/null … … 309 311 detect_resolv_static() 310 312 { 311 TMPFILE=$(mktemp )313 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 312 314 ret=1 313 315 for i in $systemlibdirs; do … … 476 478 fi 477 479 480 if ! make helloworld > /dev/null 2>&1; then 481 echo "WARNING: Your version of make (BSD make?) does not support BitlBee's makefiles." 482 echo "BitlBee needs GNU make to build properly. On most systems GNU make is available" 483 echo "under the name 'gmake'." 484 echo 485 if gmake helloworld > /dev/null 2>&1; then 486 echo "gmake seems to be available on your machine, great." 487 echo 488 else 489 echo "gmake is not installed (or not working). Please try to install it." 490 echo 491 fi 492 fi 493 478 494 cat <<EOF>bitlbee.pc 479 495 prefix=$prefix … … 524 540 fi 525 541 542 if [ "$twitter" = 0 ]; then 543 echo '#undef WITH_TWITTER' >> config.h 544 else 545 echo '#define WITH_TWITTER' >> config.h 546 protocols=$protocols'twitter ' 547 protoobjs=$protoobjs'twitter_mod.o ' 548 fi 549 526 550 if [ "$protocols" = "PROTOCOLS = " ]; then 527 551 echo "Warning: You haven't selected any communication protocol to compile!" -
doc/CHANGES
r81186cab r21c87a7 3 3 4 4 http://bugs.bitlbee.org/bitlbee/timeline?daysback=90&changeset=on 5 6 Version 1.2.6: 7 - Native (very basic) support for Twitter. 8 - Fixed format of status messages in /WHOIS to improve IRC client 9 compatibility. 10 - Show timestamps of offline messages/channel backlogs. 11 - Allow saving MSN display names locally since sometimes this stuff breaks 12 server-side. (Use the local_display_name per-account setting.) 13 - Suppress empty "Headline:" messages for certain new XMPP broadcast 14 messages. 15 - Better handling of XMPP contacts with multiple resources on-line. Default 16 behaviour now is to write to wherever the last message came from, or to 17 the bare JID (usually becomes a broadcast) if there wasn't any recent msg. 18 - The usual misc. bug fixes. 19 20 Finished ... 5 21 6 22 Version 1.2.5: … … 23 39 the main client). 24 40 25 Fi xed 17 Mar 201041 Finished 17 Mar 2010 26 42 27 43 Version 1.2.4: -
doc/user-guide/commands.xml
r81186cab r21c87a7 63 63 </ircexample> 64 64 </bitlbee-command> 65 66 <bitlbee-command name="twitter"> 67 <syntax>account add twitter <handle> <password></syntax> 68 69 <description> 70 <para> 71 This module gives you simple access to Twitter. Although it uses the Twitter API, only Twitter itself is supported at the moment. 72 </para> 73 74 <para> 75 By default all your Twitter contacts will show up in your contact list and their tweets will show up as private messages or in &bitlbee depending on your settings. If you want them in a separate channel, use the use_groupchat setting (see <emphasis>help set use_groupchat</emphasis>). 76 </para> 77 78 <para> 79 To send tweets yourself, send them to any of your Twitter contacts via /query (doesn't matter who), or just write in the groupchat channel if you enabled that option. 80 </para> 81 </description> 82 </bitlbee-command> 65 83 66 84 <bitlbee-command name="yahoo"> … … 401 419 402 420 <bitlbee-setting name="auto_reconnect" type="boolean" scope="both"> 403 <default> false</default>421 <default>true</default> 404 422 405 423 <description> … … 556 574 <para> 557 575 With this option enabled, root will inform you when someone in your buddy list changes his/her "friendly name". 576 </para> 577 </description> 578 </bitlbee-setting> 579 580 <bitlbee-setting name="display_timestamps" type="boolean" scope="global"> 581 <default>true</default> 582 583 <description> 584 <para> 585 When incoming messages are old (i.e. offline messages and channel backlogs), BitlBee will prepend them with a timestamp. If you find them ugly or useless, you can use this setting to hide them. 558 586 </para> 559 587 </description> … … 609 637 </bitlbee-setting> 610 638 639 <bitlbee-setting name="local_display_name" type="boolean" scope="account"> 640 <default>false</default> 641 642 <description> 643 <para> 644 Mostly meant to work around a bug in MSN servers (forgetting the display name set by the user), this setting tells BitlBee to store your display name locally and set this name on the MSN servers when connecting. 645 </para> 646 </description> 647 648 </bitlbee-setting> 649 611 650 <bitlbee-setting name="mail_notifications" type="boolean" scope="account"> 612 651 <default>false</default> … … 828 867 </bitlbee-setting> 829 868 869 <bitlbee-setting name="timezone" type="string" scope="global"> 870 <default>local</default> 871 <possible-values>local, utc, gmt, timezone-spec</possible-values> 872 873 <description> 874 <para> 875 If message timestamps are available for offline messages or chatroom backlogs, BitlBee will display them as part of the message. By default it will use the local timezone. If you're not in the same timezone as the BitlBee server, you can adjust the timestamps using this setting. 876 </para> 877 878 <para> 879 Values local/utc/gmt should be self-explanatory. timezone-spec is a time offset in hours:minutes, for example: -8 for Pacific Standard Time, +2 for Central European Summer Time, +5:30 for Indian Standard Time. 880 </para> 881 </description> 882 </bitlbee-setting> 883 830 884 <bitlbee-setting name="tls" type="boolean" scope="account"> 831 885 <default>try</default> … … 862 916 <para> 863 917 Sends you a /notice when a user starts typing a message (if supported by the IM protocol and the user's client). To use this, you most likely want to use a script in your IRC client to show this information in a more sensible way. 918 </para> 919 </description> 920 </bitlbee-setting> 921 922 <bitlbee-setting name="use_groupchat" type="boolean" scope="account"> 923 <default>false</default> 924 925 <description> 926 <para> 927 By default the Twitter module shows all Twitter contacts and their Tweet in &bitlbee and/or private messages. With this setting enabled the module will show all contacts and their Tweets in a separate channel. 864 928 </para> 865 929 </description> -
irc.c
r81186cab r21c87a7 105 105 s = set_add( &b->set, "default_target", "root", NULL, irc ); 106 106 s = set_add( &b->set, "display_namechanges", "false", set_eval_bool, irc ); 107 s = set_add( &b->set, "display_timestamps", "true", set_eval_bool, irc ); 107 108 s = set_add( &b->set, "handle_unknown", "root", NULL, irc ); 108 109 s = set_add( &b->set, "lcnicks", "true", set_eval_bool, irc ); … … 112 113 s = set_add( &b->set, "root_nick", ROOT_NICK, NULL/*set_eval_root_nick*/, irc ); 113 114 s = set_add( &b->set, "simulate_netsplit", "true", set_eval_bool, irc ); 115 s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc ); 114 116 s = set_add( &b->set, "to_char", ": ", set_eval_to_char, irc ); 115 117 s = set_add( &b->set, "typing_notice", "false", set_eval_bool, irc ); … … 747 749 } 748 750 749 750 751 static char *set_eval_charset( set_t *set, char *value ) 751 752 { 752 irc_t *irc = set->data; 753 irc_t *irc = (irc_t*) set->data; 754 char *test; 755 gsize test_bytes = 0; 753 756 GIConv ic, oc; 754 757 … … 756 759 value = g_strdup( "utf-8" ); 757 760 761 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 762 { 763 return NULL; 764 } 765 766 /* Do a test iconv to see if the user picked an IRC-compatible 767 charset (for example utf-16 goes *horribly* wrong). */ 768 if( ( test = g_convert_with_iconv( " ", 1, oc, NULL, &test_bytes, NULL ) ) == NULL || 769 test_bytes > 1 ) 770 { 771 g_free( test ); 772 g_iconv_close( oc ); 773 irc_usermsg( irc, "Unsupported character set: The IRC protocol " 774 "only supports 8-bit character sets." ); 775 return NULL; 776 } 777 g_free( test ); 778 758 779 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 759 780 { 760 return NULL; 761 } 762 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 763 { 764 g_iconv_close( ic ); 781 g_iconv_close( oc ); 765 782 return NULL; 766 783 } -
irc.h
r81186cab r21c87a7 211 211 gint irc_user_cmp( gconstpointer a_, gconstpointer b_ ); 212 212 213 /* irc_util.c */ 214 char *set_eval_timezone( struct set *set, char *value ); 215 char *irc_format_timestamp( irc_t *irc, time_t msg_ts ); 216 213 217 #endif -
irc_im.c
r81186cab r21c87a7 99 99 irc_user_t *iu = (irc_user_t *) bu->ui_data; 100 100 char *dst, *prefix = NULL; 101 char *wrapped; 101 char *wrapped, *ts = NULL; 102 103 if( sent_at > 0 && set_getbool( &irc->b->set, "display_timestamps" ) ) 104 ts = irc_format_timestamp( irc, sent_at ); 102 105 103 106 if( iu->flags & IRC_USER_PRIVATE ) 104 107 { 105 108 dst = irc->user->nick; 109 prefix = ts; 110 ts = NULL; 106 111 } 107 112 else 108 113 { 109 114 dst = ic->name; 110 prefix = g_strdup_printf( "%s%s ", irc->user->nick, set_getstr( &bee->set, "to_char" ));115 prefix = g_strdup_printf( "%s%s%s", irc->user->nick, set_getstr( &bee->set, "to_char" ), ts ); 111 116 } 112 117 … … 116 121 g_free( wrapped ); 117 122 g_free( prefix ); 123 g_free( ts ); 118 124 119 125 return TRUE; -
lib/misc.c
r81186cab r21c87a7 77 77 78 78 return mktime(&tm); 79 } 80 81 time_t mktime_utc( struct tm *tp ) 82 { 83 struct tm utc; 84 time_t res, tres; 85 86 tp->tm_isdst = -1; 87 res = mktime( tp ); 88 /* Problem is, mktime() just gave us the GMT timestamp for the 89 given local time... While the given time WAS NOT local. So 90 we should fix this now. 91 92 Now I could choose between messing with environment variables 93 (kludgy) or using timegm() (not portable)... Or doing the 94 following, which I actually prefer... 95 96 tzset() may also work but in other places I actually want to 97 use local time. 98 99 FFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUU!! */ 100 gmtime_r( &res, &utc ); 101 utc.tm_isdst = -1; 102 if( utc.tm_hour == tp->tm_hour && utc.tm_min == tp->tm_min ) 103 /* Sweet! We're in UTC right now... */ 104 return res; 105 106 tres = mktime( &utc ); 107 res += res - tres; 108 109 /* Yes, this is a hack. And it will go wrong around DST changes. 110 BUT this is more likely to be threadsafe than messing with 111 environment variables, and possibly more portable... */ 112 113 return res; 79 114 } 80 115 -
lib/misc.h
r81186cab r21c87a7 43 43 44 44 G_MODULE_EXPORT time_t get_time( int year, int month, int day, int hour, int min, int sec ); 45 G_MODULE_EXPORT time_t mktime_utc( struct tm *tp ); 45 46 double gettime( void ); 46 47 -
log.c
r81186cab r21c87a7 172 172 fprintf(stdout, "Debug: %s\n", message); 173 173 #endif 174 /* Always log stuff in syslogs too. */ 175 log_syslog(level, message); 174 176 return; 175 177 } -
protocols/jabber/jabber_util.c
r81186cab r21c87a7 671 671 time_t jabber_get_timestamp( struct xt_node *xt ) 672 672 { 673 struct tm tp, utc;674 673 struct xt_node *c; 675 time_t res, tres;676 674 char *s = NULL; 675 struct tm tp; 677 676 678 677 for( c = xt->children; ( c = xt_find_node( c, "x" ) ); c = c->next ) … … 692 691 tp.tm_year -= 1900; 693 692 tp.tm_mon --; 694 tp.tm_isdst = -1; /* GRRRRRRRRRRR */ 695 696 res = mktime( &tp ); 697 /* Problem is, mktime() just gave us the GMT timestamp for the 698 given local time... While the given time WAS NOT local. So 699 we should fix this now. 700 701 Now I could choose between messing with environment variables 702 (kludgy) or using timegm() (not portable)... Or doing the 703 following, which I actually prefer... */ 704 gmtime_r( &res, &utc ); 705 utc.tm_isdst = -1; /* Once more: GRRRRRRRRRRRRRRRRRR!!! */ 706 if( utc.tm_hour == tp.tm_hour && utc.tm_min == tp.tm_min ) 707 /* Sweet! We're in UTC right now... */ 708 return res; 709 710 tres = mktime( &utc ); 711 res += res - tres; 712 713 /* Yes, this is a hack. And it will go wrong around DST changes. 714 BUT this is more likely to be threadsafe than messing with 715 environment variables, and possibly more portable... */ 716 717 return res; 693 694 return mktime_utc( &tp ); 718 695 } 719 696 -
protocols/jabber/message.c
r81186cab r21c87a7 80 80 if( type && strcmp( type, "headline" ) == 0 ) 81 81 { 82 c = xt_find_node( node->children, "subject" );83 g_string_append_printf( fullmsg, "Headline: %s\n", c && c->text_len > 0 ? c->text : "");82 if( ( c = xt_find_node( node->children, "subject" ) ) && c->text_len > 0 ) 83 g_string_append_printf( fullmsg, "Headline: %s\n", c->text ); 84 84 85 85 /* <x xmlns="jabber:x:oob"><url>http://....</url></x> can contain a URL, it seems. */ -
protocols/msn/msn.c
r81186cab r21c87a7 31 31 GSList *msn_switchboards; 32 32 33 static char * msn_set_display_name( set_t *set, char *value );33 static char *set_eval_display_name( set_t *set, char *value ); 34 34 35 35 static void msn_init( account_t *acc ) 36 36 { 37 set_t *s; 38 39 s = set_add( &acc->set, "display_name", NULL, msn_set_display_name, acc ); 40 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 41 42 s = set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 37 set_add( &acc->set, "display_name", NULL, set_eval_display_name, acc ); 38 set_add( &acc->set, "local_display_name", "false", set_eval_bool, acc ); 39 set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 43 40 } 44 41 … … 173 170 static void msn_set_my_name( struct im_connection *ic, char *info ) 174 171 { 175 msn_set_display_name( set_find( &ic->acc->set, "display_name" ), info );172 msn_set_display_name( ic, info ); 176 173 } 177 174 … … 289 286 } 290 287 291 static char * msn_set_display_name( set_t *set, char *value )288 static char *set_eval_display_name( set_t *set, char *value ) 292 289 { 293 290 account_t *acc = set->data; 294 291 struct im_connection *ic = acc->ic; 295 struct msn_data *md; 296 char buf[1024], *fn; 297 298 /* Double-check. */ 292 293 /* Allow any name if we're offline. */ 299 294 if( ic == NULL ) 300 return NULL; 301 302 md = ic->proto_data; 295 return value; 303 296 304 297 if( strlen( value ) > 129 ) … … 307 300 return NULL; 308 301 } 309 310 fn = msn_http_encode( value );311 312 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->acc->user, fn );313 msn_write( ic, buf, strlen( buf ) );314 g_free( fn );315 302 316 303 /* Returning NULL would be better, because the server still has to 317 304 confirm the name change. However, it looks a bit confusing to the 318 305 user. */ 319 return value;306 return msn_set_display_name( ic, value ) ? value : NULL; 320 307 } 321 308 -
protocols/msn/msn.h
r81186cab r21c87a7 162 162 char *msn_http_encode( const char *input ); 163 163 void msn_msgq_purge( struct im_connection *ic, GSList **list ); 164 gboolean msn_set_display_name( struct im_connection *ic, const char *rawname ); 164 165 165 166 /* tables.c */ -
protocols/msn/msn_util.c
r81186cab r21c87a7 38 38 imcb_error( ic, "Short write() to main server" ); 39 39 imc_logout( ic, TRUE ); 40 return ( 0 );41 } 42 43 return ( 1 );40 return 0; 41 } 42 43 return 1; 44 44 } 45 45 … … 376 376 g_string_free( ret, TRUE ); 377 377 } 378 379 gboolean msn_set_display_name( struct im_connection *ic, const char *rawname ) 380 { 381 char *fn = msn_http_encode( rawname ); 382 struct msn_data *md = ic->proto_data; 383 char buf[1024]; 384 385 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->acc->user, fn ); 386 g_free( fn ); 387 388 return msn_write( ic, buf, strlen( buf ) ) != 0; 389 } -
protocols/msn/ns.c
r81186cab r21c87a7 35 35 36 36 static void msn_auth_got_passport_token( struct msn_auth_data *mad ); 37 static gboolean msn_ns_got_display_name( struct im_connection *ic, char *name ); 37 38 38 39 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) … … 231 232 else if( num_parts >= 7 && strcmp( cmd[2], "OK" ) == 0 ) 232 233 { 233 set_t *s;234 235 234 if( num_parts == 7 ) 236 { 237 http_decode( cmd[4] ); 238 239 strncpy( ic->displayname, cmd[4], sizeof( ic->displayname ) ); 240 ic->displayname[sizeof(ic->displayname)-1] = 0; 241 242 if( ( s = set_find( &ic->acc->set, "display_name" ) ) ) 243 { 244 g_free( s->value ); 245 s->value = g_strdup( cmd[4] ); 246 } 247 } 235 msn_ns_got_display_name( ic, cmd[4] ); 248 236 else 249 {250 237 imcb_log( ic, "Warning: Friendly name in server response was corrupted" ); 251 }252 238 253 239 imcb_log( ic, "Authenticated, getting buddy list" ); … … 567 553 return( 0 ); 568 554 } 555 #if 0 556 /* Discard this one completely for now since I don't care about the ack 557 and since MSN servers can apparently screw up the formatting. */ 569 558 else if( strcmp( cmd[0], "REA" ) == 0 ) 570 559 { … … 597 586 } 598 587 } 588 #endif 599 589 else if( strcmp( cmd[0], "IPG" ) == 0 ) 600 590 { … … 746 736 } 747 737 } 738 739 static gboolean msn_ns_got_display_name( struct im_connection *ic, char *name ) 740 { 741 set_t *s; 742 743 if( ( s = set_find( &ic->acc->set, "display_name" ) ) == NULL ) 744 return FALSE; /* Shouldn't happen.. */ 745 746 http_decode( name ); 747 748 if( s->value && strcmp( s->value, name ) == 0 ) 749 { 750 return TRUE; 751 /* The names match, nothing to worry about. */ 752 } 753 else if( s->value != NULL && 754 ( strcmp( name, ic->acc->user ) == 0 || 755 set_getbool( &ic->acc->set, "local_display_name" ) ) ) 756 { 757 /* The server thinks our display name is our e-mail address 758 which is probably wrong, or the user *wants* us to do this: 759 Always use the locally set display_name. */ 760 return msn_set_display_name( ic, s->value ); 761 } 762 else 763 { 764 if( s->value && *s->value ) 765 imcb_log( ic, "BitlBee thinks your display name is `%s' but " 766 "the MSN server says it's `%s'. Using the MSN " 767 "server's name. Set local_display_name to true " 768 "to use the local name.", s->value, name ); 769 770 if( g_utf8_validate( name, -1, NULL ) ) 771 { 772 g_free( s->value ); 773 s->value = g_strdup( name ); 774 } 775 else 776 { 777 imcb_log( ic, "Warning: Friendly name in server response was corrupted" ); 778 } 779 780 return TRUE; 781 } 782 } -
protocols/nogaim.c
r81186cab r21c87a7 127 127 extern void byahoo_initmodule(); 128 128 extern void jabber_initmodule(); 129 extern void twitter_initmodule(); 129 130 130 131 #ifdef WITH_MSN … … 142 143 #ifdef WITH_JABBER 143 144 jabber_initmodule(); 145 #endif 146 147 #ifdef WITH_TWITTER 148 twitter_initmodule(); 144 149 #endif 145 150 … … 560 565 } 561 566 567 void imcb_chat_name_hint( struct groupchat *c, const char *name ) 568 { 569 #if 0 570 if( !c->joined ) 571 { 572 struct im_connection *ic = c->ic; 573 char stripped[MAX_NICK_LENGTH+1], *full_name; 574 575 strncpy( stripped, name, MAX_NICK_LENGTH ); 576 stripped[MAX_NICK_LENGTH] = '\0'; 577 nick_strip( stripped ); 578 if( set_getbool( &ic->irc->set, "lcnicks" ) ) 579 nick_lc( stripped ); 580 581 full_name = g_strdup_printf( "&%s", stripped ); 582 583 if( stripped[0] && 584 nick_cmp( stripped, ic->irc->channel + 1 ) != 0 && 585 irc_chat_by_channel( ic->irc, full_name ) == NULL ) 586 { 587 g_free( c->channel ); 588 c->channel = full_name; 589 } 590 else 591 { 592 g_free( full_name ); 593 } 594 } 595 #endif 596 } 597 562 598 void imcb_chat_free( struct groupchat *c ) 563 599 { … … 623 659 if( c && u ) 624 660 { 625 irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", wrapped ); 661 char *ts = NULL; 662 if( set_getbool( &ic->irc->set, "display_timestamps" ) ) 663 ts = format_timestamp( ic->irc, sent_at ); 664 irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, ts ? : "", wrapped ); 665 g_free( ts ); 626 666 } 627 667 else … … 826 866 #endif 827 867 828 829 830 868 /* The plan is to not allow straight calls to prpl functions anymore, but do 831 869 them all from some wrappers. We'll start to define some down here: */ … … 852 890 { 853 891 char *away, *msg = NULL; 892 893 if( ic->acc->prpl->away_states == NULL || 894 ic->acc->prpl->set_away == NULL ) 895 return 0; 854 896 855 897 away = set_getstr( &ic->acc->set, "away" ) ? -
protocols/nogaim.h
r81186cab r21c87a7 299 299 * user, too. */ 300 300 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ); 301 G_MODULE_EXPORT void imcb_chat_name_hint( struct groupchat *c, const char *name ); 301 302 G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, const char *handle ); 302 303 /* To remove a handle from a group chat. Reason can be NULL. */ -
storage_xml.c
r81186cab r21c87a7 498 498 goto write_error; 499 499 500 fsync( fd ); 500 501 close( fd ); 501 502 -
unix.c
r81186cab r21c87a7 73 73 74 74 i = bitlbee_inetd_init(); 75 log_message( LOGLVL_INFO, "Bitl bee %s starting in inetd mode.", BITLBEE_VERSION );75 log_message( LOGLVL_INFO, "BitlBee %s starting in inetd mode.", BITLBEE_VERSION ); 76 76 77 77 } 78 78 else if( global.conf->runmode == RUNMODE_DAEMON ) 79 79 { 80 log_link( LOGLVL_ERROR, LOGOUTPUT_ SYSLOG);81 log_link( LOGLVL_WARNING, LOGOUTPUT_ SYSLOG);80 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); 81 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); 82 82 83 83 i = bitlbee_daemon_init(); 84 log_message( LOGLVL_INFO, "Bitl bee %s starting in daemon mode.", BITLBEE_VERSION );84 log_message( LOGLVL_INFO, "BitlBee %s starting in daemon mode.", BITLBEE_VERSION ); 85 85 } 86 86 else if( global.conf->runmode == RUNMODE_FORKDAEMON ) 87 87 { 88 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); 89 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); 90 88 91 /* In case the operator requests a restart, we need this. */ 89 92 old_cwd = g_malloc( 256 ); … … 96 99 97 100 i = bitlbee_daemon_init(); 98 log_message( LOGLVL_INFO, "Bitl bee %s starting in forking daemon mode.", BITLBEE_VERSION );101 log_message( LOGLVL_INFO, "BitlBee %s starting in forking daemon mode.", BITLBEE_VERSION ); 99 102 } 100 103 if( i != 0 )
Note: See TracChangeset
for help on using the changeset viewer.