Changes in / [c5bc47b:0c41177]
- Files:
-
- 2 deleted
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rc5bc47b r0c41177 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o c hat.o crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o12 objects = account.o bitlbee.o crypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) user.o 13 13 headers = account.h bitlbee.h commands.h conf.h config.h crypting.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/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/nogaim.h 14 14 subdirs = lib protocols -
account.c
rc5bc47b r0c41177 190 190 { 191 191 account_t *a, *l = NULL; 192 struct chat *c, *nc;193 192 194 193 if( acc->ic ) … … 203 202 else 204 203 irc->accounts = a->next; 205 206 for( c = irc->chatrooms; c; c = nc )207 {208 nc = c->next;209 if( acc == c->acc )210 chat_del( irc, c );211 }212 204 213 205 while( a->set ) -
bitlbee.h
rc5bc47b r0c41177 33 33 34 34 #define PACKAGE "BitlBee" 35 #define BITLBEE_VERSION "1.2. 4"35 #define BITLBEE_VERSION "1.2.3" 36 36 #define VERSION BITLBEE_VERSION 37 37 … … 129 129 #include "account.h" 130 130 #include "nick.h" 131 #include "chat.h"132 131 #include "conf.h" 133 132 #include "log.h" -
conf.c
rc5bc47b r0c41177 308 308 else 309 309 { 310 fprintf( stderr, "Error: Unknown setting `%s` in configuration file (line %d).\n", ini->key, ini->line);310 fprintf( stderr, "Error: Unknown setting `%s` in configuration file.\n", ini->key ); 311 311 return 0; 312 312 /* For now just ignore unknown keys... */ … … 315 315 else if( g_strcasecmp( ini->section, "defaults" ) != 0 ) 316 316 { 317 fprintf( stderr, "Error: Unknown section [%s] in configuration file (line %d). "318 "BitlBee configuration must be put in a [settings] section!\n", ini->section , ini->line);317 fprintf( stderr, "Error: Unknown section [%s] in configuration file. " 318 "BitlBee configuration must be put in a [settings] section!\n", ini->section ); 319 319 return 0; 320 320 } -
doc/CHANGES
rc5bc47b r0c41177 3 3 4 4 http://bugs.bitlbee.org/bitlbee/timeline?daysback=90&changeset=on 5 6 Version 1.2.4:7 - Most important change (and main reason for releasing now): Upgraded Yahoo!8 module to a newer version to get it working again.9 - join_chat command replaced with the much better chat command:10 * Similar to how account replaced login/slist/logout. Add a chatroom once,11 then just /join it like any other room. Also automatic joining at login12 time is now possible.13 * Note that the old way of starting groupchats (/join #nickname) is now14 also deprecated, use "chat with" instead.15 * See "help chat" and "help chat add" for more information.16 - Rewrote bitlbee.conf parser to be less dumb.17 - Fixed compatibility (hopefully) with AIM mobile messages, certain kinds18 of Google Talk chatrooms.19 - Fixed numerous stability/reliability bugs over the last year.20 21 Finished 17 Oct 200922 5 23 6 Version 1.2.3: -
doc/user-guide/commands.xml
rc5bc47b r0c41177 125 125 <description> 126 126 <para> 127 This command gives you a list of all the accounts known by BitlBee .127 This command gives you a list of all the accounts known by BitlBee, including the numbers you'll need for most account commands. 128 128 </para> 129 129 </description> … … 138 138 <description> 139 139 <para> 140 This commandcan be used to change various settings for IM accounts. For all protocols, this command can be used to change the handle or the password BitlBee uses to log in and if it should be logged in automatically. Some protocols have additional settings. You can see the settings available for a connection by typing <emphasis>account set <account id></emphasis>.140 This account can be used to change various settings for IM accounts. For all protocols, this command can be used to change the handle or the password BitlBee uses to log in and if it should be logged in automatically. Some protocols have additional settings. You can see the settings available for a connection by typing <emphasis>account set <account id></emphasis>. 141 141 </para> 142 142 143 143 <para> 144 For more infomation about a setting, see <emphasis>help set <setting></emphasis>. 144 For more infomation about a setting, see <emphasis>help set <setting></emphasis>. For details about the syntax of this command, see <emphasis>help set</emphasis>. 145 145 </para> 146 146 147 147 <para> 148 148 The account ID can be a number (see <emphasis>account list</emphasis>), the protocol name or (part of) the screenname, as long as it matches only one connection. 149 </para>150 </description>151 </bitlbee-command>152 </bitlbee-command>153 154 <bitlbee-command name="chat">155 <short-description>Chatroom list maintenance</short-description>156 <syntax>chat <action> [<arguments>]</syntax>157 158 <description>159 160 <para>161 Available actions: add, del, list, with and set. See <emphasis>help chat <action></emphasis> for more information.162 </para>163 164 </description>165 166 <bitlbee-command name="add">167 <syntax>chat add <account> <room> [<channel>]</syntax>168 169 <description>170 <para>171 Add a chatroom to the list of chatrooms you're interested in. BitlBee needs this list to map room names to a proper IRC channel name.172 </para>173 174 <para>175 After adding a room to your list, you can simply use the IRC /join command to enter the room. Also, you can tell BitlBee to automatically join the room when you log in. (See <emphasis>chat set</emphasis>)176 </para>177 178 <para>179 Password-protected rooms work exactly like on IRC, by passing the password as an extra argument to /join.180 </para>181 </description>182 183 </bitlbee-command>184 185 <bitlbee-command name="del">186 <syntax>chat del <chat id></syntax>187 188 <description>189 <para>190 This commands deletes an chatroom from your list.191 </para>192 193 <para>194 The room ID can be a number (see <emphasis>chat list</emphasis>), or (part of) the name of the room/channel.195 </para>196 </description>197 </bitlbee-command>198 199 <bitlbee-command name="list">200 <syntax>chat list</syntax>201 202 <description>203 <para>204 This command gives you a list of all the chatrooms known by BitlBee.205 </para>206 </description>207 </bitlbee-command>208 209 <bitlbee-command name="with">210 <syntax>chat with <nickname></syntax>211 212 <description>213 <para>214 While most <emphasis>chat</emphasis> subcommands are about named chatrooms, this command can be used to open an unnamed groupchat with one or more persons. This command is what <emphasis>/join #nickname</emphasis> used to do in older BitlBee versions.215 </para>216 </description>217 </bitlbee-command>218 219 <bitlbee-command name="set">220 <syntax>chat set <chat id></syntax>221 <syntax>chat set <chat id>/<setting></syntax>222 <syntax>chat set <chat id>/<setting> <value></syntax>223 <syntax>chat set -del <chat id>/<setting></syntax>224 225 <description>226 <para>227 This command can be used to change various settings for chatrooms.228 </para>229 230 <para>231 For more infomation about a setting, see <emphasis>help set <setting></emphasis>.232 </para>233 234 <para>235 The room ID can be a number (see <emphasis>chat list</emphasis>), or (part of) the name of the room/channel.236 149 </para> 237 150 </description> … … 390 303 </bitlbee-setting> 391 304 392 <bitlbee-setting name="auto_join" type="boolean" scope="chat">393 <default>false</default>394 395 <description>396 <para>397 With this option enabled, BitlBee will automatically join this chatroom when you log in.398 </para>399 </description>400 </bitlbee-setting>401 402 305 <bitlbee-setting name="auto_reconnect" type="boolean" scope="both"> 403 306 <default>false</default> … … 583 486 </bitlbee-setting> 584 487 585 <bitlbee-setting name="nick" type="string" scope="chat">586 587 <description>588 <para>589 You can use this option to set your nickname in a chatroom. You won't see this nickname yourself, but other people in the room will. By default, BitlBee will use your username as the chatroom nickname.590 </para>591 </description>592 </bitlbee-setting>593 594 488 <bitlbee-setting name="ops" type="string" scope="global"> 595 489 <default>both</default> … … 686 580 <bitlbee-setting name="resource_select" type="string" scope="account"> 687 581 <default>priority</default> 688 <possible-values>priority, activity</possible-values>582 <possible-values>priority, time</possible-values> 689 583 690 584 <description> … … 694 588 695 589 <para> 696 Normally it's set to <emphasis>priority</emphasis> which means messages will always be delivered to the buddy's resource with the highest priority. If the setting is set to <emphasis> activity</emphasis>, messages will be delivered to the resource that was last used to send you a message (or the resource that most recently connected).590 Normally it's set to <emphasis>priority</emphasis> which means messages will always be delivered to the buddy's resource with the highest priority. If the setting is set to <emphasis>time</emphasis>, messages will be delivered to the resource that was last used to send you a message (or the resource that most recently connected). 697 591 </para> 698 592 </description> … … 960 854 961 855 </bitlbee-command> 856 857 <bitlbee-command name="join_chat"> 858 <short-description>Join a named groupchat/conference room</short-description> 859 <syntax>join_chat <connection> <room name> [<channel name>] [<room nickname>] [<password>]</syntax> 860 861 <description> 862 <para> 863 On most IM-networks groupchats can be started using the /join command. (<emphasis>/join #foo</emphasis> to start a chatroom with you and <emphasis>foo</emphasis>) This doesn't work with names groupchats though (which exist on Jabber networks and AIM, for example), instead you can use this command. 864 </para> 865 866 <para> 867 The first two arguments are required. <emphasis>room name</emphasis> is the name of the chatroom on the IM-network. <emphasis>channel name</emphasis> is the IRC channel name BitlBee should map this to. <emphasis>room nickname</emphasis> is the nickname you want to have in this channel. If you don't give these options, BitlBee will do the right guesses. 868 </para> 869 870 <para> 871 The following command will join you to the chatroom called <emphasis>bitlbee@conference.bitlbee.org</emphasis>. The channel will be called <emphasis>&bitlbee-help</emphasis> because <emphasis>&bitlbee</emphasis> will already be in use. Your nickname will be <emphasis>help-me</emphasis>. 872 </para> 873 </description> 874 875 <ircexample> 876 <ircline nick="wilmer">join_chat jabber bitlbee@conference.bitlbee.org &bitlbee-help help-me</ircline> 877 </ircexample> 878 879 </bitlbee-command> 962 880 </chapter> -
doc/user-guide/misc.xml
rc5bc47b r0c41177 69 69 70 70 <para> 71 To open a groupchat, use the <emphasis>chat with</emphasis> command. For example, to start a groupchat with the person <emphasis>lisa_msn</emphasis> in it, just type <emphasis>chat with lisa_msn</emphasis>. BitlBeewill create a new virtual channel with root, you and lisa_msn in it.71 If you want to start a groupchat with the person <emphasis>lisa_msn</emphasis> in it, just join the channel <emphasis>#lisa_msn</emphasis>. BitlBee will refuse to join you to the channel with that name, but it will create a new virtual channel with root, you and lisa_msn in it. 72 72 </para> 73 73 74 74 <para> 75 Then, just use the ordinary IRC <emphasis>/invite</emphasis> command to invite more people. Please do keep in mind that all the people have to be on the same network and contact list! You can't invite Yahoo! buddies into an MSN groupchat.75 Of course a channel with only two people isn't really exciting yet. So the next step is to invite some other people to the channel. For this, you can use the <emphasis>/invite</emphasis> command of your IRC client. Please do keep in mind that all the people have to be on the same network and contact list! You can't invite Yahoo! buddies into an MSN groupchat. 76 76 </para> 77 77 78 78 <para> 79 Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <emphasis> chat add</emphasis> command to join them. See <emphasis>help chat_add</emphasis> for more information.79 Some protocols (like Jabber) also support named groupchats. BitlBee now supports these too. You can use the <emphasis>join_chat</emphasis> command to join them. See <emphasis>help join_chat</emphasis> for more information. 80 80 </para> 81 81 -
irc.c
rc5bc47b r0c41177 407 407 } 408 408 409 if( lines[i] && ( cmd = irc_parse_line( lines[i] ) ) ) 410 { 409 if( lines[i] ) 410 { 411 if( ( cmd = irc_parse_line( lines[i] ) ) == NULL ) 412 continue; 411 413 irc_exec( irc, cmd ); 412 414 g_free( cmd ); … … 483 485 if( line[0] == ':' ) 484 486 { 485 for( i = 0; line[i] && line[i]!= ' '; i ++ );487 for( i = 0; line[i] != ' '; i ++ ); 486 488 line = line + i; 487 489 } … … 779 781 irc_reply( irc, 3, ":%s", IRCD_INFO ); 780 782 irc_reply( irc, 4, "%s %s %s %s", irc->myhost, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES ); 781 irc_reply( irc, 5, "PREFIX=(ov)@+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee " 782 "CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", 783 CTYPES, CMODES, MAX_NICK_LENGTH - 1 ); 783 irc_reply( irc, 5, "PREFIX=(ov)@+ CHANTYPES=#& CHANMODES=,,,%s NICKLEN=%d NETWORK=BitlBee CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 :are supported by this server", CMODES, MAX_NICK_LENGTH - 1 ); 784 784 irc_motd( irc ); 785 785 irc->umode[0] = '\0'; … … 1022 1022 user_t *u = NULL; 1023 1023 1024 if( strchr( CTYPES, *nick ))1024 if( *nick == '#' || *nick == '&' ) 1025 1025 { 1026 1026 if( !( c = irc_chat_by_channel( irc, nick ) ) ) -
irc.h
rc5bc47b r0c41177 38 38 #define CMODE "t" 39 39 #define UMODE "s" 40 #define CTYPES "&#"41 40 42 41 typedef enum … … 48 47 USTATUS_SHUTDOWN = 8 49 48 } irc_status_t; 49 50 typedef struct channel 51 { 52 char *name; 53 } channel_t; 50 54 51 55 typedef struct irc … … 83 87 struct query *queries; 84 88 struct account *accounts; 85 struct chat *chatrooms;86 89 87 90 struct __USER *users; … … 97 100 98 101 #include "user.h" 102 // #include "nick.h" 99 103 100 104 extern GSList *irc_connection_list; -
irc_commands.c
rc5bc47b r0c41177 125 125 static void irc_cmd_mode( irc_t *irc, char **cmd ) 126 126 { 127 if( strchr( CTYPES, *cmd[1] ))127 if( *cmd[1] == '#' || *cmd[1] == '&' ) 128 128 { 129 129 if( cmd[2] ) … … 193 193 else if( cmd[1] ) 194 194 { 195 struct chat *c; 196 197 if( strchr( CTYPES, cmd[1][0] ) == NULL || cmd[1][1] == 0 ) 198 irc_reply( irc, 479, "%s :Invalid channel name", cmd[1] ); 199 else if( ( c = chat_bychannel( irc, cmd[1] ) ) && c->acc && c->acc->ic ) 200 chat_join( irc, c, cmd[2] ); 195 if( ( cmd[1][0] == '#' || cmd[1][0] == '&' ) && cmd[1][1] ) 196 { 197 user_t *u = user_find( irc, cmd[1] + 1 ); 198 199 if( u && u->ic && u->ic->acc->prpl->chat_with ) 200 { 201 irc_reply( irc, 403, "%s :Initializing groupchat in a different channel", cmd[1] ); 202 203 if( !u->ic->acc->prpl->chat_with( u->ic, u->handle ) ) 204 { 205 irc_usermsg( irc, "Could not open a groupchat with %s.", u->nick ); 206 } 207 } 208 else if( u ) 209 { 210 irc_reply( irc, 403, "%s :Groupchats are not possible with %s", cmd[1], cmd[1]+1 ); 211 } 212 else 213 { 214 irc_reply( irc, 403, "%s :No such nick", cmd[1] ); 215 } 216 } 201 217 else 218 { 202 219 irc_reply( irc, 403, "%s :No such channel", cmd[1] ); 220 } 203 221 } 204 222 } … … 415 433 if( g_hash_table_lookup_extended( irc->watches, nick, &okey, &ovalue ) ) 416 434 { 435 g_free( okey ); 417 436 g_hash_table_remove( irc->watches, okey ); 418 g_free( okey );419 437 420 438 irc_reply( irc, 602, "%s %s %s %d :%s", nick, "*", "*", 0, "Stopped watching" ); -
lib/events_libevent.c
rc5bc47b r0c41177 37 37 38 38 static void b_main_restart(); 39 static guint id_next = 1; /* Next ID to be allocated to an event handler. */ 40 static guint id_cur = 0; /* Event ID that we're currently handling. */ 41 static guint id_dead; /* Set to 1 if b_event_remove removes id_cur. */ 39 static guint id_next = 1; 42 40 static GHashTable *id_hash; 43 static int quitting = 0; /* Prepare to quit, stop handling events. */41 static int quitting = 0; 44 42 45 43 /* Since libevent doesn't handle two event handlers for one fd-condition … … 121 119 struct b_event_data *b_ev = data; 122 120 b_input_condition cond = 0; 123 gboolean st;121 int id; 124 122 125 123 if( fd >= 0 ) … … 135 133 /* Since the called function might cancel this handler already 136 134 (which free()s b_ev), we have to remember the ID here. */ 137 id_cur = b_ev->id; 138 id_dead = 0; 135 id = b_ev->id; 139 136 140 137 if( quitting ) 141 138 { 142 b_event_remove( id _cur);139 b_event_remove( id ); 143 140 return; 144 141 } 145 142 146 st = b_ev->function( b_ev->data, fd, cond ); 147 if( id_dead ) 148 { 149 /* This event was killed already, don't touch it! */ 150 return; 151 } 152 else if( !st ) 143 if( !b_ev->function( b_ev->data, fd, cond ) ) 153 144 { 154 145 event_debug( "Handler returned FALSE: " ); 155 b_event_remove( id _cur);146 b_event_remove( id ); 156 147 } 157 148 else if( fd == -1 ) 158 149 { 159 /* fd == -1 means it was a timer. These can't be auto-repeated160 so it has to be recreated every time. */161 150 struct timeval tv; 162 151 … … 247 236 if( b_ev ) 248 237 { 249 if( id == id_cur )250 id_dead = TRUE;251 252 238 g_hash_table_remove( id_hash, &b_ev->id ); 253 239 if( b_ev->evinfo.ev_fd >= 0 ) -
lib/http_client.c
rc5bc47b r0c41177 59 59 if( error ) 60 60 { 61 http_free( req );62 return NULL;61 g_free( req ); 62 return( NULL ); 63 63 } 64 64 … … 160 160 161 161 req->func( req ); 162 http_free( req ); 162 163 g_free( req->request ); 164 g_free( req ); 165 163 166 return FALSE; 164 167 } … … 441 444 442 445 req->func( req ); 443 http_free( req ); 444 return FALSE; 445 } 446 447 void http_free( struct http_request *req ) 448 { 446 449 447 g_free( req->request ); 450 448 g_free( req->reply_headers ); 451 449 g_free( req->status_string ); 452 450 g_free( req ); 451 452 return FALSE; 453 453 } 454 -
lib/http_client.h
rc5bc47b r0c41177 81 81 void *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data ); 82 82 void *http_dorequest_url( char *url_string, http_input_function func, gpointer data ); 83 84 void http_free( struct http_request *req ); -
lib/ini.c
rc5bc47b r0c41177 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-200 8Wilmer van der Gaast and others *4 * Copyright 2002-2005 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 28 28 ini_t *ini_open( char *file ) 29 29 { 30 int fd; 31 ini_t *ini = NULL; 32 struct stat fi; 30 ini_t *ini = g_new0( ini_t, 1 ); 33 31 34 if( ( fd = open( file, O_RDONLY ) ) != -1 && 35 fstat( fd, &fi ) == 0 && 36 fi.st_size <= 16384 && 37 ( ini = g_malloc( sizeof( ini_t ) + fi.st_size + 1 ) ) && 38 read( fd, ini->file, fi.st_size ) == fi.st_size ) 32 if( ( ini->fp = fopen( file, "r" ) ) == NULL ) 39 33 { 40 memset( ini, 0, sizeof( ini_t ) ); 41 ini->size = fi.st_size; 42 ini->file[ini->size] = 0; 43 ini->cur = ini->file; 44 ini->c_section = ""; 45 46 close( fd ); 47 48 return ini; 34 g_free( ini ); 35 return( NULL ); 49 36 } 50 51 if( fd >= 0 )52 close( fd );53 37 54 ini_close( ini ); 55 56 return NULL; 57 } 58 59 /* Strips leading and trailing whitespace and returns a pointer to the first 60 non-ws character of the given string. */ 61 static char *ini_strip_whitespace( char *in ) 62 { 63 char *e; 64 65 while( isspace( *in ) ) 66 in++; 67 68 e = in + strlen( in ) - 1; 69 while( e > in && isspace( *e ) ) 70 e--; 71 e[1] = 0; 72 73 return in; 38 return( ini ); 74 39 } 75 40 76 41 int ini_read( ini_t *file ) 77 42 { 78 char *s; 43 char key[MAX_STRING], s[MAX_STRING], *t; 44 int i; 79 45 80 while( file->cur && file->cur < file->file + file->size)46 while( !feof( file->fp ) ) 81 47 { 82 char *e, *next;83 84 f ile->line++;85 86 /* Find the end of line */87 if( ( e = strchr( file->cur, '\n' ) ) != NULL)48 *s = 0; 49 fscanf( file->fp, "%127[^\n#]s", s ); 50 fscanf( file->fp, "%*[^\n]s" ); 51 fgetc( file->fp ); /* Skip newline */ 52 file->line ++; 53 if( strchr( s, '=' ) ) 88 54 { 89 *e = 0; 90 next = e + 1; 91 } 92 else 93 { 94 /* No more lines. */ 95 e = file->cur + strlen( file->cur ); 96 next = NULL; 97 } 98 99 /* Comment? */ 100 if( ( s = strchr( file->cur, '#' ) ) != NULL ) 101 *s = 0; 102 103 file->cur = ini_strip_whitespace( file->cur ); 104 105 if( *file->cur == '[' ) 106 { 107 file->cur++; 108 if( ( s = strchr( file->cur, ']' ) ) != NULL ) 55 sscanf( s, "%[^ =]s", key ); 56 if( ( t = strchr( key, '.' ) ) ) 109 57 { 110 *s = 0; 111 file->c_section = file->cur; 112 } 113 } 114 else if( ( s = strchr( file->cur, '=' ) ) != NULL ) 115 { 116 *s = 0; 117 file->key = ini_strip_whitespace( file->cur ); 118 file->value = ini_strip_whitespace( s + 1 ); 119 120 if( ( s = strchr( file->key, '.' ) ) != NULL ) 121 { 122 *s = 0; 123 file->section = file->key; 124 file->key = s + 1; 58 *t = 0; 59 strcpy( file->section, key ); 60 t ++; 125 61 } 126 62 else 127 63 { 128 file->section = file->c_section; 64 strcpy( file->section, file->c_section ); 65 t = key; 129 66 } 67 sscanf( t, "%s", file->key ); 68 t = strchr( s, '=' ) + 1; 69 for( i = 0; t[i] == ' '; i ++ ); 70 strcpy( file->value, &t[i] ); 71 for( i = strlen( file->value ) - 1; file->value[i] == 32; i -- ) 72 file->value[i] = 0; 130 73 131 file->cur = next; 132 return 1; 74 return( 1 ); 133 75 } 134 /* else: noise/comment/etc, let's just ignore it. */ 135 136 file->cur = next; 76 else if( ( t = strchr( s, '[' ) ) ) 77 { 78 strcpy( file->c_section, t + 1 ); 79 t = strchr( file->c_section, ']' ); 80 *t = 0; 81 } 137 82 } 138 139 return 0; 83 return( 0 ); 140 84 } 141 85 142 86 void ini_close( ini_t *file ) 143 87 { 88 fclose( file->fp ); 144 89 g_free( file ); 145 90 } -
lib/ini.h
rc5bc47b r0c41177 29 29 typedef struct 30 30 { 31 FILE *fp; 31 32 int line; 32 char *c_section; 33 char *section; 34 char *key; 35 char *value; 36 int size; 37 char *cur, *tok; 38 char file[]; 33 char c_section[MAX_STRING]; 34 char section[MAX_STRING]; 35 char key[MAX_STRING]; 36 char value[MAX_STRING]; 39 37 } ini_t; 40 38 -
lib/proxy.c
rc5bc47b r0c41177 558 558 return proxy_connect_socks5(host, port, phb); 559 559 560 if (phb->host) g_free(phb); 560 561 g_free(phb); 561 562 return -1; -
lib/xmltree.c
rc5bc47b r0c41177 472 472 } 473 473 474 struct xt_node *xt_new_node( char *name, c onst char *text, struct xt_node *children )474 struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children ) 475 475 { 476 476 struct xt_node *node, *c; -
lib/xmltree.h
rc5bc47b r0c41177 90 90 char *xt_find_attr( struct xt_node *node, const char *key ); 91 91 92 struct xt_node *xt_new_node( char *name, c onst char *text, struct xt_node *children );92 struct xt_node *xt_new_node( char *name, char *text, struct xt_node *children ); 93 93 void xt_add_child( struct xt_node *parent, struct xt_node *child ); 94 94 void xt_add_attr( struct xt_node *node, const char *key, const char *value ); -
protocols/jabber/conference.c
rc5bc47b r0c41177 26 26 static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig ); 27 27 28 struct groupchat *jabber_chat_join( struct im_connection *ic, c onst char *room, const char *nick, constchar *password )28 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password ) 29 29 { 30 30 struct jabber_chat *jc; … … 36 36 node = xt_new_node( "x", NULL, NULL ); 37 37 xt_add_attr( node, "xmlns", XMLNS_MUC ); 38 node = jabber_make_packet( "presence", NULL, roomjid, node ); 38 39 if( password ) 39 40 xt_add_child( node, xt_new_node( "password", password, NULL ) ); 40 node = jabber_make_packet( "presence", NULL, roomjid, node );41 41 jabber_cache_add( ic, node, jabber_chat_join_failed ); 42 42 … … 234 234 ( strcmp( s, XMLNS_MUC_USER ) == 0 ) ) 235 235 { 236 struct xt_node *item; 237 238 item = xt_find_node( c->children, "item" ); 239 if( ( s = xt_find_attr( item, "jid" ) ) ) 236 c = xt_find_node( c->children, "item" ); 237 if( ( s = xt_find_attr( c, "jid" ) ) ) 240 238 { 241 239 /* Yay, found what we need. :-) */ … … 285 283 else if( type ) /* type can only be NULL or "unavailable" in this function */ 286 284 { 287 if( ( bud->flags & JBFLAG_IS_CHATROOM ) && bud->ext_jid ) 288 { 289 s = strchr( bud->ext_jid, '/' ); 290 if( s ) *s = 0; 291 imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); 292 if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS ) 293 imcb_remove_buddy( ic, bud->ext_jid, NULL ); 294 if( s ) *s = '/'; 295 } 285 s = strchr( bud->ext_jid, '/' ); 286 if( s ) *s = 0; 287 imcb_chat_remove_buddy( chat, bud->ext_jid, NULL ); 288 if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS ) 289 imcb_remove_buddy( ic, bud->ext_jid, NULL ); 290 if( s ) *s = '/'; 296 291 297 292 if( bud == jc->me ) -
protocols/jabber/iq.c
rc5bc47b r0c41177 51 51 { 52 52 if( !( ( c = xt_find_node( node->children, "query" ) ) || 53 ( c = xt_find_node( node->children, "ping" ) ) ) || 53 ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just <query/> ????? */ 54 54 !( s = xt_find_attr( c, "xmlns" ) ) ) 55 55 { 56 /* Sigh. Who decided to suddenly invent new elements 57 instead of just sticking with <query/>? */ 56 imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type ); 58 57 return XT_HANDLED; 59 58 } -
protocols/jabber/jabber.c
rc5bc47b r0c41177 425 425 } 426 426 427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, c onst char *room, const char *nick, constchar *password )427 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password ) 428 428 { 429 429 if( strchr( room, '@' ) == NULL ) -
protocols/jabber/jabber.h
rc5bc47b r0c41177 240 240 241 241 /* conference.c */ 242 struct groupchat *jabber_chat_join( struct im_connection *ic, c onst char *room, const char *nick, constchar *password );242 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password ); 243 243 struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name ); 244 244 void jabber_chat_free( struct groupchat *c ); -
protocols/jabber/presence.c
rc5bc47b r0c41177 49 49 if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) ) 50 50 { 51 /* 52 imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from ); 53 */ 51 if( set_getbool( &ic->irc->set, "debug" ) ) 52 imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from ); 54 53 return XT_HANDLED; 55 54 } … … 107 106 if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL ) 108 107 { 109 /* 110 imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from ); 111 */ 108 if( set_getbool( &ic->irc->set, "debug" ) ) 109 imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from ); 112 110 return XT_HANDLED; 113 111 } -
protocols/nogaim.c
rc5bc47b r0c41177 249 249 void imcb_connected( struct im_connection *ic ) 250 250 { 251 irc_t *irc = ic->irc;252 struct chat *c;253 251 user_t *u; 254 252 … … 273 271 exponential backoff timer. */ 274 272 ic->acc->auto_reconnect_delay = 0; 275 276 for( c = irc->chatrooms; c; c = c->next )277 {278 if( c->acc != ic->acc )279 continue;280 281 if( set_getbool( &c->set, "auto_join" ) )282 chat_join( irc, c, NULL );283 }284 273 } 285 274 … … 320 309 ic->acc->prpl->logout( ic ); 321 310 b_event_remove( ic->inpa ); 322 323 g_free( ic->away );324 ic->away = NULL;325 311 326 312 u = irc->users; … … 506 492 } 507 493 508 509 struct imcb_ask_cb_data 494 /* prpl.c */ 495 496 struct show_got_added_data 510 497 { 511 498 struct im_connection *ic; … … 513 500 }; 514 501 515 static void imcb_ask_auth_cb_no( void *data ) 516 { 517 struct imcb_ask_cb_data *cbd = data; 518 519 cbd->ic->acc->prpl->auth_deny( cbd->ic, cbd->handle ); 520 521 g_free( cbd->handle ); 522 g_free( cbd ); 523 } 524 525 static void imcb_ask_auth_cb_yes( void *data ) 526 { 527 struct imcb_ask_cb_data *cbd = data; 528 529 cbd->ic->acc->prpl->auth_allow( cbd->ic, cbd->handle ); 530 531 g_free( cbd->handle ); 532 g_free( cbd ); 533 } 534 535 void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ) 536 { 537 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 538 char *s, *realname_ = NULL; 539 540 if( realname != NULL ) 541 realname_ = g_strdup_printf( " (%s)", realname ); 542 543 s = g_strdup_printf( "The user %s%s wants to add you to his/her buddy list.", 544 handle, realname_ ?: "" ); 545 546 g_free( realname_ ); 547 548 data->ic = ic; 549 data->handle = g_strdup( handle ); 550 query_add( ic->irc, ic, s, imcb_ask_auth_cb_yes, imcb_ask_auth_cb_no, data ); 551 } 552 553 554 static void imcb_ask_add_cb_no( void *data ) 555 { 556 g_free( ((struct imcb_ask_cb_data*)data)->handle ); 502 void show_got_added_no( void *data ) 503 { 504 g_free( ((struct show_got_added_data*)data)->handle ); 557 505 g_free( data ); 558 506 } 559 507 560 static void imcb_ask_add_cb_yes( void *data ) 561 { 562 struct imcb_ask_cb_data *cbd = data; 563 564 cbd->ic->acc->prpl->add_buddy( cbd->ic, cbd->handle, NULL ); 565 566 return imcb_ask_add_cb_no( data ); 567 } 568 569 void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ) 570 { 571 struct imcb_ask_cb_data *data = g_new0( struct imcb_ask_cb_data, 1 ); 508 void show_got_added_yes( void *data ) 509 { 510 struct show_got_added_data *sga = data; 511 512 sga->ic->acc->prpl->add_buddy( sga->ic, sga->handle, NULL ); 513 /* imcb_add_buddy( sga->ic, NULL, sga->handle, sga->handle ); */ 514 515 return show_got_added_no( data ); 516 } 517 518 void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ) 519 { 520 struct show_got_added_data *data = g_new0( struct show_got_added_data, 1 ); 572 521 char *s; 573 522 … … 580 529 data->ic = ic; 581 530 data->handle = g_strdup( handle ); 582 query_add( ic->irc, ic, s, imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data );531 query_add( ic->irc, ic, s, show_got_added_yes, show_got_added_no, data ); 583 532 } 584 533 … … 750 699 } 751 700 752 struct groupchat *imcb_chat_new( struct im_connection *ic, c onst char *handle )701 struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle ) 753 702 { 754 703 struct groupchat *c; -
protocols/nogaim.h
rc5bc47b r0c41177 209 209 * not implement this. */ 210 210 struct groupchat * 211 (* chat_join) (struct im_connection *, c onst char *room, const char *nick, constchar *password);211 (* chat_join) (struct im_connection *, char *room, char *nick, char *password); 212 212 /* Change the topic, if supported. Note that BitlBee expects the IM 213 213 server to confirm the topic change with a regular topic change … … 224 224 * - Most protocols will just want to set this to g_strcasecmp().*/ 225 225 int (* handle_cmp) (const char *who1, const char *who2); 226 227 /* Implement these callbacks if you want to use imcb_ask_auth() */228 void (* auth_allow) (struct im_connection *, const char *who);229 void (* auth_deny) (struct im_connection *, const char *who);230 226 }; 231 227 … … 243 239 * the account_t parameter. */ 244 240 G_MODULE_EXPORT struct im_connection *imcb_new( account_t *acc ); 245 G_MODULE_EXPORT void imc _free( struct im_connection *ic );241 G_MODULE_EXPORT void imcb_free( struct im_connection *ic ); 246 242 /* Once you're connected, you should call this function, so that the user will 247 243 * see the success. */ … … 256 252 /* To tell the user an error, ie. before logging out when an error occurs. */ 257 253 G_MODULE_EXPORT void imcb_error( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); 258 259 254 /* To ask a your about something. 260 255 * - 'msg' is the question. … … 263 258 */ 264 259 G_MODULE_EXPORT void imcb_ask( struct im_connection *ic, char *msg, void *data, query_callback doit, query_callback dont ); 265 266 /* Two common questions you may want to ask: 267 * - X added you to his contact list, allow? 268 * - X is not in your contact list, want to add? 269 */ 270 G_MODULE_EXPORT void imcb_ask_auth( struct im_connection *ic, const char *handle, const char *realname ); 271 G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, const char *handle, const char *realname ); 260 G_MODULE_EXPORT void imcb_ask_add( struct im_connection *ic, char *handle, const char *realname ); 272 261 273 262 /* Buddy management */ … … 301 290 * the user her/himself. At that point the group chat will be visible to the 302 291 * user, too. */ 303 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, c onst char *handle );292 G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, char *handle ); 304 293 G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle ); 305 294 /* To remove a handle from a group chat. Reason can be NULL. */ -
protocols/oscar/aim.h
rc5bc47b r0c41177 144 144 } 145 145 146 #define AIM_CLIENTINFO_KNOWNGOOD_5_1_3036 { \147 "AOL Instant Messenger, version 5.1.3036/WIN32", \148 0x0109, \149 0x0005, \150 0x0001, \151 0x0000, \152 0x0bdc, \153 "us", \154 "en", \155 }156 157 146 /* 158 147 * I would make 4.1.2010 the default, but they seem to have found … … 163 152 * around. (see login.c::memrequest()) 164 153 */ 165 #define AIM_CLIENTINFO_KNOWNGOOD AIM_CLIENTINFO_KNOWNGOOD_ 5_1_3036154 #define AIM_CLIENTINFO_KNOWNGOOD AIM_CLIENTINFO_KNOWNGOOD_3_5_1670 166 155 167 156 #ifndef TRUE -
protocols/oscar/oscar.c
rc5bc47b r0c41177 91 91 GSList *oscar_chats; 92 92 93 gboolean killme , no_reconnect;93 gboolean killme; 94 94 gboolean icq; 95 95 GSList *evilhack; … … 181 181 static int gaim_parse_auth_resp (aim_session_t *, aim_frame_t *, ...); 182 182 static int gaim_parse_login (aim_session_t *, aim_frame_t *, ...); 183 static int gaim_parse_logout (aim_session_t *, aim_frame_t *, ...);184 183 static int gaim_handle_redirect (aim_session_t *, aim_frame_t *, ...); 185 184 static int gaim_parse_oncoming (aim_session_t *, aim_frame_t *, ...); … … 295 294 aim_rxdispatch(odata->sess); 296 295 if (odata->killme) 297 imc_logout(ic, !odata->no_reconnect);296 imc_logout(ic, TRUE); 298 297 } else { 299 298 if ((conn->type == AIM_CONN_TYPE_BOS) || … … 521 520 case 0x18: 522 521 /* connecting too frequently */ 523 od->no_reconnect = TRUE;524 522 imcb_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); 525 523 break; … … 574 572 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_LOC, AIM_CB_LOC_USERINFO, gaim_parseaiminfo, 0); 575 573 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MTN, gaim_parsemtn, 0); 576 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_parse_logout, 0);577 574 578 575 ((struct oscar_data *)ic->proto_data)->conn = bosconn; … … 750 747 751 748 aim_send_login(sess, fr->conn, ic->acc->user, ic->acc->pass, &info, key); 752 753 return 1;754 }755 756 static int gaim_parse_logout(aim_session_t *sess, aim_frame_t *fr, ...) {757 struct im_connection *ic = sess->aux_data;758 struct oscar_data *odata = ic->proto_data;759 int code;760 va_list ap;761 762 va_start(ap, fr);763 code = va_arg(ap, int);764 va_end(ap);765 766 imcb_error( ic, "Connection aborted by server: %s", code == 1 ?767 "someone else logged in with your account" :768 "unknown reason" );769 770 /* Tell BitlBee to disable auto_reconnect if code == 1, since that771 means a concurrent login somewhere else. */772 odata->no_reconnect = code == 1;773 774 /* DO NOT log out here! Just tell the callback to do it. */775 odata->killme = TRUE;776 749 777 750 return 1; … … 1966 1939 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); 1967 1940 1968 g_free(ic->away); 1941 if (ic->away) 1942 g_free(ic->away); 1969 1943 ic->away = NULL; 1970 1944 … … 1986 1960 static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) 1987 1961 { 1988 1962 const char *msg = NULL; 1989 1963 gboolean no_message = FALSE; 1990 1964 1991 1965 /* clean old states */ 1992 g_free(ic->away); 1993 ic->away = NULL; 1966 if (ic->away) { 1967 g_free(ic->away); 1968 ic->away = NULL; 1969 } 1994 1970 od->sess->aim_icq_state = 0; 1995 1971 1996 1972 /* if no message, then use an empty message */ 1997 1998 1999 2000 1973 if (message) { 1974 msg = message; 1975 } else { 1976 msg = ""; 2001 1977 no_message = TRUE; 2002 1978 } 2003 1979 2004 1980 if (!g_strcasecmp(state, "Online")) { … … 2006 1982 } else if (!g_strcasecmp(state, "Away")) { 2007 1983 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 2008 1984 ic->away = g_strdup(msg); 2009 1985 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 2010 1986 } else if (!g_strcasecmp(state, "Do Not Disturb")) { 2011 1987 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY); 2012 1988 ic->away = g_strdup(msg); 2013 1989 od->sess->aim_icq_state = AIM_MTYPE_AUTODND; 2014 1990 } else if (!g_strcasecmp(state, "Not Available")) { 2015 1991 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); 2016 1992 ic->away = g_strdup(msg); 2017 1993 od->sess->aim_icq_state = AIM_MTYPE_AUTONA; 2018 1994 } else if (!g_strcasecmp(state, "Occupied")) { 2019 1995 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY); 2020 1996 ic->away = g_strdup(msg); 2021 1997 od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY; 2022 1998 } else if (!g_strcasecmp(state, "Free For Chat")) { 2023 1999 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT); 2024 2000 ic->away = g_strdup(msg); 2025 2001 od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC; 2026 2002 } else if (!g_strcasecmp(state, "Invisible")) { 2027 2003 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); 2028 2004 ic->away = g_strdup(msg); 2029 2005 } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { 2030 2006 if (no_message) { … … 2032 2008 } else { 2033 2009 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); 2034 2010 ic->away = g_strdup(msg); 2035 2011 od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY; 2036 2012 } … … 2044 2020 struct oscar_data *od = (struct oscar_data *)ic->proto_data; 2045 2021 2046 2022 oscar_set_away_aim(ic, od, state, message); 2047 2023 if (od->icq) 2048 2024 oscar_set_away_icq(ic, od, state, message); … … 2605 2581 } 2606 2582 2607 struct groupchat *oscar_chat_join(struct im_connection * ic, c onst char * room, const char * nick, constchar * password )2583 struct groupchat *oscar_chat_join(struct im_connection * ic, char * room, char * nick, char * password ) 2608 2584 { 2609 2585 struct oscar_data * od = (struct oscar_data *)ic->proto_data; -
protocols/yahoo/libyahoo2.c
rc5bc47b r0c41177 89 89 90 90 #include "base64.h" 91 #include "http_client.h"92 91 93 92 #ifdef USE_STRUCT_CALLBACKS … … 170 169 YAHOO_SERVICE_GOTGROUPRENAME, /* < 1, 36(old), 37(new) */ 171 170 YAHOO_SERVICE_SYSMESSAGE = 0x14, 172 YAHOO_SERVICE_SKINNAME = 0x15,173 171 YAHOO_SERVICE_PASSTHROUGH2 = 0x16, 174 172 YAHOO_SERVICE_CONFINVITE = 0x18, … … 194 192 YAHOO_SERVICE_LIST, 195 193 YAHOO_SERVICE_AUTH = 0x57, 196 YAHOO_SERVICE_AUTHBUDDY = 0x6d,197 194 YAHOO_SERVICE_ADDBUDDY = 0x83, 198 195 YAHOO_SERVICE_REMBUDDY, … … 200 197 YAHOO_SERVICE_REJECTCONTACT, 201 198 YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */ 202 YAHOO_SERVICE_Y7_PING = 0x8A, /* 0 - id and that's it?? */203 199 YAHOO_SERVICE_CHATONLINE = 0x96, /* > 109(id), 1, 6(abcde) < 0,1*/ 204 200 YAHOO_SERVICE_CHATGOTO, … … 206 202 YAHOO_SERVICE_CHATLEAVE, 207 203 YAHOO_SERVICE_CHATEXIT = 0x9b, 208 YAHOO_SERVICE_CHATADDINVITE = 0x9d,209 204 YAHOO_SERVICE_CHATLOGOUT = 0xa0, 210 205 YAHOO_SERVICE_CHATPING, … … 214 209 YAHOO_SERVICE_PICTURE = 0xbe, 215 210 YAHOO_SERVICE_PICTURE_UPDATE = 0xc1, 216 YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2, 217 YAHOO_SERVICE_Y6_VISIBILITY=0xc5, 218 YAHOO_SERVICE_Y6_STATUS_UPDATE=0xc6, 219 YAHOO_PHOTOSHARE_INIT=0xd2, 220 YAHOO_SERVICE_CONTACT_YMSG13=0xd6, 221 YAHOO_PHOTOSHARE_PREV=0xd7, 222 YAHOO_PHOTOSHARE_KEY=0xd8, 223 YAHOO_PHOTOSHARE_TRANS=0xda, 224 YAHOO_FILE_TRANSFER_INIT_YMSG13=0xdc, 225 YAHOO_FILE_TRANSFER_GET_YMSG13=0xdd, 226 YAHOO_FILE_TRANSFER_PUT_YMSG13=0xde, 227 YAHOO_SERVICE_YMSG15_STATUS=0xf0, 228 YAHOO_SERVICE_YMSG15_BUDDY_LIST=0xf1, 211 YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2 229 212 }; 230 213 … … 750 733 751 734 memcpy(data + pos, "YMSG", 4); pos += 4; 752 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER);735 pos += yahoo_put16(data + pos, 0x000c); 753 736 pos += yahoo_put16(data + pos, 0x0000); 754 737 pos += yahoo_put16(data + pos, pktlen + extra_pad); … … 764 747 yahoo_send_data(yid->fd, data, len); 765 748 else 766 749 yahoo_add_to_send_queue(yid, data, len); 767 750 FREE(data); 768 751 } … … 1484 1467 1485 1468 if (u->name != NULL) { 1486 if (pkt->service == YAHOO_SERVICE_LOGOFF ) { /* || u->flags == 0) { Not in YMSG16 */1469 if (pkt->service == YAHOO_SERVICE_LOGOFF || u->flags == 0) { 1487 1470 YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, u->name, YAHOO_STATUS_OFFLINE, NULL, 1, 0, 0); 1488 1471 } else { 1489 /* Key 47 always seems to be 1 for YMSG16 */1490 if(!u->state)1491 u->away = 0;1492 else1493 u->away = 1;1494 1495 1472 YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, u->name, u->state, u->msg, u->away, u->idle, u->mobile); 1496 1473 } … … 1500 1477 y_list_free_1(t); 1501 1478 FREE(u); 1502 }1503 }1504 1505 static void yahoo_process_buddy_list(struct yahoo_input_data *yid, struct yahoo_packet *pkt)1506 {1507 struct yahoo_data *yd = yid->yd;1508 YList *l;1509 int last_packet = 0;1510 char *cur_group = NULL;1511 struct yahoo_buddy *newbud = NULL;1512 1513 /* we could be getting multiple packets here */1514 for (l = pkt->hash; l; l = l->next) {1515 struct yahoo_pair *pair = l->data;1516 1517 switch(pair->key) {1518 case 300:1519 case 301:1520 case 302:1521 case 303:1522 if ( 315 == atoi(pair->value) )1523 last_packet = 1;1524 break;1525 case 65:1526 g_free(cur_group);1527 cur_group = strdup(pair->value);1528 break;1529 case 7:1530 newbud = y_new0(struct yahoo_buddy, 1);1531 newbud->id = strdup(pair->value);1532 if(cur_group)1533 newbud->group = strdup(cur_group);1534 else {1535 struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(1536 yd->buddies, y_list_length(yd->buddies)-1)->data;1537 newbud->group = strdup(lastbud->group);1538 }1539 1540 yd->buddies = y_list_append(yd->buddies, newbud);1541 1542 break;1543 }1544 }1545 1546 g_free(cur_group);1547 1548 /* we could be getting multiple packets here */1549 if (last_packet)1550 return;1551 1552 YAHOO_CALLBACK(ext_yahoo_got_buddies)(yd->client_id, yd->buddies);1553 1554 /*** We login at the very end of the packet communication */1555 if (!yd->logged_in) {1556 yd->logged_in = TRUE;1557 if(yd->current_status < 0)1558 yd->current_status = yd->initial_status;1559 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, YAHOO_LOGIN_OK, NULL);1560 1479 } 1561 1480 } … … 1630 1549 } 1631 1550 1632 if(yd->cookie_y && yd->cookie_t )1551 if(yd->cookie_y && yd->cookie_t && yd->cookie_c) 1633 1552 YAHOO_CALLBACK(ext_yahoo_got_cookies)(yd->client_id); 1634 1553 … … 2307 2226 } 2308 2227 2309 struct yahoo_https_auth_data2310 {2311 struct yahoo_input_data *yid;2312 char *token;2313 char *chal;2314 };2315 2316 static void yahoo_https_auth_token_init(struct yahoo_https_auth_data *had);2317 static void yahoo_https_auth_token_finish(struct http_request *req);2318 static void yahoo_https_auth_init(struct yahoo_https_auth_data *had);2319 static void yahoo_https_auth_finish(struct http_request *req);2320 2321 /* Extract a value from a login.yahoo.com response. Assume CRLF-linebreaks2322 and FAIL miserably if they're not there... */2323 static char *yahoo_ha_find_key(char *response, char *key)2324 {2325 char *s, *end;2326 int len = strlen(key);2327 2328 s = response;2329 do {2330 if (strncmp(s, key, len) == 0 && s[len] == '=') {2331 s += len + 1;2332 if ((end = strchr(s, '\r')))2333 return g_strndup(s, end - s);2334 else2335 return g_strdup(s);2336 }2337 2338 if ((s = strchr(s, '\n')))2339 s ++;2340 } while (s && *s);2341 2342 return NULL;2343 }2344 2345 static enum yahoo_status yahoo_https_status_parse(int code)2346 {2347 switch (code)2348 {2349 case 1212: return YAHOO_LOGIN_PASSWD;2350 case 1213: return YAHOO_LOGIN_LOCK;2351 case 1235: return YAHOO_LOGIN_UNAME;2352 default: return (enum yahoo_status) code;2353 }2354 }2355 2356 static void yahoo_process_auth_0x10(struct yahoo_input_data *yid, const char *seed, const char *sn)2357 {2358 struct yahoo_https_auth_data *had = g_new0(struct yahoo_https_auth_data, 1);2359 2360 had->yid = yid;2361 had->chal = g_strdup(seed);2362 2363 yahoo_https_auth_token_init(had);2364 }2365 2366 static void yahoo_https_auth_token_init(struct yahoo_https_auth_data *had)2367 {2368 struct yahoo_input_data *yid = had->yid;2369 struct yahoo_data *yd = yid->yd;2370 struct http_request *req;2371 char *login, *passwd, *chal;2372 char *url;2373 2374 login = g_strndup(yd->user, 3 * strlen(yd->user));2375 http_encode(login);2376 passwd = g_strndup(yd->password, 3 * strlen(yd->password));2377 http_encode(passwd);2378 chal = g_strndup(had->chal, 3 * strlen(had->chal));2379 http_encode(chal);2380 2381 url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=%d&login=%s&passwd=%s&chal=%s",2382 (int) time(NULL), login, passwd, chal);2383 2384 req = http_dorequest_url(url, yahoo_https_auth_token_finish, had);2385 2386 g_free(url);2387 g_free(chal);2388 g_free(passwd);2389 g_free(login);2390 }2391 2392 static void yahoo_https_auth_token_finish(struct http_request *req)2393 {2394 struct yahoo_https_auth_data *had = req->data;2395 struct yahoo_input_data *yid = had->yid;2396 struct yahoo_data *yd = yid->yd;2397 int st;2398 2399 if (req->status_code != 200) {2400 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 2000 + req->status_code, NULL);2401 goto fail;2402 }2403 2404 if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {2405 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, yahoo_https_status_parse(st), NULL);2406 goto fail;2407 }2408 2409 if ((had->token = yahoo_ha_find_key(req->reply_body, "ymsgr")) == NULL) {2410 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 3001, NULL);2411 goto fail;2412 }2413 2414 return yahoo_https_auth_init(had);2415 2416 fail:2417 g_free(had->token);2418 g_free(had->chal);2419 g_free(had);2420 }2421 2422 static void yahoo_https_auth_init(struct yahoo_https_auth_data *had)2423 {2424 struct http_request *req;2425 char *url;2426 2427 url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=%d&token=%s",2428 (int) time(NULL), had->token);2429 2430 req = http_dorequest_url(url, yahoo_https_auth_finish, had);2431 2432 g_free(url);2433 }2434 2435 static void yahoo_https_auth_finish(struct http_request *req)2436 {2437 struct yahoo_https_auth_data *had = req->data;2438 struct yahoo_input_data *yid = had->yid;2439 struct yahoo_data *yd = yid->yd;2440 struct yahoo_packet *pack;2441 char *crumb;2442 int st;2443 2444 md5_byte_t result[16];2445 md5_state_t ctx;2446 2447 unsigned char yhash[32];2448 2449 if (req->status_code != 200) {2450 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 2000 + req->status_code, NULL);2451 goto fail;2452 }2453 2454 if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {2455 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, yahoo_https_status_parse(st), NULL);2456 goto fail;2457 }2458 2459 if ((yd->cookie_y = yahoo_ha_find_key(req->reply_body, "Y")) == NULL ||2460 (yd->cookie_t = yahoo_ha_find_key(req->reply_body, "T")) == NULL ||2461 (crumb = yahoo_ha_find_key(req->reply_body, "crumb")) == NULL) {2462 YAHOO_CALLBACK(ext_yahoo_login_response)(yd->client_id, 3002, NULL);2463 goto fail;2464 }2465 2466 md5_init(&ctx);2467 md5_append(&ctx, (unsigned char*) crumb, 11);2468 md5_append(&ctx, (unsigned char*) had->chal, strlen(had->chal));2469 md5_finish(&ctx, result);2470 to_y64(yhash, result, 16);2471 2472 pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP, yd->initial_status, yd->session_id);2473 yahoo_packet_hash(pack, 1, yd->user);2474 yahoo_packet_hash(pack, 0, yd->user);2475 yahoo_packet_hash(pack, 277, yd->cookie_y);2476 yahoo_packet_hash(pack, 278, yd->cookie_t);2477 yahoo_packet_hash(pack, 307, (char*) yhash);2478 yahoo_packet_hash(pack, 244, "524223");2479 yahoo_packet_hash(pack, 2, yd->user);2480 yahoo_packet_hash(pack, 2, "1");2481 yahoo_packet_hash(pack, 98, "us");2482 yahoo_packet_hash(pack, 135, "7.5.0.647");2483 2484 yahoo_send_packet(yid, pack, 0);2485 2486 yahoo_packet_free(pack);2487 2488 fail:2489 g_free(crumb);2490 g_free(had->token);2491 g_free(had->chal);2492 g_free(had);2493 }2494 2495 2228 static void yahoo_process_auth(struct yahoo_input_data *yid, struct yahoo_packet *pkt) 2496 2229 { … … 2520 2253 case 1: 2521 2254 yahoo_process_auth_0x0b(yid, seed, sn); 2522 break;2523 case 2:2524 yahoo_process_auth_0x10(yid, seed, sn);2525 2255 break; 2526 2256 default: … … 2678 2408 2679 2409 yd->buddies = y_list_append(yd->buddies, bud); 2680 2410 2681 2411 /* Possibly called already, but at least the call above doesn't 2682 2412 seem to happen every time (not anytime I tried). */ … … 2685 2415 2686 2416 /* YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, who, status, NULL, (status==YAHOO_STATUS_AVAILABLE?0:1)); */ 2687 }2688 2689 static void yahoo_process_contact_ymsg13(struct yahoo_input_data *yid, struct yahoo_packet *pkt)2690 {2691 char* who=NULL;2692 char* me=NULL;2693 char* msg=NULL;2694 YList *l;2695 for (l = pkt->hash; l; l = l->next) {2696 struct yahoo_pair *pair = l->data;2697 if (pair->key == 4)2698 who = pair->value;2699 else if (pair->key == 5)2700 me = pair->value;2701 else2702 DEBUG_MSG(("unknown key: %d = %s", pair->key, pair->value));2703 }2704 2705 if(pkt->status==3)2706 YAHOO_CALLBACK(ext_yahoo_contact_auth_request)(yid->yd->client_id, me, who, msg);2707 2417 } 2708 2418 … … 2918 2628 2919 2629 YList *l; 2920 //yahoo_dump_unhandled(pkt);2630 yahoo_dump_unhandled(pkt); 2921 2631 for (l = pkt->hash; l; l = l->next) { 2922 2632 struct yahoo_pair *pair = l->data; … … 2940 2650 { 2941 2651 DEBUG_MSG(("yahoo_packet_process: 0x%02x", pkt->service)); 2942 yahoo_dump_unhandled(pkt);2943 2652 switch (pkt->service) 2944 2653 { … … 2952 2661 case YAHOO_SERVICE_IDACT: 2953 2662 case YAHOO_SERVICE_IDDEACT: 2954 case YAHOO_SERVICE_Y6_STATUS_UPDATE:2955 case YAHOO_SERVICE_YMSG15_STATUS:2956 2663 yahoo_process_status(yid, pkt); 2957 2664 break; … … 2967 2674 yahoo_process_mail(yid, pkt); 2968 2675 break; 2969 case YAHOO_SERVICE_REJECTCONTACT:2970 2676 case YAHOO_SERVICE_NEWCONTACT: 2971 2677 yahoo_process_contact(yid, pkt); … … 3008 2714 yahoo_process_buddyadd(yid, pkt); 3009 2715 break; 3010 case YAHOO_SERVICE_CONTACT_YMSG13:3011 yahoo_process_contact_ymsg13(yid,pkt);3012 break;3013 2716 case YAHOO_SERVICE_REMBUDDY: 3014 2717 yahoo_process_buddydel(yid, pkt); … … 3039 2742 case YAHOO_SERVICE_CHATLOGOFF: 3040 2743 case YAHOO_SERVICE_CHATMSG: 2744 case YAHOO_SERVICE_REJECTCONTACT: 3041 2745 case YAHOO_SERVICE_PEERTOPEER: 3042 2746 WARNING(("unhandled service 0x%02x", pkt->service)); … … 3052 2756 yahoo_process_picture_upload(yid, pkt); 3053 2757 break; 3054 case YAHOO_SERVICE_YMSG15_BUDDY_LIST: /* Buddy List */3055 yahoo_process_buddy_list(yid, pkt);3056 2758 default: 3057 2759 WARNING(("unknown service 0x%02x", pkt->service)); … … 3837 3539 yahoo_process_webcam_connection, 3838 3540 yahoo_process_chatcat_connection, 3839 yahoo_process_search_connection ,3541 yahoo_process_search_connection 3840 3542 }; 3841 3543 … … 3855 3557 } while(len == -1 && errno == EINTR); 3856 3558 3857 if(len == -1 && (errno == EAGAIN||errno == EINTR)) /* we'll try again later */3559 if(len == -1 && errno == EAGAIN) /* we'll try again later */ 3858 3560 return 1; 3859 3561 … … 4058 3760 4059 3761 yahoo_packet_hash(pkt, 5, who); 4060 yahoo_packet_hash(pkt, 1, from?from:yd->user);3762 yahoo_packet_hash(pkt, 4, from?from:yd->user); 4061 3763 yahoo_packet_hash(pkt, 14, " "); 4062 3764 yahoo_packet_hash(pkt, 13, typ ? "1" : "0"); … … 4073 3775 struct yahoo_data *yd; 4074 3776 struct yahoo_packet *pkt = NULL; 4075 int old_status;3777 int service; 4076 3778 char s[4]; 4077 3779 … … 4081 3783 yd = yid->yd; 4082 3784 4083 old_status = yd->current_status; 4084 4085 if (msg && strncmp(msg,"Invisible",9)) { 3785 if (msg) { 4086 3786 yd->current_status = YAHOO_STATUS_CUSTOM; 4087 3787 } else { … … 4089 3789 } 4090 3790 4091 /* Thank you libpurple :) */ 4092 if (yd->current_status == YAHOO_STATUS_INVISIBLE) { 4093 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0); 4094 yahoo_packet_hash(pkt, 13, "2"); 4095 yahoo_send_packet(yid, pkt, 0); 4096 yahoo_packet_free(pkt); 4097 4098 return; 4099 } 4100 4101 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, yd->current_status, yd->session_id); 4102 snprintf(s, sizeof(s), "%d", yd->current_status); 4103 yahoo_packet_hash(pkt, 10, s); 3791 if (yd->current_status == YAHOO_STATUS_AVAILABLE) 3792 service = YAHOO_SERVICE_ISBACK; 3793 else 3794 service = YAHOO_SERVICE_ISAWAY; 4104 3795 4105 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 4106 yahoo_packet_hash(pkt, 19, msg); 4107 } else { 4108 yahoo_packet_hash(pkt, 19, ""); 4109 } 4110 4111 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3796 if ((away == 2) && (yd->current_status == YAHOO_STATUS_AVAILABLE)) { 3797 pkt = yahoo_packet_new(YAHOO_SERVICE_ISAWAY, YAHOO_STATUS_BRB, yd->session_id); 3798 yahoo_packet_hash(pkt, 10, "999"); 3799 yahoo_packet_hash(pkt, 47, "2"); 3800 }else { 3801 pkt = yahoo_packet_new(service, YAHOO_STATUS_AVAILABLE, yd->session_id); 3802 snprintf(s, sizeof(s), "%d", yd->current_status); 3803 yahoo_packet_hash(pkt, 10, s); 3804 if (yd->current_status == YAHOO_STATUS_CUSTOM) { 3805 yahoo_packet_hash(pkt, 19, msg); 3806 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3807 } else { 3808 yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0"); 3809 } 3810 3811 3812 3813 } 4112 3814 4113 3815 yahoo_send_packet(yid, pkt, 0); 4114 3816 yahoo_packet_free(pkt); 4115 4116 if(old_status == YAHOO_STATUS_INVISIBLE) {4117 pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBILITY, YAHOO_STATUS_AVAILABLE, 0);4118 yahoo_packet_hash(pkt, 13, "1");4119 yahoo_send_packet(yid, pkt, 0);4120 yahoo_packet_free(pkt);4121 }4122 3817 } 4123 3818 … … 4134 3829 LOG(("yahoo_logoff: current status: %d", yd->current_status)); 4135 3830 4136 if(yd->current_status != -1 && 0) { 4137 /* Meh. Don't send this. The event handlers are not going to 4138 get to do this so it'll just leak memory. And the TCP 4139 connection reset will hopefully be clear enough. */ 3831 if(yd->current_status != -1) { 4140 3832 pkt = yahoo_packet_new(YAHOO_SERVICE_LOGOFF, YAHOO_STATUS_AVAILABLE, yd->session_id); 4141 3833 yd->current_status = -1; … … 4370 4062 return; 4371 4063 4372 pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YPACKET_STATUS_DEFAULT, yd->session_id); 4373 4064 pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YAHOO_STATUS_AVAILABLE, yd->session_id); 4065 yahoo_packet_hash(pkt, 1, yd->user); 4066 yahoo_packet_hash(pkt, 7, who); 4067 yahoo_packet_hash(pkt, 65, group); 4374 4068 if (msg != NULL) /* add message/request "it's me add me" */ 4375 4069 yahoo_packet_hash(pkt, 14, msg); 4376 else4377 yahoo_packet_hash(pkt,14,"");4378 4379 yahoo_packet_hash(pkt, 65, group);4380 yahoo_packet_hash(pkt, 97, "1");4381 yahoo_packet_hash(pkt, 1, yd->user);4382 yahoo_packet_hash(pkt, 302, "319");4383 yahoo_packet_hash(pkt, 300, "319");4384 yahoo_packet_hash(pkt, 7, who);4385 yahoo_packet_hash(pkt, 334, "0");4386 yahoo_packet_hash(pkt, 301, "319");4387 yahoo_packet_hash(pkt, 303, "319");4388 4389 4390 4070 yahoo_send_packet(yid, pkt, 0); 4391 4071 yahoo_packet_free(pkt); … … 4409 4089 yahoo_send_packet(yid, pkt, 0); 4410 4090 yahoo_packet_free(pkt); 4411 }4412 4413 void yahoo_accept_buddy_ymsg13(int id,const char* me,const char* who){4414 struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);4415 struct yahoo_data *yd;4416 4417 if(!yid)4418 return;4419 yd = yid->yd;4420 4421 struct yahoo_packet* pkt=NULL;4422 pkt= yahoo_packet_new(YAHOO_SERVICE_CONTACT_YMSG13,YAHOO_STATUS_AVAILABLE,0);4423 4424 yahoo_packet_hash(pkt,1,me ?: yd->user);4425 yahoo_packet_hash(pkt,5,who);4426 yahoo_packet_hash(pkt,13,"1");4427 yahoo_packet_hash(pkt,334,"0");4428 yahoo_send_packet(yid, pkt, 0);4429 yahoo_packet_free(pkt);4430 }4431 4432 void yahoo_reject_buddy_ymsg13(int id,const char* me,const char* who,const char* msg){4433 struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);4434 struct yahoo_data *yd;4435 4436 if(!yid)4437 return;4438 yd = yid->yd;4439 4440 struct yahoo_packet* pkt=NULL;4441 pkt= yahoo_packet_new(YAHOO_SERVICE_CONTACT_YMSG13,YAHOO_STATUS_AVAILABLE,0);4442 4443 yahoo_packet_hash(pkt,1,me ?: yd->user);4444 yahoo_packet_hash(pkt,5,who);4445 // yahoo_packet_hash(pkt,241,YAHOO_PROTO_VER);4446 yahoo_packet_hash(pkt,13,"2");4447 yahoo_packet_hash(pkt,334,"0");4448 yahoo_packet_hash(pkt,97,"1");4449 yahoo_packet_hash(pkt,14,msg?:"");4450 4451 yahoo_send_packet(yid, pkt, 0);4452 yahoo_packet_free(pkt);4453 4454 4091 } 4455 4092 -
protocols/yahoo/yahoo.c
rc5bc47b r0c41177 197 197 { 198 198 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data; 199 char *away; 200 201 away = NULL; 199 200 ic->away = NULL; 202 201 203 202 if( state && msg && g_strcasecmp( state, msg ) != 0 ) 204 203 { 205 204 yd->current_status = YAHOO_STATUS_CUSTOM; 206 away = "";205 ic->away = ""; 207 206 } 208 207 else if( state ) … … 213 212 msg = NULL; 214 213 215 away = "";214 ic->away = ""; 216 215 if( g_strcasecmp( state, "Available" ) == 0 ) 217 216 { 218 217 yd->current_status = YAHOO_STATUS_AVAILABLE; 219 away = NULL;218 ic->away = NULL; 220 219 } 221 220 else if( g_strcasecmp( state, "Be Right Back" ) == 0 ) … … 243 242 yd->current_status = YAHOO_STATUS_AVAILABLE; 244 243 245 away = NULL;244 ic->away = NULL; 246 245 } 247 246 } … … 249 248 yd->current_status = YAHOO_STATUS_AVAILABLE; 250 249 251 yahoo_set_away( yd->y2_id, yd->current_status, msg, away != NULL ? 2 : 0 );250 yahoo_set_away( yd->y2_id, yd->current_status, msg, ic->away != NULL ? 2 : 0 ); 252 251 } 253 252 254 253 static GList *byahoo_away_states( struct im_connection *ic ) 255 254 { 256 static GList *m = NULL; 257 258 if( m == NULL ) 259 { 260 m = g_list_append( m, "Available" ); 261 m = g_list_append( m, "Be Right Back" ); 262 m = g_list_append( m, "Busy" ); 263 m = g_list_append( m, "Not At Home" ); 264 m = g_list_append( m, "Not At Desk" ); 265 m = g_list_append( m, "Not In Office" ); 266 m = g_list_append( m, "On Phone" ); 267 m = g_list_append( m, "On Vacation" ); 268 m = g_list_append( m, "Out To Lunch" ); 269 m = g_list_append( m, "Stepped Out" ); 270 m = g_list_append( m, "Invisible" ); 271 m = g_list_append( m, GAIM_AWAY_CUSTOM ); 272 } 255 GList *m = NULL; 256 257 m = g_list_append( m, "Available" ); 258 m = g_list_append( m, "Be Right Back" ); 259 m = g_list_append( m, "Busy" ); 260 m = g_list_append( m, "Not At Home" ); 261 m = g_list_append( m, "Not At Desk" ); 262 m = g_list_append( m, "Not In Office" ); 263 m = g_list_append( m, "On Phone" ); 264 m = g_list_append( m, "On Vacation" ); 265 m = g_list_append( m, "Out To Lunch" ); 266 m = g_list_append( m, "Stepped Out" ); 267 m = g_list_append( m, "Invisible" ); 268 m = g_list_append( m, GAIM_AWAY_CUSTOM ); 273 269 274 270 return m; … … 349 345 350 346 return c; 351 }352 353 static void byahoo_auth_allow( struct im_connection *ic, const char *who )354 {355 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;356 357 yahoo_accept_buddy_ymsg13( yd->y2_id, NULL, who );358 }359 360 static void byahoo_auth_deny( struct im_connection *ic, const char *who )361 {362 struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;363 364 yahoo_reject_buddy_ymsg13( yd->y2_id, NULL, who, NULL );365 347 } 366 348 … … 390 372 ret->handle_cmp = g_strcasecmp; 391 373 392 ret->auth_allow = byahoo_auth_allow;393 ret->auth_deny = byahoo_auth_deny;394 395 374 register_protocol(ret); 396 375 } … … 472 451 struct byahoo_write_ready_data *d = data; 473 452 474 return yahoo_write_ready( d->id, d->fd, d->data ); 453 yahoo_write_ready( d->id, d->fd, d->data ); 454 455 return FALSE; 475 456 } 476 457 … … 809 790 { 810 791 struct byahoo_conf_invitation *inv = data; 811 struct groupchat *b; 812 813 for( b = inv->ic->groupchats; b; b = b->next ) 814 if( b == inv->c ) 815 break; 816 817 if( b != NULL ) 818 { 819 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 820 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 821 } 822 else 823 { 824 imcb_log( inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name ); 825 } 826 792 793 yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name ); 794 imcb_chat_add_buddy( inv->c, inv->ic->acc->user ); 827 795 g_free( inv->name ); 828 796 g_free( inv ); … … 940 908 } 941 909 942 void ext_yahoo_contact_auth_request( int id, const char *myid, const char *who, const char *msg )943 {944 struct im_connection *ic = byahoo_get_ic_by_id( id );945 946 imcb_ask_auth( ic, who, NULL );947 }948 949 910 void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg ) 950 911 { 951 struct im_connection *ic = byahoo_get_ic_by_id( id );952 953 imcb_add_buddy( ic, (char*) who, NULL );912 /* Groups schmoups. If I want to handle groups properly I can get the 913 buddy data from some internal libyahoo2 structure. */ 914 imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL ); 954 915 } 955 916 -
protocols/yahoo/yahoo2.h
rc5bc47b r0c41177 217 217 void yahoo_buddyicon_request(int id, const char *who); 218 218 219 void yahoo_accept_buddy_ymsg13(int,const char*,const char*);220 void yahoo_reject_buddy_ymsg13(int,const char*,const char*,const char*);221 222 219 #include "yahoo_httplib.h" 223 220 -
protocols/yahoo/yahoo2_callbacks.h
rc5bc47b r0c41177 361 361 362 362 /* 363 * Name: ext_yahoo_contact_auth_request364 * Called when a contact wants to add you to his/her contact list365 * Params:366 * id - the id that identifies the server connection367 * myid - the identity s/he added368 * who - who did it369 * msg - any message sent370 */371 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_auth_request)(int id, const char *myid, const char *who, const char *msg);372 373 374 /*375 363 * Name: ext_yahoo_contact_added 376 364 * Called when a contact is added to your list -
protocols/yahoo/yahoo2_types.h
rc5bc47b r0c41177 57 57 YAHOO_LOGIN_LOCK = 14, 58 58 YAHOO_LOGIN_DUPL = 99, 59 YAHOO_LOGIN_SOCK = -1, 60 }; 61 62 enum ypacket_status { 63 YPACKET_STATUS_DISCONNECTED = -1, 64 YPACKET_STATUS_DEFAULT = 0, 65 YPACKET_STATUS_SERVERACK = 1, 66 YPACKET_STATUS_GAME = 0x2, 67 YPACKET_STATUS_AWAY = 0x4, 68 YPACKET_STATUS_CONTINUED = 0x5, 69 YPACKET_STATUS_INVISIBLE = 12, 70 YPACKET_STATUS_NOTIFY = 0x16, /* TYPING */ 71 YPACKET_STATUS_WEBLOGIN = 0x5a55aa55, 72 YPACKET_STATUS_OFFLINE = 0x5a55aa56 59 YAHOO_LOGIN_SOCK = -1 73 60 }; 74 61 … … 98 85 }; 99 86 100 #define YAHOO_PROTO_VER 0x00 1087 #define YAHOO_PROTO_VER 0x000b 101 88 102 89 /* Yahoo style/color directives */ … … 128 115 YAHOO_CONNECTION_WEBCAM, 129 116 YAHOO_CONNECTION_CHATCAT, 130 YAHOO_CONNECTION_SEARCH, 131 YAHOO_CONNECTION_AUTH, 117 YAHOO_CONNECTION_SEARCH 132 118 }; 133 119 … … 145 131 /* chat member attribs */ 146 132 #define YAHOO_CHAT_MALE 0x8000 133 #define YAHOO_CHAT_FEMALE 0x10000 147 134 #define YAHOO_CHAT_FEMALE 0x10000 148 135 #define YAHOO_CHAT_DUNNO 0x400 -
root_commands.c
rc5bc47b r0c41177 78 78 } 79 79 80 #define MIN_ARGS( x, y... ) \81 do \82 { \83 int blaat; \84 for( blaat = 0; blaat <= x; blaat ++ ) \85 if( cmd[blaat] == NULL ) \86 { \87 irc_usermsg( irc, "Not enough parameters given (need %d).", x ); \88 return y; \89 } \90 } while( 0 )91 92 80 void root_command( irc_t *irc, char *cmd[] ) 93 81 { … … 100 88 if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 ) 101 89 { 102 MIN_ARGS( commands[i].required_parameters ); 103 90 if( !cmd[commands[i].required_parameters] ) 91 { 92 irc_usermsg( irc, "Not enough parameters given (need %d)", commands[i].required_parameters ); 93 return; 94 } 104 95 commands[i].execute( irc, cmd ); 105 96 return; … … 259 250 } 260 251 261 typedef set_t** (*cmd_set_findhead)( irc_t*, char* ); 262 typedef int (*cmd_set_checkflags)( irc_t*, set_t *set ); 263 264 static int cmd_set_real( irc_t *irc, char **cmd, cmd_set_findhead findhead, cmd_set_checkflags checkflags ) 265 { 266 char *set_full = NULL, *set_name = NULL, *tmp; 267 set_t **head; 268 269 if( cmd[1] && g_strncasecmp( cmd[1], "-del", 4 ) == 0 ) 270 { 271 MIN_ARGS( 2, 0 ); 272 set_full = cmd[2]; 273 } 274 else 275 set_full = cmd[1]; 276 277 if( findhead == NULL ) 278 { 279 set_name = set_full; 280 281 head = &irc->set; 282 } 283 else 284 { 285 char *id; 286 287 if( ( tmp = strchr( set_full, '/' ) ) ) 288 { 289 id = g_strndup( set_full, ( tmp - set_full ) ); 290 set_name = tmp + 1; 291 } 292 else 293 { 294 id = g_strdup( set_full ); 295 } 296 297 if( ( head = findhead( irc, id ) ) == NULL ) 298 { 299 g_free( id ); 300 irc_usermsg( irc, "Could not find setting." ); 301 return 0; 302 } 303 g_free( id ); 304 } 305 306 if( cmd[1] && cmd[2] && set_name ) 307 { 308 set_t *s = set_find( head, set_name ); 309 int st; 310 311 if( s && checkflags && checkflags( irc, s ) == 0 ) 312 return 0; 313 314 if( g_strncasecmp( cmd[1], "-del", 4 ) == 0 ) 315 st = set_reset( head, set_name ); 316 else 317 st = set_setstr( head, set_name, cmd[2] ); 318 319 if( set_getstr( head, set_name ) == NULL ) 320 { 321 if( st ) 322 irc_usermsg( irc, "Setting changed successfully" ); 323 else 324 irc_usermsg( irc, "Failed to change setting" ); 325 } 326 else 327 { 328 cmd_showset( irc, head, set_name ); 329 } 330 } 331 else if( set_name ) 332 { 333 cmd_showset( irc, head, set_name ); 334 } 335 else 336 { 337 set_t *s = *head; 338 while( s ) 339 { 340 cmd_showset( irc, &s, s->key ); 341 s = s->next; 342 } 343 } 344 345 return 1; 346 } 347 348 static set_t **cmd_account_set_findhead( irc_t *irc, char *id ) 252 static void cmd_account( irc_t *irc, char **cmd ) 349 253 { 350 254 account_t *a; 351 255 352 if( ( a = account_get( irc, id ) ) )353 return &a->set;354 else355 return NULL;356 }357 358 static int cmd_account_set_checkflags( irc_t *irc, set_t *s )359 {360 account_t *a = s->data;361 362 if( a->ic && s && s->flags & ACC_SET_OFFLINE_ONLY )363 {364 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "off" );365 return 0;366 }367 else if( !a->ic && s && s->flags & ACC_SET_ONLINE_ONLY )368 {369 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "on" );370 return 0;371 }372 373 return 1;374 }375 376 static void cmd_account( irc_t *irc, char **cmd )377 {378 account_t *a;379 380 256 if( global.conf->authmode == AUTHMODE_REGISTERED && !( irc->status & USTATUS_IDENTIFIED ) ) 381 257 { … … 388 264 struct prpl *prpl; 389 265 390 MIN_ARGS( 4 ); 391 392 prpl = find_protocol( cmd[2] ); 266 if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL ) 267 { 268 irc_usermsg( irc, "Not enough parameters" ); 269 return; 270 } 271 272 prpl = find_protocol(cmd[2]); 393 273 394 274 if( prpl == NULL ) … … 410 290 else if( g_strcasecmp( cmd[1], "del" ) == 0 ) 411 291 { 412 MIN_ARGS( 2 ); 413 414 if( !( a = account_get( irc, cmd[2] ) ) ) 292 if( !cmd[2] ) 293 { 294 irc_usermsg( irc, "Not enough parameters given (need %d)", 2 ); 295 } 296 else if( !( a = account_get( irc, cmd[2] ) ) ) 415 297 { 416 298 irc_usermsg( irc, "Invalid account" ); … … 540 422 else if( g_strcasecmp( cmd[1], "set" ) == 0 ) 541 423 { 542 MIN_ARGS( 2 ); 543 544 cmd_set_real( irc, cmd + 1, cmd_account_set_findhead, cmd_account_set_checkflags ); 545 } 546 else 547 { 548 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "account", cmd[1] ); 424 char *acc_handle, *set_name = NULL, *tmp; 425 426 if( !cmd[2] ) 427 { 428 irc_usermsg( irc, "Not enough parameters given (need %d)", 2 ); 429 return; 430 } 431 432 if( g_strncasecmp( cmd[2], "-del", 4 ) == 0 ) 433 acc_handle = g_strdup( cmd[3] ); 434 else 435 acc_handle = g_strdup( cmd[2] ); 436 437 if( !acc_handle ) 438 { 439 irc_usermsg( irc, "Not enough parameters given (need %d)", 3 ); 440 return; 441 } 442 443 if( ( tmp = strchr( acc_handle, '/' ) ) ) 444 { 445 *tmp = 0; 446 set_name = tmp + 1; 447 } 448 449 if( ( a = account_get( irc, acc_handle ) ) == NULL ) 450 { 451 g_free( acc_handle ); 452 irc_usermsg( irc, "Invalid account" ); 453 return; 454 } 455 456 if( cmd[3] && set_name ) 457 { 458 set_t *s = set_find( &a->set, set_name ); 459 int st; 460 461 if( a->ic && s && s->flags & ACC_SET_OFFLINE_ONLY ) 462 { 463 g_free( acc_handle ); 464 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "off" ); 465 return; 466 } 467 else if( !a->ic && s && s->flags & ACC_SET_ONLINE_ONLY ) 468 { 469 g_free( acc_handle ); 470 irc_usermsg( irc, "This setting can only be changed when the account is %s-line", "on" ); 471 return; 472 } 473 474 if( g_strncasecmp( cmd[2], "-del", 4 ) == 0 ) 475 st = set_reset( &a->set, set_name ); 476 else 477 st = set_setstr( &a->set, set_name, cmd[3] ); 478 479 if( set_getstr( &a->set, set_name ) == NULL ) 480 { 481 if( st ) 482 irc_usermsg( irc, "Setting changed successfully" ); 483 else 484 irc_usermsg( irc, "Failed to change setting" ); 485 } 486 else 487 { 488 cmd_showset( irc, &a->set, set_name ); 489 } 490 } 491 else if( set_name ) 492 { 493 cmd_showset( irc, &a->set, set_name ); 494 } 495 else 496 { 497 set_t *s = a->set; 498 while( s ) 499 { 500 cmd_showset( irc, &s, s->key ); 501 s = s->next; 502 } 503 } 504 505 g_free( acc_handle ); 506 } 507 else 508 { 509 irc_usermsg( irc, "Unknown command: account %s. Please use \x02help commands\x02 to get a list of available commands.", cmd[1] ); 549 510 } 550 511 } … … 557 518 if( g_strcasecmp( cmd[1], "-tmp" ) == 0 ) 558 519 { 559 MIN_ARGS( 3 );560 520 add_on_server = 0; 561 521 cmd ++; … … 877 837 static void cmd_set( irc_t *irc, char **cmd ) 878 838 { 879 cmd_set_real( irc, cmd, NULL, NULL ); 839 char *set_name = cmd[1]; 840 841 if( cmd[1] && cmd[2] ) 842 { 843 int st; 844 845 if( g_strncasecmp( cmd[1], "-del", 4 ) == 0 ) 846 { 847 st = set_reset( &irc->set, cmd[2] ); 848 set_name = cmd[2]; 849 } 850 else 851 { 852 st = set_setstr( &irc->set, cmd[1], cmd[2] ); 853 } 854 855 /* Normally we just show the variable's new/unchanged 856 value as feedback to the user, but this has always 857 caused confusion when changing the password. Give 858 other feedback instead: */ 859 if( set_getstr( &irc->set, set_name ) == NULL ) 860 { 861 if( st ) 862 irc_usermsg( irc, "Setting changed successfully" ); 863 else 864 irc_usermsg( irc, "Failed to change setting" ); 865 } 866 else 867 { 868 cmd_showset( irc, &irc->set, set_name ); 869 } 870 } 871 else if( set_name ) 872 { 873 cmd_showset( irc, &irc->set, set_name ); 874 875 if( strchr( set_name, '/' ) ) 876 irc_usermsg( irc, "Warning: / found in setting name, you're probably looking for the `account set' command." ); 877 } 878 else 879 { 880 set_t *s = irc->set; 881 while( s ) 882 { 883 cmd_showset( irc, &s, s->key ); 884 s = s->next; 885 } 886 } 880 887 } 881 888 … … 1000 1007 static void cmd_join_chat( irc_t *irc, char **cmd ) 1001 1008 { 1002 irc_usermsg( irc, "This command is now obsolete. "1003 "Please try the `chat' command instead." );1004 }1005 1006 static set_t **cmd_chat_set_findhead( irc_t *irc, char *id )1007 {1008 struct chat *c;1009 1010 if( ( c = chat_get( irc, id ) ) )1011 return &c->set;1012 else1013 return NULL;1014 }1015 1016 static void cmd_chat( irc_t *irc, char **cmd )1017 {1018 account_t *acc;1019 struct chat *c;1020 1021 if( g_strcasecmp( cmd[1], "add" ) == 0 )1022 {1023 char *channel, *s;1024 1025 MIN_ARGS( 3 );1026 1027 if( !( acc = account_get( irc, cmd[2] ) ) )1028 {1029 irc_usermsg( irc, "Invalid account" );1030 return;1031 }1032 1033 if( cmd[4] == NULL )1034 {1035 channel = g_strdup( cmd[3] );1036 if( ( s = strchr( channel, '@' ) ) )1037 *s = 0;1038 }1039 else1040 {1041 channel = g_strdup( cmd[4] );1042 }1043 1044 if( strchr( CTYPES, channel[0] ) == NULL )1045 {1046 s = g_strdup_printf( "%c%s", CTYPES[0], channel );1047 g_free( channel );1048 channel = s;1049 }1050 1051 if( ( c = chat_add( irc, acc, cmd[3], channel ) ) )1052 irc_usermsg( irc, "Chatroom added successfully." );1053 else1054 irc_usermsg( irc, "Could not add chatroom." );1055 1056 g_free( channel );1057 }1058 else if( g_strcasecmp( cmd[1], "list" ) == 0 )1059 {1060 int i = 0;1061 1062 if( strchr( irc->umode, 'b' ) )1063 irc_usermsg( irc, "Chatroom list:" );1064 1065 for( c = irc->chatrooms; c; c = c->next )1066 {1067 irc_usermsg( irc, "%2d. %s(%s) %s, %s", i, c->acc->prpl->name,1068 c->acc->user, c->handle, c->channel );1069 1070 i ++;1071 }1072 irc_usermsg( irc, "End of chatroom list" );1073 }1074 else if( g_strcasecmp( cmd[1], "set" ) == 0 )1075 {1076 MIN_ARGS( 2 );1077 1078 cmd_set_real( irc, cmd + 1, cmd_chat_set_findhead, NULL );1079 }1080 else if( g_strcasecmp( cmd[1], "del" ) == 0 )1081 {1082 MIN_ARGS( 2 );1083 1084 if( ( c = chat_get( irc, cmd[2] ) ) )1085 {1086 chat_del( irc, c );1087 }1088 else1089 {1090 irc_usermsg( irc, "Could not remove chat." );1091 }1092 }1093 else if( g_strcasecmp( cmd[1], "with" ) == 0 )1094 {1095 user_t *u;1096 1097 MIN_ARGS( 2 );1098 1099 if( ( u = user_find( irc, cmd[2] ) ) && u->ic && u->ic->acc->prpl->chat_with )1100 {1101 if( !u->ic->acc->prpl->chat_with( u->ic, u->handle ) )1102 {1103 irc_usermsg( irc, "(Possible) failure while trying to open "1104 "a groupchat with %s.", u->nick );1105 }1106 }1107 else1108 {1109 irc_usermsg( irc, "Can't open a groupchat with %s.", cmd[2] );1110 }1111 }1112 else1113 {1114 irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "chat", cmd[1] );1115 }1116 1117 1118 1119 #if 01120 1009 account_t *a; 1121 1010 struct im_connection *ic; … … 1143 1032 if( cmd[3] ) 1144 1033 { 1145 if( strchr( CTYPES, cmd[3][0] ) == NULL)1034 if( cmd[3][0] != '#' && cmd[3][0] != '&' ) 1146 1035 channel = g_strdup_printf( "&%s", cmd[3] ); 1147 1036 else … … 1186 1075 g_free( channel ); 1187 1076 } 1188 #endif1189 1077 } 1190 1078 … … 1209 1097 { "qlist", 0, cmd_qlist, 0 }, 1210 1098 { "join_chat", 2, cmd_join_chat, 0 }, 1211 { "chat", 1, cmd_chat, 0 },1212 1099 { NULL } 1213 1100 }; -
storage_xml.c
rc5bc47b r0c41177 54 54 char *current_setting; 55 55 account_t *current_account; 56 struct chat *current_chat;57 set_t **current_set_head;58 56 char *given_nick; 59 57 char *given_pass; … … 174 172 175 173 if( ( setting = xml_attr( attr_names, attr_values, "name" ) ) ) 176 {177 if( xd->current_chat != NULL )178 xd->current_set_head = &xd->current_chat->set;179 else if( xd->current_account != NULL )180 xd->current_set_head = &xd->current_account->set;181 else182 xd->current_set_head = &xd->irc->set;183 184 174 xd->current_setting = g_strdup( setting ); 185 }186 175 else 187 176 g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, … … 205 194 } 206 195 } 207 else if( g_strcasecmp( element_name, "chat" ) == 0 )208 {209 char *handle, *channel;210 211 handle = xml_attr( attr_names, attr_values, "handle" );212 channel = xml_attr( attr_names, attr_values, "channel" );213 214 if( xd->current_account && handle && channel )215 {216 xd->current_chat = chat_add( xd->irc, xd->current_account, handle, channel );217 }218 else219 {220 g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,221 "Missing attributes for %s element", element_name );222 }223 }224 196 else 225 197 { … … 242 214 xd->current_account = NULL; 243 215 } 244 else if( g_strcasecmp( element_name, "chat" ) == 0 )245 {246 xd->current_chat = NULL;247 }248 216 } 249 217 … … 252 220 char text[text_len+1]; 253 221 struct xml_parsedata *xd = data; 222 irc_t *irc = xd->irc; 254 223 255 224 strncpy( text, text_orig, text_len ); … … 264 233 else if( g_strcasecmp( g_markup_parse_context_get_element( ctx ), "setting" ) == 0 && xd->current_setting ) 265 234 { 266 set_setstr( xd->current_set_head, xd->current_setting, (char*) text ); 235 set_setstr( xd->current_account ? &xd->current_account->set : &irc->set, 236 xd->current_setting, (char*) text ); 267 237 g_free( xd->current_setting ); 268 238 xd->current_setting = NULL; … … 427 397 428 398 for( set = irc->set; set; set = set->next ) 429 if( set->value )399 if( set->value && set->def ) 430 400 if( !xml_printf( fd, 1, "<setting name=\"%s\">%s</setting>\n", set->key, set->value ) ) 431 401 goto write_error; … … 436 406 char *pass_b64; 437 407 int pass_len; 438 struct chat *c;439 408 440 409 pass_len = arc_encode( acc->pass, strlen( acc->pass ), (unsigned char**) &pass_cr, irc->password, 12 ); … … 455 424 456 425 for( set = acc->set; set; set = set->next ) 457 if( set->value && !( set->flags & ACC_SET_NOSAVE ) )426 if( set->value && set->def && !( set->flags & ACC_SET_NOSAVE ) ) 458 427 if( !xml_printf( fd, 2, "<setting name=\"%s\">%s</setting>\n", set->key, set->value ) ) 459 428 goto write_error; … … 469 438 goto write_error; 470 439 471 for( c = irc->chatrooms; c; c = c->next )472 {473 if( c->acc != acc )474 continue;475 476 if( !xml_printf( fd, 2, "<chat handle=\"%s\" channel=\"%s\" type=\"%s\">\n",477 c->handle, c->channel, "room" ) )478 goto write_error;479 480 for( set = c->set; set; set = set->next )481 if( set->value && !( set->flags & ACC_SET_NOSAVE ) )482 if( !xml_printf( fd, 3, "<setting name=\"%s\">%s</setting>\n",483 set->key, set->value ) )484 goto write_error;485 486 if( !xml_printf( fd, 2, "</chat>\n" ) )487 goto write_error;488 }489 490 440 if( !xml_printf( fd, 1, "</account>\n" ) ) 491 441 goto write_error; -
tests/Makefile
rc5bc47b r0c41177 11 11 distclean: clean 12 12 13 main_objs = account.o bitlbee.o c hat.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.o13 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 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 -
tests/check_set.c
rc5bc47b r0c41177 96 96 END_TEST 97 97 98 START_TEST(test_setstr_implicit) 99 void *data = "data"; 100 set_t *s = NULL, *t; 101 set_setstr(&s, "name", "bloe"); 102 fail_unless(set_find(&s, "name") != NULL); 103 END_TEST 104 98 105 START_TEST(test_set_get_int_unknown) 99 106 set_t *s = NULL; … … 119 126 tcase_add_test (tc_core, test_setint); 120 127 tcase_add_test (tc_core, test_setstr); 128 tcase_add_test (tc_core, test_setstr_implicit); 121 129 return s; 122 130 } -
user.c
rc5bc47b r0c41177 141 141 } 142 142 143 user_t *user_findhandle( struct im_connection *ic, c onst char *handle )143 user_t *user_findhandle( struct im_connection *ic, char *handle ) 144 144 { 145 145 user_t *u; -
user.h
rc5bc47b r0c41177 56 56 int user_del( irc_t *irc, char *nick ); 57 57 G_MODULE_EXPORT user_t *user_find( irc_t *irc, char *nick ); 58 G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, c onst char *handle );58 G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, char *handle ); 59 59 void user_rename( irc_t *irc, char *oldnick, char *newnick ); 60 60
Note: See TracChangeset
for help on using the changeset viewer.