diff options
author | Ted Gould <ted@canonical.com> | 2009-09-10 12:24:05 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-10 12:24:05 -0500 |
commit | 6fa2a0c95d455ba4eb0a310b0314fb493a6148da (patch) | |
tree | e1e87d844fb911a4b6e24821370e14c39d9329b6 /src/status-provider-pidgin.c | |
parent | 935d113e94596808eb0db0cf1719905b68c237d3 (diff) | |
download | ayatana-indicator-session-6fa2a0c95d455ba4eb0a310b0314fb493a6148da.tar.gz ayatana-indicator-session-6fa2a0c95d455ba4eb0a310b0314fb493a6148da.tar.bz2 ayatana-indicator-session-6fa2a0c95d455ba4eb0a310b0314fb493a6148da.zip |
Adding disconnected to the pidgin handler.
Diffstat (limited to 'src/status-provider-pidgin.c')
-rw-r--r-- | src/status-provider-pidgin.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/status-provider-pidgin.c b/src/status-provider-pidgin.c index 052ce12..e65dc54 100644 --- a/src/status-provider-pidgin.c +++ b/src/status-provider-pidgin.c @@ -59,7 +59,8 @@ static const pg_status_t sp_to_pg_map[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_AWAY, */ PG_STATUS_AWAY, /* STATUS_PROVIDER_STATUS_DND */ PG_STATUS_UNAVAILABLE, /* STATUS_PROVIDER_STATUS_INVISIBLE*/ PG_STATUS_INVISIBLE, - /* STATUS_PROVIDER_STATUS_OFFLINE */ PG_STATUS_OFFLINE + /* STATUS_PROVIDER_STATUS_OFFLINE */ PG_STATUS_OFFLINE, + /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ PG_STATUS_OFFLINE }; typedef struct _StatusProviderPidginPrivate StatusProviderPidginPrivate; @@ -346,11 +347,17 @@ set_status (StatusProvider * sp, StatusProviderStatus status) } /* Takes the cached Pidgin status and makes it into the generic - Status provider status */ + Status provider status. If there is no Pidgin proxy then it + returns the disconnected state. */ static StatusProviderStatus get_status (StatusProvider * sp) { - g_return_val_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp), STATUS_PROVIDER_STATUS_OFFLINE); + g_return_val_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(sp); + + if (priv->proxy == NULL) { + return STATUS_PROVIDER_STATUS_DISCONNECTED; + } + return pg_to_sp_map[priv->pg_status]; } |