comparison libpurple/protocols/msn/user.c @ 23478:31b5a1334e7e

Modifications to the MSN code for some stuff I'll be doing in later commits. * Rename MsnUserType to MsnNetwork, because it's a really a Network ID. Updated the list of networks based on msnpiki. * Updated list of Client capabilities based on ZoRoNaX' blog: http://zoronax.spaces.live.com/blog/cns!4A0B813054895814!156.entry * Save the clientid of contacts.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 15 Jun 2008 08:08:22 +0000
parents 5a6cf27ead31
children 4cb1efafa410
comparison
equal deleted inserted replaced
23477:fd124c21ebb7 23478:31b5a1334e7e
196 g_free(user->uid); 196 g_free(user->uid);
197 user->uid = g_strdup(uid); 197 user->uid = g_strdup(uid);
198 } 198 }
199 199
200 void 200 void
201 msn_user_set_type(MsnUser *user, MsnUserType type)
202 {
203 g_return_if_fail(user != NULL);
204
205 user->type = type;
206 }
207
208 void
209 msn_user_set_op(MsnUser *user, int list_op) 201 msn_user_set_op(MsnUser *user, int list_op)
210 { 202 {
211 g_return_if_fail(user != NULL); 203 g_return_if_fail(user != NULL);
212 204
213 user->list_op |= list_op; 205 user->list_op |= list_op;
306 if ((session != NULL) && (session->protocol_ver == WLM_PROT_VER)) 298 if ((session != NULL) && (session->protocol_ver == WLM_PROT_VER))
307 return FALSE; 299 return FALSE;
308 300
309 if ((session != NULL) && (user = msn_userlist_find_user(session->userlist, name)) != NULL) 301 if ((session != NULL) && (user = msn_userlist_find_user(session->userlist, name)) != NULL)
310 { 302 {
311 return (user->type == MSN_USER_TYPE_YAHOO); 303 return (user->networkid == MSN_NETWORK_YAHOO);
312 } 304 }
313 return (strstr(name,"@yahoo.") != NULL); 305 return (strstr(name,"@yahoo.") != NULL);
314 } 306 }
315 307
316 void 308 void
356 g_free(user->phone.mobile); 348 g_free(user->phone.mobile);
357 user->phone.mobile = g_strdup(number); 349 user->phone.mobile = g_strdup(number);
358 } 350 }
359 351
360 void 352 void
353 msn_user_set_clientid(MsnUser *user, guint clientid)
354 {
355 g_return_if_fail(user != NULL);
356
357 user->clientid = clientid;
358 }
359
360 void
361 msn_user_set_network(MsnUser *user, MsnNetwork network)
362 {
363 g_return_if_fail(user != NULL);
364
365 user->networkid = network;
366 }
367
368 void
361 msn_user_set_object(MsnUser *user, MsnObject *obj) 369 msn_user_set_object(MsnUser *user, MsnObject *obj)
362 { 370 {
363 g_return_if_fail(user != NULL); 371 g_return_if_fail(user != NULL);
364 372
365 if (user->msnobj != NULL) 373 if (user->msnobj != NULL)
421 g_return_val_if_fail(user != NULL, NULL); 429 g_return_val_if_fail(user != NULL, NULL);
422 430
423 return user->phone.mobile; 431 return user->phone.mobile;
424 } 432 }
425 433
434 guint
435 msn_user_get_clientid(const MsnUser *user)
436 {
437 g_return_val_if_fail(user != NULL, 0);
438
439 return user->clientid;
440 }
441
426 MsnObject * 442 MsnObject *
427 msn_user_get_object(const MsnUser *user) 443 msn_user_get_object(const MsnUser *user)
428 { 444 {
429 g_return_val_if_fail(user != NULL, NULL); 445 g_return_val_if_fail(user != NULL, NULL);
430 446