Changeset 644
- Timestamp:
- 07/26/05 22:00:46 (3 years ago)
- Files:
-
- trunk/src/users.c (modified) (7 diffs)
- trunk/src/users.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/users.c
r642 r644 23 23 #include <time.h> 24 24 #include <locale.h> 25 #include <stdlib.h> 25 26 #include "ggtrans.h" 26 27 #include "jabber.h" … … 155 156 } 156 157 xml=xmlnode_new_tag("user"); 158 tag=xmlnode_insert_tag(xml,"version"); 159 str=g_strdup_printf("%08x",USER_FILE_FORMAT_VERSION); 160 xmlnode_put_attrib(tag,"file_format",str); 161 g_free(str); 157 162 tag=xmlnode_insert_tag(xml,"jid"); 158 163 xmlnode_insert_cdata(tag,u->jid,-1); … … 253 258 char *status,*offline_status,*invisible_status; 254 259 int last_sys_msg=0,invisible=0,friends_only=0,ignore_unknown=0; 260 unsigned int file_format_version=0; 255 261 User *u; 256 262 GList *contacts; … … 273 279 } 274 280 g_free(fn); 281 tag=xmlnode_get_tag(xml,"jid"); 282 if (tag!=NULL) { 283 p=xmlnode_get_data(tag); 284 if (p!=NULL) file_format_version=(unsigned int)strtol(p,NULL,16); 285 } 275 286 tag=xmlnode_get_tag(xml,"jid"); 276 287 if (tag!=NULL) ujid=xmlnode_get_data(tag); … … 333 344 334 345 for(t=xmlnode_get_firstchild(tag);t;t=xmlnode_get_nextsibling(t)){ 335 if (!strcmp(xmlnode_get_name(t),"uin")){ 346 char *node_name; 347 node_name=xmlnode_get_name(t); 348 if (!node_name) continue; 349 if (!strcmp(node_name,"uin")){ 336 350 char *d; 337 351 int uin; … … 348 362 continue; 349 363 } 350 if (!strcmp( xmlnode_get_name(t),"contact")){364 if (!strcmp(node_name,"contact")){ 351 365 char *d; 352 366 int uin; … … 375 389 break; 376 390 case 't': 377 c->subscribe=SUB_TO; 391 /* version 2.2.0 has a bug which causes 392 * SUB_BOTH to be changed to SUB_TO 393 * this will force resynchronisation with 394 * user's roster. User will be asked for 395 * subscription authorisation if the 396 * subscription was really "to" 397 */ 398 if (file_format_version<=0x02020000) c->subscribe=SUB_UNDEFINED; 399 else c->subscribe=SUB_TO; 378 400 break; 379 401 case 'b': trunk/src/users.h
r642 r644 22 22 23 23 #include <libgadu.h> 24 25 #define USER_FILE_FORMAT_VERSION 0x02020001U /* first change after 2.2.0 */ 24 26 25 27 typedef enum subscription_type_e {
