summaryrefslogtreecommitdiffstats
path: root/src/NotificationProxy.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-11-11 21:26:33 +0100
committerGravatar Martin Szulecki2009-11-11 21:26:33 +0100
commitfea0152549d5e77f914f75c0ac315f30f9e26426 (patch)
tree4d7064468d46a4d4dfbae7dfa9b0e7d812aeecda /src/NotificationProxy.c
parentd4bdab8bd7cc5030341d2bf13dbd006fc13a6a1c (diff)
parent28d1fcac0eda09e829ef8c8b46fad0e45590af16 (diff)
downloadlibimobiledevice-fea0152549d5e77f914f75c0ac315f30f9e26426.tar.gz
libimobiledevice-fea0152549d5e77f914f75c0ac315f30f9e26426.tar.bz2
Merge branch 'master' of git://github.com/MattColyer/libiphone into martin
Diffstat (limited to 'src/NotificationProxy.c')
-rw-r--r--src/NotificationProxy.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/NotificationProxy.c b/src/NotificationProxy.c
index ee2ad95..884be5f 100644
--- a/src/NotificationProxy.c
+++ b/src/NotificationProxy.c
@@ -318,35 +318,27 @@ static int np_get_notification(np_client_t client, char **notification)
return -2;
}
- plist_t cmd_key_node = plist_find_node_by_key(dict, "Command");
- plist_t cmd_value_node = plist_get_next_sibling(cmd_key_node);
char *cmd_value = NULL;
+ plist_t cmd_value_node = plist_dict_get_item(dict, "Command");
if (plist_get_node_type(cmd_value_node) == PLIST_STRING) {
plist_get_string_val(cmd_value_node, &cmd_value);
}
if (cmd_value && !strcmp(cmd_value, "RelayNotification")) {
- plist_t name_key_node = plist_get_next_sibling(cmd_value_node);
- plist_t name_value_node = plist_get_next_sibling(name_key_node);
-
- char *name_key = NULL;
char *name_value = NULL;
+ plist_t name_value_node = plist_dict_get_item(dict, "Name");
- if (plist_get_node_type(name_key_node) == PLIST_KEY) {
- plist_get_key_val(name_key_node, &name_key);
- }
if (plist_get_node_type(name_value_node) == PLIST_STRING) {
plist_get_string_val(name_value_node, &name_value);
}
res = -2;
- if (name_key && name_value && !strcmp(name_key, "Name")) {
+ if (name_value_node && name_value) {
*notification = name_value;
log_debug_msg("%s: got notification %s\n", __func__, name_value);
res = 0;
}
- free(name_key);
} else if (cmd_value && !strcmp(cmd_value, "ProxyDeath")) {
log_debug_msg("%s: ERROR: NotificationProxy died!\n", __func__);
res = -1;