Commit 9146e737 authored by Andrea Schaefer's avatar Andrea Schaefer

Fix several issues mentioned in the MR comments

parent 322f556d
......@@ -516,18 +516,20 @@ cb_do_autojoin (PurpleConnection *gc, gpointer null)
static gint
cb_chatty_blist_sort_contacts (GtkListBoxRow *row1,
GtkListBoxRow *row2,
gpointer user_data)
gpointer user_data)
{
const char *name1, *name2;
char *name1, *name2;
int result;
g_object_get (row1, "name", &name1, NULL);
g_object_get (row2, "name", &name2, NULL);
if (g_strcmp0 (name1, name2) > 0) {
return TRUE;
}
result = g_strcmp0 (name1, name2);
return FALSE;
g_free (name1);
g_free (name2);
return result;
}
// *** end callbacks
......@@ -1139,6 +1141,8 @@ chatty_blist_create_contact_list (void)
if (purple_accounts_find ("SMS", "prpl-mm-sms")) {
chatty_folks_init (chatty_get_contacts_list ());
}
}
......
......@@ -71,19 +71,22 @@ cb_update_row (FolksIndividual *individual,
if (gee_map_get (chatty_folks->individuals, id)) {
for (l = rows; l; l = l->next) {
g_object_get (l->data, "id", &row_id, NULL);
if (l->data != NULL) {
g_object_get (l->data, "id", &row_id, NULL);
if (!g_strcmp0 (id, row_id )) {
gtk_widget_destroy (GTK_WIDGET(l->data));
if (!g_strcmp0 (id, row_id )) {
gtk_widget_destroy (GTK_WIDGET(l->data));
}
}
}
}
chatty_folks_individual_add_contact_rows (individual);
chatty_folks_individual_add_contact_rows (individual);
gtk_list_box_invalidate_sort (chatty_folks->listbox);
gtk_list_box_invalidate_sort (chatty_folks->listbox);
g_list_free (l);
g_list_free (l);
g_list_free (rows);
}
}
......@@ -104,7 +107,17 @@ cb_aggregator_notify (FolksIndividualAggregator *aggregator,
individual = gee_map_iterator_get_value (iter);
g_signal_connect (G_OBJECT(individual),
"notify",
"notify::avatar",
G_CALLBACK (cb_update_row),
NULL);
g_signal_connect (G_OBJECT(individual),
"notify::display-name",
G_CALLBACK (cb_update_row),
NULL);
g_signal_connect (G_OBJECT(individual),
"notify::phone-numbers",
G_CALLBACK (cb_update_row),
NULL);
}
......@@ -122,7 +135,9 @@ cb_aggregator_individuals_changed (FolksIndividualAggregator *aggregator,
GeeSet *removed;
GeeCollection *added;
GList *rows, *l;
const char *id, *row_id;
const char *id;
char *row_id;
chatty_folks_data_t *chatty_folks = chatty_get_folks_data ();
......@@ -142,25 +157,22 @@ cb_aggregator_individuals_changed (FolksIndividualAggregator *aggregator,
continue;
}
if (gee_map_get (chatty_folks->individuals,
folks_individual_get_id (individual)) != NULL) {
id = folks_individual_get_id (individual);
id = folks_individual_get_id (individual);
for (l = rows; l; l = l->next) {
g_object_get (l->data, "id", &row_id, NULL);
if (!g_strcmp0 (id, row_id )) {
gtk_widget_destroy (GTK_WIDGET(l->data));
for (l = rows; l; l = l->next) {
g_object_get (l->data, "id", &row_id, NULL);
}
if (!g_strcmp0 (id, row_id ) && l->data != NULL) {
gtk_widget_destroy (GTK_WIDGET(l->data));
}
}
}
g_free (row_id);
g_list_free (l);
g_clear_object (&individual);
}
}
g_list_free (rows);
g_clear_object (&iter);
iter = gee_iterable_iterator (GEE_ITERABLE (added));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment