Changeset 178e2f8
- Timestamp:
- 2008-06-28T17:32:41Z (16 years ago)
- Branches:
- master
- Children:
- 47b571d
- Parents:
- 2e0f24d (diff), e0f9170 (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:
-
- 1 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.h
r2e0f24d r178e2f8 33 33 34 34 #define PACKAGE "BitlBee" 35 #define BITLBEE_VERSION "1.2 "35 #define BITLBEE_VERSION "1.2.1" 36 36 #define VERSION BITLBEE_VERSION 37 37 -
debian/bitlbee.init
r2e0f24d r178e2f8 44 44 45 45 start-stop-daemon --start --quiet --pidfile $PIDFILE \ 46 -c bitlbee: \47 46 --exec $DAEMON -- -p $BITLBEE_PORT -P $PIDFILE $BITLBEE_OPTS 48 47 } -
debian/changelog
r2e0f24d r178e2f8 1 bitlbee (1.2- 5) UNRELEASED; urgency=low1 bitlbee (1.2-6) UNRELEASED; urgency=low 2 2 3 3 * Add Homepage and Vcs-Bzr fields. 4 4 5 5 -- Jelmer Vernooij <jelmer@samba.org> Sun, 11 May 2008 14:18:16 +0200 6 7 bitlbee (1.2-5) unstable; urgency=low 8 9 * Add myself to uploaders. 10 * Bump standards version to 3.8.0. 11 * Fix FSF address. 12 * Avoid changing uid from init script. (Closes: #474589) 13 14 -- Jelmer Vernooij <jelmer@samba.org> Mon, 16 Jun 2008 00:53:20 +0200 6 15 7 16 bitlbee (1.2-4) unstable; urgency=low -
debian/control
r2e0f24d r178e2f8 3 3 Priority: optional 4 4 Maintainer: Wilmer van der Gaast <wilmer@gaast.net> 5 Standards-Version: 3.5.9 5 Uploaders: Jelmer Vernooij <jelmer@samba.org> 6 Standards-Version: 3.8.0 6 7 Build-Depends: libglib2.0-dev (>= 2.4), libevent-dev, libgnutls-dev | libnss-dev (>= 1.6), debconf-2.0, po-debconf 7 8 Homepage: http://www.bitlbee.org/ 8 9 Vcs-Bzr: http://code.bitlbee.org/bitlbee/ 10 DM-Upload-Allowed: yes 9 11 10 12 Package: bitlbee -
debian/copyright
r2e0f24d r178e2f8 26 26 You should have received a copy of the GNU General Public License with 27 27 the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; 28 if not, write to the Free Software Foundation, Inc., 5 9 Temple Place,29 Suite 330, Boston, MA 02111-1307 USA28 if not, write to the Free Software Foundation, Inc., 51 Franklin St, 29 Fifth Floor, Boston, MA 02110-1301, USA. 30 30 ============================================================================ 31 31 … … 40 40 41 41 Copyright (C) 2000 Free Software Foundation, Inc. 42 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA42 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 43 43 Everyone is permitted to copy and distribute verbatim copies 44 44 of this license document, but changing it is not allowed. -
debian/rules
r2e0f24d r178e2f8 22 22 [ "`whoami`" = "root" -a -d debian ] 23 23 rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev 24 -$(MAKE) distclean24 $(MAKE) distclean 25 25 # -$(MAKE) -C doc/ clean 26 26 -
doc/CHANGES
r2e0f24d r178e2f8 1 This ChangeLog mostly lists changes relevant to users. A full log can be 2 found in the bzr commit logs, for example you can try: 3 4 http://bugs.bitlbee.org/bitlbee/timeline?daysback=90&changeset=on 5 1 6 Version 1.2.1: 2 7 - Fixed proxy support. … … 10 15 password in your IRC client. 11 16 - Compatible with all crazy kinds of line endings that clients can send. 12 13 Finished ... 17 - Changed root nicknames are now saved. 18 - Added ClientInterface setting to bind() outgoing connections to a specific 19 network interface. 20 - Support for receiving Jabber chatroom invitations. 21 - Relaxed port restriction of the Jabber module: added ports 80 and 443. 22 - Preserving case in Jabber resources of buddies, since these should 23 officially be treated as case sensitive. 24 - Fully stripping spaces from AIM screennames, this didn't happen completely 25 which severly breaks the IRC protocol. 26 - Removed all the yellow tape around daemon mode, it's pretty mature by now: 27 testing.bitlbee.org serves all (~30) SSL users from one daemon mode 28 process without any serious stability issues. 29 - Fixed GLib <2.6 compatibility issue. 30 - Misc. memory leak/crash fixes. 31 32 Finished 24 Jun 2008 14 33 15 34 Version 1.2: -
ipc.c
r2e0f24d r178e2f8 209 209 } 210 210 211 /* Return just one line. Returns NULL if something broke, an empty string 212 on temporary "errors" (EAGAIN and friends). */ 211 213 static char *ipc_readline( int fd ) 212 214 { 213 char *buf, *eol;215 char buf[513], *eol; 214 216 int size; 215 216 buf = g_new0( char, 513 );217 217 218 218 /* Because this is internal communication, it should be pretty safe … … 221 221 sockets and limites message length, messages should always be 222 222 complete. Saves us quite a lot of code and buffering. */ 223 size = recv( fd, buf, 512, MSG_PEEK );223 size = recv( fd, buf, sizeof( buf ) - 1, MSG_PEEK ); 224 224 if( size == 0 || ( size < 0 && !sockerr_again() ) ) 225 225 return NULL; … … 229 229 buf[size] = 0; 230 230 231 eol = strstr( buf, "\r\n" ); 232 if( eol == NULL ) 231 if( ( eol = strstr( buf, "\r\n" ) ) == NULL ) 233 232 return NULL; 234 233 else 235 234 size = eol - buf + 2; 236 237 g_free( buf );238 buf = g_new0( char, size + 1 );239 235 240 236 if( recv( fd, buf, size, 0 ) != size ) 241 237 return NULL; 242 238 else 243 buf[size-2] = 0; 244 245 return buf; 239 return g_strndup( buf, size - 2 ); 246 240 } 247 241 … … 254 248 cmd = irc_parse_line( buf ); 255 249 if( cmd ) 250 { 256 251 ipc_command_exec( data, cmd, ipc_master_commands ); 252 g_free( cmd ); 253 } 254 g_free( buf ); 257 255 } 258 256 else … … 272 270 cmd = irc_parse_line( buf ); 273 271 if( cmd ) 272 { 274 273 ipc_command_exec( data, cmd, ipc_child_commands ); 274 g_free( cmd ); 275 } 276 g_free( buf ); 275 277 } 276 278 else -
lib/misc.c
r2e0f24d r178e2f8 60 60 strcpy(text, text2); 61 61 g_free(text2); 62 }63 64 char *normalize(const char *s)65 {66 static char buf[BUF_LEN];67 char *t, *u;68 int x = 0;69 70 g_return_val_if_fail((s != NULL), NULL);71 72 u = t = g_strdup(s);73 74 strcpy(t, s);75 g_strdown(t);76 77 while (*t && (x < BUF_LEN - 1)) {78 if (*t != ' ') {79 buf[x] = *t;80 x++;81 }82 t++;83 }84 buf[x] = '\0';85 g_free(u);86 return buf;87 62 } 88 63 -
lib/misc.h
r2e0f24d r178e2f8 41 41 G_MODULE_EXPORT char *add_cr( char *text ); 42 42 G_MODULE_EXPORT char *strip_newlines(char *source); 43 G_MODULE_EXPORT char *normalize( const char *s );44 43 45 44 G_MODULE_EXPORT time_t get_time( int year, int month, int day, int hour, int min, int sec ); -
nick.c
r2e0f24d r178e2f8 47 47 48 48 store_handle = clean_handle( handle ); 49 store_nick[MAX_NICK_LENGTH] = 0; 49 50 strncpy( store_nick, nick, MAX_NICK_LENGTH ); 50 51 nick_strip( store_nick ); -
protocols/jabber/jabber.c
r2e0f24d r178e2f8 33 33 #include "jabber.h" 34 34 #include "md5.h" 35 #include "base64.h"36 35 37 36 GSList *jabber_connections; 38 37 38 /* First enty is the default */ 39 static const int jabber_port_list[] = { 40 5222, 41 5223, 42 5220, 43 5221, 44 5224, 45 5225, 46 5226, 47 5227, 48 5228, 49 5229, 50 80, 51 443, 52 0 53 }; 54 39 55 static void jabber_init( account_t *acc ) 40 56 { 41 57 set_t *s; 42 43 s = set_add( &acc->set, "port", JABBER_PORT_DEFAULT, set_eval_int, acc ); 58 char str[16]; 59 60 g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] ); 61 s = set_add( &acc->set, "port", str, set_eval_int, acc ); 44 62 s->flags |= ACC_SET_OFFLINE_ONLY; 45 63 … … 72 90 struct ns_srv_reply *srv = NULL; 73 91 char *connect_to, *s; 92 int i; 74 93 75 94 /* For now this is needed in the _connected() handlers if using … … 177 196 imcb_log( ic, "Connecting" ); 178 197 179 if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN || 180 set_getint( &acc->set, "port" ) > JABBER_PORT_MAX ) 181 { 182 imcb_log( ic, "Incorrect port number, must be in the %d-%d range", 183 JABBER_PORT_MIN, JABBER_PORT_MAX ); 198 for( i = 0; jabber_port_list[i] > 0; i ++ ) 199 if( set_getint( &acc->set, "port" ) == jabber_port_list[i] ) 200 break; 201 202 if( jabber_port_list[i] == 0 ) 203 { 204 imcb_log( ic, "Illegal port number" ); 184 205 imc_logout( ic, FALSE ); 185 206 return; … … 219 240 } 220 241 242 /* This generates an unfinished md5_state_t variable. Every time we generate 243 an ID, we finish the state by adding a sequence number and take the hash. */ 221 244 static void jabber_generate_id_hash( struct jabber_data *jd ) 222 245 { 223 md5_state_t id_hash; 224 md5_byte_t binbuf[16]; 246 md5_byte_t binbuf[4]; 225 247 char *s; 226 248 227 md5_init( & id_hash);228 md5_append( & id_hash, (unsigned char *) jd->username, strlen( jd->username ) );229 md5_append( & id_hash, (unsigned char *) jd->server, strlen( jd->server ) );249 md5_init( &jd->cached_id_prefix ); 250 md5_append( &jd->cached_id_prefix, (unsigned char *) jd->username, strlen( jd->username ) ); 251 md5_append( &jd->cached_id_prefix, (unsigned char *) jd->server, strlen( jd->server ) ); 230 252 s = set_getstr( &jd->ic->acc->set, "resource" ); 231 md5_append( &id_hash, (unsigned char *) s, strlen( s ) ); 232 random_bytes( binbuf, 16 ); 233 md5_append( &id_hash, binbuf, 16 ); 234 md5_finish( &id_hash, binbuf ); 235 236 s = base64_encode( binbuf, 9 ); 237 jd->cached_id_prefix = g_strdup_printf( "%s%s", JABBER_CACHED_ID, s ); 238 g_free( s ); 253 md5_append( &jd->cached_id_prefix, (unsigned char *) s, strlen( s ) ); 254 random_bytes( binbuf, 4 ); 255 md5_append( &jd->cached_id_prefix, binbuf, 4 ); 239 256 } 240 257 … … 267 284 xt_free( jd->xt ); 268 285 269 g_free( jd->cached_id_prefix );270 286 g_free( jd->away_message ); 271 287 g_free( jd->username ); -
protocols/jabber/jabber.h
r2e0f24d r178e2f8 86 86 char *away_message; 87 87 88 char *cached_id_prefix;88 md5_state_t cached_id_prefix; 89 89 GHashTable *node_cache; 90 90 GHashTable *buddies; … … 134 134 135 135 #define JABBER_XMLCONSOLE_HANDLE "xmlconsole" 136 137 #define JABBER_PORT_DEFAULT "5222"138 #define JABBER_PORT_MIN 5220139 #define JABBER_PORT_MAX 5229140 136 141 137 /* Prefixes to use for packet IDs (mainly for IQ packets ATM). Usually the -
protocols/jabber/jabber_util.c
r2e0f24d r178e2f8 23 23 24 24 #include "jabber.h" 25 #include "md5.h" 26 #include "base64.h" 25 27 26 28 static unsigned int next_id = 1; … … 134 136 struct jabber_data *jd = ic->proto_data; 135 137 struct jabber_cache_entry *entry = g_new0( struct jabber_cache_entry, 1 ); 136 char *id; 137 138 id = g_strdup_printf( "%s%05x", jd->cached_id_prefix, ( next_id++ ) & 0xfffff ); 138 md5_state_t id_hash; 139 md5_byte_t id_sum[16]; 140 char *id, *asc_hash; 141 142 next_id ++; 143 144 id_hash = jd->cached_id_prefix; 145 md5_append( &id_hash, (md5_byte_t*) &next_id, sizeof( next_id ) ); 146 md5_finish( &id_hash, id_sum ); 147 asc_hash = base64_encode( id_sum, 12 ); 148 149 id = g_strdup_printf( "%s%s", JABBER_CACHED_ID, asc_hash ); 139 150 xt_add_attr( node, "id", id ); 140 151 g_free( id ); 152 g_free( asc_hash ); 141 153 142 154 entry->node = node; … … 184 196 185 197 if( ( s = xt_find_attr( node, "id" ) ) == NULL || 186 strncmp( s, jd->cached_id_prefix, strlen( jd->cached_id_prefix) ) != 0 )198 strncmp( s, JABBER_CACHED_ID, strlen( JABBER_CACHED_ID ) ) != 0 ) 187 199 { 188 200 /* Silently ignore it, without an ID (or a non-cache … … 196 208 if( entry == NULL ) 197 209 { 210 /* 211 There's no longer an easy way to see if we generated this 212 one or someone else, and there's a ten-minute timeout anyway, 213 so meh. 214 198 215 imcb_log( ic, "Warning: Received %s-%s packet with unknown/expired ID %s!", 199 216 node->name, xt_find_attr( node, "type" ) ? : "(no type)", s ); 217 */ 200 218 } 201 219 else if( entry->func ) … … 290 308 len = strlen( orig ); 291 309 new = g_new( char, len + 1 ); 292 for( i = 0; i < len; i ++ ) 310 311 /* So it turns out the /resource part is case sensitive. Yeah, and 312 it's Unicode but feck Unicode. :-P So stop once we see a slash. */ 313 for( i = 0; i < len && orig[i] != '/' ; i ++ ) 293 314 new[i] = tolower( orig[i] ); 315 for( ; orig[i]; i ++ ) 316 new[i] = orig[i]; 294 317 295 318 new[i] = 0; … … 334 357 { 335 358 /* Check for dupes. */ 336 if( g_strcasecmp( bi->resource, s + 1 ) == 0 )359 if( strcmp( bi->resource, s + 1 ) == 0 ) 337 360 { 338 361 *s = '/'; … … 387 410 if( ( s = strchr( jid, '/' ) ) ) 388 411 { 389 int none_found= 0;412 int bare_exists = 0; 390 413 391 414 *s = 0; … … 410 433 /* See if there's an exact match. */ 411 434 for( ; bud; bud = bud->next ) 412 if( g_strcasecmp( bud->resource, s + 1 ) == 0 )435 if( strcmp( bud->resource, s + 1 ) == 0 ) 413 436 break; 414 437 } 415 438 else 416 439 { 417 /* This hack is there to make sure that O_CREAT will 418 work if there's already another resouce present 419 for this JID, even if it's an unknown buddy. This 420 is done to handle conferences properly. */ 421 none_found = 1; 422 /* TODO(wilmer): Find out what I was thinking when I 423 wrote this??? And then fix it. This makes me sad... */ 424 } 425 426 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && ( imcb_find_buddy( ic, jid ) || !none_found ) ) 440 /* This variable tells the if down here that the bare 441 JID already exists and we should feel free to add 442 more resources, if the caller asked for that. */ 443 bare_exists = 1; 444 } 445 446 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && 447 ( !bare_exists || imcb_find_buddy( ic, jid ) ) ) 427 448 { 428 449 *s = '/'; … … 449 470 /* We want an exact match, so in thise case there shouldn't be a /resource. */ 450 471 return NULL; 451 else if( ( bud->resource == NULL || bud->next == NULL ))472 else if( bud->resource == NULL || bud->next == NULL ) 452 473 /* No need for selection if there's only one option. */ 453 474 return bud; … … 525 546 matches), removing it is simple. (And the hash reference 526 547 should be removed too!) */ 527 if( bud->next == NULL && ( ( s == NULL || bud->resource == NULL ) || g_strcasecmp( bud->resource, s + 1 ) == 0 ) ) 548 if( bud->next == NULL && 549 ( ( s == NULL && bud->resource == NULL ) || 550 ( bud->resource && s && strcmp( bud->resource, s + 1 ) == 0 ) ) ) 528 551 { 529 552 g_hash_table_remove( jd->buddies, bud->bare_jid ); … … 548 571 { 549 572 for( bi = bud, prev = NULL; bi; bi = (prev=bi)->next ) 550 if( g_strcasecmp( bi->resource, s + 1 ) == 0 )573 if( strcmp( bi->resource, s + 1 ) == 0 ) 551 574 break; 552 575 -
protocols/jabber/message.c
r2e0f24d r178e2f8 49 49 { 50 50 GString *fullmsg = g_string_new( "" ); 51 52 for( c = node->children; ( c = xt_find_node( c, "x" ) ); c = c->next ) 53 { 54 char *ns = xt_find_attr( c, "xmlns" ), *room; 55 struct xt_node *inv, *reason; 56 57 if( strcmp( ns, XMLNS_MUC_USER ) == 0 && 58 ( inv = xt_find_node( c->children, "invite" ) ) ) 59 { 60 room = from; 61 from = xt_find_attr( inv, "from" ) ? : from; 62 63 g_string_append_printf( fullmsg, "<< \002BitlBee\002 - Invitation to chatroom %s >>\n", room ); 64 if( ( reason = xt_find_node( inv->children, "reason" ) ) && reason->text_len > 0 ) 65 g_string_append( fullmsg, reason->text ); 66 } 67 } 51 68 52 69 if( ( s = strchr( from, '/' ) ) ) -
protocols/nogaim.h
r2e0f24d r178e2f8 44 44 #include "query.h" 45 45 #include "md5.h" 46 47 #define BUF_LEN MSG_LEN48 #define BUF_LONG ( BUF_LEN * 2 )49 #define MSG_LEN 204850 #define BUF_LEN MSG_LEN51 46 52 47 #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ -
protocols/oscar/oscar.c
r2e0f24d r178e2f8 60 60 61 61 #define OSCAR_GROUP "Friends" 62 63 #define BUF_LEN 2048 64 #define BUF_LONG ( BUF_LEN * 2 ) 62 65 63 66 /* Don't know if support for UTF8 is really working. For now it's UTF16 here. … … 240 243 }; 241 244 static int msgerrreasonlen = 25; 245 246 /* Hurray, this function is NOT thread-safe \o/ */ 247 static char *normalize(const char *s) 248 { 249 static char buf[BUF_LEN]; 250 char *t, *u; 251 int x = 0; 252 253 g_return_val_if_fail((s != NULL), NULL); 254 255 u = t = g_strdup(s); 256 257 strcpy(t, s); 258 g_strdown(t); 259 260 while (*t && (x < BUF_LEN - 1)) { 261 if (*t != ' ' && *t != '!') { 262 buf[x] = *t; 263 x++; 264 } 265 t++; 266 } 267 buf[x] = '\0'; 268 g_free(u); 269 return buf; 270 } 242 271 243 272 static gboolean oscar_callback(gpointer data, gint source, … … 1002 1031 } 1003 1032 1004 tmp = g_strdup(normalize(ic->acc->user)); 1005 if (!strcmp(tmp, normalize(info->sn))) 1033 if (!aim_sncmp(ic->acc->user, info->sn)) 1006 1034 g_snprintf(ic->displayname, sizeof(ic->displayname), "%s", info->sn); 1007 g_free(tmp); 1008 1009 imcb_buddy_status(ic, info->sn, flags, state_string, NULL); 1010 /* imcb_buddy_times(ic, info->sn, signon, time_idle); */ 1035 1036 tmp = normalize(info->sn); 1037 imcb_buddy_status(ic, tmp, flags, state_string, NULL); 1038 /* imcb_buddy_times(ic, tmp, signon, time_idle); */ 1039 1011 1040 1012 1041 return 1; … … 1022 1051 va_end(ap); 1023 1052 1024 imcb_buddy_status(ic, info->sn, 0, NULL, NULL );1053 imcb_buddy_status(ic, normalize(info->sn), 0, NULL, NULL ); 1025 1054 1026 1055 return 1; … … 1078 1107 1079 1108 strip_linefeed(tmp); 1080 imcb_buddy_msg(ic, userinfo->sn, tmp, flags, 0);1109 imcb_buddy_msg(ic, normalize(userinfo->sn), tmp, flags, 0); 1081 1110 g_free(tmp); 1082 1111 … … 1177 1206 message = g_strdup(args->msg); 1178 1207 strip_linefeed(message); 1179 imcb_buddy_msg(ic, uin, message, 0, 0);1208 imcb_buddy_msg(ic, normalize(uin), message, 0, 0); 1180 1209 g_free(uin); 1181 1210 g_free(message); … … 1196 1225 1197 1226 strip_linefeed(message); 1198 imcb_buddy_msg(ic, uin, message, 0, 0);1227 imcb_buddy_msg(ic, normalize(uin), message, 0, 0); 1199 1228 g_free(uin); 1200 1229 g_free(m); … … 1471 1500 1472 1501 for (i = 0; i < count; i++) 1473 imcb_chat_add_buddy(c->cnv, info[i].sn);1502 imcb_chat_add_buddy(c->cnv, normalize(info[i].sn)); 1474 1503 1475 1504 return 1; … … 1494 1523 1495 1524 for (i = 0; i < count; i++) 1496 imcb_chat_remove_buddy(c->cnv, info[i].sn, NULL);1525 imcb_chat_remove_buddy(c->cnv, normalize(info[i].sn), NULL); 1497 1526 1498 1527 return 1; … … 1545 1574 tmp = g_malloc(BUF_LONG); 1546 1575 g_snprintf(tmp, BUF_LONG, "%s", msg); 1547 imcb_chat_msg(ccon->cnv, info->sn, tmp, 0, 0);1576 imcb_chat_msg(ccon->cnv, normalize(info->sn), tmp, 0, 0); 1548 1577 g_free(tmp); 1549 1578 … … 1758 1787 g_snprintf(sender, sizeof(sender), "%u", msg->sender); 1759 1788 strip_linefeed(dialog_msg); 1760 imcb_buddy_msg(ic, sender, dialog_msg, 0, t);1789 imcb_buddy_msg(ic, normalize(sender), dialog_msg, 0, t); 1761 1790 g_free(dialog_msg); 1762 1791 } break; … … 1779 1808 1780 1809 strip_linefeed(dialog_msg); 1781 imcb_buddy_msg(ic, sender, dialog_msg, 0, t);1810 imcb_buddy_msg(ic, normalize(sender), dialog_msg, 0, t); 1782 1811 g_free(dialog_msg); 1783 1812 g_free(m); … … 2017 2046 struct aim_ssi_item *curitem; 2018 2047 int tmp; 2048 char *nrm; 2019 2049 2020 2050 /* Add from server list to local list */ 2021 2051 tmp = 0; 2022 2052 for (curitem=sess->ssi.items; curitem; curitem=curitem->next) { 2053 nrm = curitem->name ? normalize(curitem->name) : NULL; 2054 2023 2055 switch (curitem->type) { 2024 2056 case 0x0000: /* Buddy */ 2025 if ((curitem->name) && (!imcb_find_buddy(ic, curitem->name))) {2057 if ((curitem->name) && (!imcb_find_buddy(ic, nrm))) { 2026 2058 char *realname = NULL; 2027 2059 … … 2029 2061 realname = aim_gettlv_str(curitem->data, 0x0131, 1); 2030 2062 2031 imcb_add_buddy(ic, curitem->name, NULL);2063 imcb_add_buddy(ic, nrm, NULL); 2032 2064 2033 2065 if (realname) { 2034 imcb_buddy_nick_hint(ic, curitem->name, realname);2035 imcb_rename_buddy(ic, curitem->name, realname);2066 imcb_buddy_nick_hint(ic, nrm, realname); 2067 imcb_rename_buddy(ic, nrm, realname); 2036 2068 g_free(realname); 2037 2069 } … … 2045 2077 if (!list) { 2046 2078 char *name; 2047 name = g_strdup(n ormalize(curitem->name));2079 name = g_strdup(nrm); 2048 2080 ic->permit = g_slist_append(ic->permit, name); 2049 2081 tmp++; … … 2058 2090 if (!list) { 2059 2091 char *name; 2060 name = g_strdup(n ormalize(curitem->name));2092 name = g_strdup(nrm); 2061 2093 ic->deny = g_slist_append(ic->deny, name); 2062 2094 tmp++; … … 2120 2152 if( st == 0x00 ) 2121 2153 { 2122 imcb_add_buddy( sess->aux_data, list, NULL );2154 imcb_add_buddy( sess->aux_data, normalize(list), NULL ); 2123 2155 } 2124 2156 else if( st == 0x0E ) … … 2450 2482 if(type2 == 0x0002) { 2451 2483 /* User is typing */ 2452 imcb_buddy_typing(ic, sn, OPT_TYPING);2484 imcb_buddy_typing(ic, normalize(sn), OPT_TYPING); 2453 2485 } 2454 2486 else if (type2 == 0x0001) { 2455 2487 /* User has typed something, but is not actively typing (stale) */ 2456 imcb_buddy_typing(ic, sn, OPT_THINKING);2488 imcb_buddy_typing(ic, normalize(sn), OPT_THINKING); 2457 2489 } 2458 2490 else { 2459 2491 /* User has stopped typing */ 2460 imcb_buddy_typing(ic, sn, 0);2492 imcb_buddy_typing(ic, normalize(sn), 0); 2461 2493 } 2462 2494 -
protocols/yahoo/libyahoo2.c
r2e0f24d r178e2f8 379 379 380 380 /* call repeatedly to get the next one */ 381 /*382 381 static struct yahoo_input_data * find_input_by_id(int id) 383 382 { … … 390 389 return NULL; 391 390 } 392 */393 391 394 392 static struct yahoo_input_data * find_input_by_id_and_webcam_user(int id, const char * who) … … 795 793 { 796 794 struct yahoo_data *yd = find_conn_by_id(id); 795 797 796 if(!yd) 798 797 return; … … 3164 3163 3165 3164 LOG(("write callback: id=%d fd=%d data=%p", id, fd, data)); 3166 if(!yid || !yid->txqueues )3165 if(!yid || !yid->txqueues || !find_conn_by_id(id)) 3167 3166 return -2; 3168 3167 … … 3840 3839 } 3841 3840 3842 3843 /* do { 3841 do { 3844 3842 yahoo_input_close(yid); 3845 } while((yid = find_input_by_id(id)));*/ 3846 3843 } while((yid = find_input_by_id(id))); 3847 3844 } 3848 3845 -
protocols/yahoo/yahoo.c
r2e0f24d r178e2f8 163 163 g_slist_free( yd->buddygroups ); 164 164 165 if( yd->logged_in ) 166 yahoo_logoff( yd->y2_id ); 167 else 168 yahoo_close( yd->y2_id ); 165 yahoo_logoff( yd->y2_id ); 169 166 170 167 g_free( yd ); … … 454 451 struct byahoo_write_ready_data *d = data; 455 452 456 if( !byahoo_get_ic_by_id( d->id ) )457 /* WTF doesn't libyahoo clean this up? */458 return FALSE;459 460 453 yahoo_write_ready( d->id, d->fd, d->data ); 461 454 -
storage_xml.c
r2e0f24d r178e2f8 481 481 static storage_status_t xml_remove( const char *nick, const char *password ) 482 482 { 483 char s[512] ;483 char s[512], *lc; 484 484 storage_status_t status; 485 485 … … 488 488 return status; 489 489 490 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, nick, ".xml" ); 490 lc = g_strdup( nick ); 491 nick_lc( lc ); 492 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, lc, ".xml" ); 493 g_free( lc ); 494 491 495 if( unlink( s ) == -1 ) 492 496 return STORAGE_OTHER_ERROR; -
tests/Makefile
r2e0f24d r178e2f8 13 13 main_objs = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_xml.o storage_text.o user.o 14 14 15 test_objs = check.o check_util.o check_nick.o check_md5.o check_arc.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o check_jabber_sasl.o 15 test_objs = check.o check_util.o check_nick.o check_md5.o check_arc.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o check_jabber_sasl.o check_jabber_util.o 16 16 17 17 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o -
tests/check.c
r2e0f24d r178e2f8 69 69 Suite *jabber_sasl_suite(void); 70 70 71 /* From check_jabber_sasl.c */ 72 Suite *jabber_util_suite(void); 73 71 74 int main (int argc, char **argv) 72 75 { … … 115 118 srunner_add_suite(sr, set_suite()); 116 119 srunner_add_suite(sr, jabber_sasl_suite()); 120 srunner_add_suite(sr, jabber_util_suite()); 117 121 if (no_fork) 118 122 srunner_set_fork_status(sr, CK_NOFORK); -
tests/check_jabber_sasl.c
r2e0f24d r178e2f8 5 5 #include <string.h> 6 6 #include <stdio.h> 7 #include "arc.h"8 7 9 8 char *sasl_get_part( char *data, char *field );
Note: See TracChangeset
for help on using the changeset viewer.