diff options
author | Alberto Mardegan <mardy@users.sourceforge.net> | 2008-07-21 07:53:09 +0000 |
---|---|---|
committer | Alberto Mardegan <mardy@users.sourceforge.net> | 2008-07-21 07:53:09 +0000 |
commit | 43a825d09cd8ca1e446e98f81552e0b7266bc9ce (patch) | |
tree | 39351f9724a5e8b09fc66d9b3bade8b290c0164b | |
parent | 8da57097accf8ed50b636e476d6fd51c20c6eeb1 (diff) |
Allow the various *_get_presence() methods to pass NULL for those
fields the caller is not interested in.
git-svn-id: https://mission-control.svn.sourceforge.net/svnroot/mission-control/trunk@509 d91c8aed-3f2b-0410-a83d-924a1c20a0ba
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | libmcclient/mc-account.c | 51 |
2 files changed, 40 insertions, 15 deletions
@@ -1,5 +1,9 @@ 2008-07-21 Alberto Mardegan <alberto.mardegan@nokia.com> + * libmcclient/mc-account.c: + Allow the various *_get_presence() methods to pass NULL for those + fields the caller is not interested in. + * libmcclient/mc-account-manager.c: Free the Manager properties on finalization, that were being leaked. diff --git a/libmcclient/mc-account.c b/libmcclient/mc-account.c index ea9c4708..82664730 100644 --- a/libmcclient/mc-account.c +++ b/libmcclient/mc-account.c @@ -835,13 +835,20 @@ mc_account_get_automatic_presence (McAccount *account, props = account->priv->props; if (G_UNLIKELY (!props)) { - *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; - *status = *message = NULL; + if (type) + *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; + if (status) + *status = NULL; + if (message) + *message = NULL; return; } - *type = props->auto_presence_type; - *status = props->auto_presence_status; - *message = props->auto_presence_message; + if (type) + *type = props->auto_presence_type; + if (status) + *status = props->auto_presence_status; + if (message) + *message = props->auto_presence_message; } /** @@ -922,13 +929,20 @@ mc_account_get_current_presence (McAccount *account, props = account->priv->props; if (G_UNLIKELY (!props)) { - *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; - *status = *message = NULL; + if (type) + *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; + if (status) + *status = NULL; + if (message) + *message = NULL; return; } - *type = props->curr_presence_type; - *status = props->curr_presence_status; - *message = props->curr_presence_message; + if (type) + *type = props->curr_presence_type; + if (status) + *status = props->curr_presence_status; + if (message) + *message = props->curr_presence_message; } /** @@ -956,13 +970,20 @@ mc_account_get_requested_presence (McAccount *account, props = account->priv->props; if (G_UNLIKELY (!props)) { - *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; - *status = *message = NULL; + if (type) + *type = TP_CONNECTION_PRESENCE_TYPE_UNSET; + if (status) + *status = NULL; + if (message) + *message = NULL; return; } - *type = props->req_presence_type; - *status = props->req_presence_status; - *message = props->req_presence_message; + if (type) + *type = props->req_presence_type; + if (status) + *status = props->req_presence_status; + if (message) + *message = props->req_presence_message; } /** |