Mercurial > pidgin.yaz
changeset 6788:c1995194e3d1
[gaim-migrate @ 7327]
MsnUser can now store a MsnObject.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 07 Sep 2003 23:53:52 +0000 |
parents | faa491042c66 |
children | 94b575afb77e |
files | src/protocols/msn/user.c src/protocols/msn/user.h |
diffstat | 2 files changed, 47 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/msn/user.c Sun Sep 07 23:47:00 2003 +0000 +++ b/src/protocols/msn/user.c Sun Sep 07 23:53:52 2003 +0000 @@ -187,6 +187,28 @@ user->phone.mobile = (number == NULL ? NULL : g_strdup(number)); } +void +msn_user_set_object(MsnUser *user, MsnObject *obj) +{ + g_return_if_fail(user != NULL); + + if (user->msnobj != NULL) + msn_object_destroy(user->msnobj); + + user->msnobj = obj; +} + +void +msn_user_set_client_caps(MsnUser *user, GHashTable *info) +{ + g_return_if_fail(user != NULL); + g_return_if_fail(info != NULL); + + if (user->clientcaps != NULL) + g_hash_table_destroy(user->clientcaps); + + user->clientcaps = info; +} const char * msn_user_get_passport(const MsnUser *user) @@ -236,16 +258,12 @@ return user->phone.mobile; } -void -msn_user_set_client_caps(MsnUser *user, GHashTable *info) +MsnObject * +msn_user_get_object(const MsnUser *user) { - g_return_if_fail(user != NULL); - g_return_if_fail(info != NULL); + g_return_val_if_fail(user != NULL, NULL); - if (user->clientcaps != NULL) - g_hash_table_destroy(user->clientcaps); - - user->clientcaps = info; + return user->msnobj; } GHashTable *
--- a/src/protocols/msn/user.h Sun Sep 07 23:47:00 2003 +0000 +++ b/src/protocols/msn/user.h Sun Sep 07 23:53:52 2003 +0000 @@ -176,6 +176,23 @@ void msn_user_set_mobile_phone(MsnUser *user, const char *number); /** + * Sets the MSNObject for a user. + * + * @param user The user. + * @param obj The MSNObject. + */ +void msn_user_set_object(MsnUser *user, MsnObject *obj); + +/** + * Sets the client information for a user. + * + * @param user The user. + * @param info The client information. + */ +void msn_user_set_client_caps(MsnUser *user, GHashTable *info); + + +/** * Returns the passport account for a user. * * @param user The user. @@ -230,12 +247,13 @@ const char *msn_user_get_mobile_phone(const MsnUser *user); /** - * Sets the client information for a user. + * Returns the MSNObject for a user. * * @param user The user. - * @param info The client information. + * + * @return The MSNObject. */ -void msn_user_set_client_caps(MsnUser *user, GHashTable *info); +MsnObject *msn_user_get_object(const MsnUser *user); /** * Returns the client information for a user.