* src/view/message-list-view.c (_selected_changed): Handle message
"New" value as a boolean, as well as as int32. (Messages that were
written into the database by SHR-T will have a boolean New value,
whereas messages written by SHR-U have an int32 New value.)
(gl_state_get): Same again.
(_process_message): Check that the @Contacts value is an
int32. before assuming that. (Messages that were written into the
database by SHR-T have type "ai" here. It doesn't appear to matter
that we don't call phoneui_utils_contact_get() for those messages.)
---
src/view/message-list-view.c | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/view/message-list-view.c b/src/view/message-list-view.c
index eff9300..014b94a 100644
--- a/src/view/message-list-view.c
+++ b/src/view/message-list-view.c
@@ -508,9 +508,14 @@ _selected_changed(void *_data, Evas_Object * obj, void
*event_info) {
}
if ((tmp = g_hash_table_lookup(message, "New"))) {
- // FIXME: shouldn't this be boolean ?
- if (g_variant_get_int32(tmp) == 1) {
- new = EINA_TRUE;
+ if (g_variant_is_of_type (tmp, G_VARIANT_TYPE_BOOLEAN)) {
+ if (g_variant_get_boolean(tmp) == TRUE) {
+ new = EINA_TRUE;
+ }
+ } else {
+ if (g_variant_get_int32(tmp) == 1) {
+ new = EINA_TRUE;
+ }
}
}
@@ -764,10 +769,12 @@ _process_message(gpointer _message, gpointer _data)
tmp = g_hash_table_lookup(message, "@Contacts");
if (tmp) {
- char *path = phoneui_utils_contact_get_dbus_path
- (g_variant_get_int32(tmp));
- phoneui_utils_contact_get(path, _contact_lookup, it);
- free(path);
+ if (g_variant_is_of_type(tmp, G_VARIANT_TYPE_INT32)) {
+ char *path = phoneui_utils_contact_get_dbus_path
+ (g_variant_get_int32(tmp));
+ phoneui_utils_contact_get(path, _contact_lookup, it);
+ free(path);
+ }
}
g_hash_table_destroy(message);
@@ -899,8 +906,11 @@ gl_state_get(void *data, Evas_Object *obj, const char
*part)
}
if ((tmp = g_hash_table_lookup(message, "New"))) {
- // FIXME: shouldn't be boolean?
- new = (g_variant_get_int32(tmp) == 1);
+ if (g_variant_is_of_type (tmp, G_VARIANT_TYPE_BOOLEAN)) {
+ new = (g_variant_get_boolean(tmp) == TRUE);
+ } else {
+ new = (g_variant_get_int32(tmp) == 1);
+ }
}
if ((tmp = g_hash_table_lookup(message, "SMS-delivered"))) {
--
1.7.1
_______________________________________________
Shr-devel mailing list
[email protected]
http://lists.shr-project.org/mailman/listinfo/shr-devel