diff options
author | Ted Gould <ted@canonical.com> | 2009-09-22 17:26:36 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-22 17:26:36 -0500 |
commit | 4b30518d4f8b96d95e004829e7a4ebed4b67930c (patch) | |
tree | 6621c8636f4b5d84166b36605fdb9bf2c7a358f3 | |
parent | 4ec8c425cac932ff2d30f7e46f6bd79142384a50 (diff) | |
download | ayatana-indicator-session-4b30518d4f8b96d95e004829e7a4ebed4b67930c.tar.gz ayatana-indicator-session-4b30518d4f8b96d95e004829e7a4ebed4b67930c.tar.bz2 ayatana-indicator-session-4b30518d4f8b96d95e004829e7a4ebed4b67930c.zip |
Putting in the TP Connection enum map
-rw-r--r-- | src/status-provider-mc5.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/status-provider-mc5.c b/src/status-provider-mc5.c index 8ee174b..0251675 100644 --- a/src/status-provider-mc5.c +++ b/src/status-provider-mc5.c @@ -32,7 +32,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <dbus/dbus-glib.h> -static gchar * sp_to_mc_map[] = { +static gchar * sp_to_mc_map[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_ONLINE, */ "available", /* STATUS_PROVIDER_STATUS_AWAY, */ "away", /* STATUS_PROVIDER_STATUS_DND */ "busy", @@ -41,7 +41,7 @@ static gchar * sp_to_mc_map[] = { /* STATUS_PROVIDER_STATUS_DISCONNECTED*/NULL }; -static TpConnectionPresenceType sp_to_tp_map[] = { +static TpConnectionPresenceType sp_to_tp_map[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_ONLINE, */ TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, /* STATUS_PROVIDER_STATUS_AWAY, */ TP_CONNECTION_PRESENCE_TYPE_AWAY, /* STATUS_PROVIDER_STATUS_DND */ TP_CONNECTION_PRESENCE_TYPE_BUSY, @@ -50,6 +50,18 @@ static TpConnectionPresenceType sp_to_tp_map[] = { /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ TP_CONNECTION_PRESENCE_TYPE_UNSET }; +static StatusProviderStatus tp_to_sp_map[TP_CONNECTION_PRESENCE_TYPE_ERROR + 1] = { + /* TP_CONNECTION_PRESENCE_TYPE_UNSET */ STATUS_PROVIDER_STATUS_DISCONNECTED, + /* TP_CONNECTION_PRESENCE_TYPE_OFFLINE */ STATUS_PROVIDER_STATUS_OFFLINE, + /* TP_CONNECTION_PRESENCE_TYPE_AVAILABLE */ STATUS_PROVIDER_STATUS_ONLINE, + /* TP_CONNECTION_PRESENCE_TYPE_AWAY */ STATUS_PROVIDER_STATUS_AWAY, + /* TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY */ STATUS_PROVIDER_STATUS_AWAY, + /* TP_CONNECTION_PRESENCE_TYPE_HIDDEN */ STATUS_PROVIDER_STATUS_INVISIBLE, + /* TP_CONNECTION_PRESENCE_TYPE_BUSY */ STATUS_PROVIDER_STATUS_DND, + /* TP_CONNECTION_PRESENCE_TYPE_UNKNOWN */ STATUS_PROVIDER_STATUS_DISCONNECTED, + /* TP_CONNECTION_PRESENCE_TYPE_ERROR */ STATUS_PROVIDER_STATUS_DISCONNECTED +}; + typedef struct _StatusProviderMC5Private StatusProviderMC5Private; struct _StatusProviderMC5Private { EmpathyAccountManager * manager; @@ -176,7 +188,7 @@ presence_changed (EmpathyAccountManager * eam, guint type, const gchar * type_st g_debug("MC5 Status changed: %d %s %s", type, type_str, message); - priv->status = type; + priv->status = tp_to_sp_map[type]; return; } |