diff options
author | Ted Gould <ted@canonical.com> | 2009-09-04 16:12:17 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-04 16:12:17 -0500 |
commit | 5c2ee1f5f3604fa095f2e8c401fd71d02650067a (patch) | |
tree | 24fe076a606d880cbb4d035a1d8fb1903e66555b /src | |
parent | 43f6131be305835947b565d0afcc0dc11660e218 (diff) | |
download | ayatana-indicator-messages-5c2ee1f5f3604fa095f2e8c401fd71d02650067a.tar.gz ayatana-indicator-messages-5c2ee1f5f3604fa095f2e8c401fd71d02650067a.tar.bz2 ayatana-indicator-messages-5c2ee1f5f3604fa095f2e8c401fd71d02650067a.zip |
Making the sender support the name attribute and clean up the code a bit.
Diffstat (limited to 'src')
-rw-r--r-- | src/im-menu-item.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/im-menu-item.c b/src/im-menu-item.c index 75da527..5d397a5 100644 --- a/src/im-menu-item.c +++ b/src/im-menu-item.c @@ -258,13 +258,18 @@ sender_cb (IndicateListener * listener, IndicateListenerServer * server, Indicat { g_debug("Got Sender Information"); ImMenuItem * self = IM_MENU_ITEM(data); - if (self == NULL) { - g_error("Menu Item callback called without a menu item"); - return; - } - if (property == NULL || g_strcmp0(property, "sender")) { - g_warning("Sender callback called without being sent the sender. We got '%s' with value '%s'.", property, propertydata); + /* Our data should be right */ + g_return_if_fail(self != NULL); + /* We should have a property name */ + g_return_if_fail(property != NULL); + /* The Property should be sender or name */ + g_return_if_fail(!g_strcmp0(property, "sender") || !g_strcmp0(property, INDICATE_INDICATOR_MESSAGES_PROP_NAME)); + + /* We might get the sender variable returning a + null string as it doesn't exist on newer clients + but we don't want to listen to that. */ + if (!g_strcmp0(property, "sender") && property[0] == '\0') { return; } |