eion/purple-hangouts

Parents 924cec15530b
Children 97ddbfff660b
Don't re-add yourself when rebuilding the contacts list, if you've removed yourself
--- a/hangouts_conversation.c Wed Sep 19 08:13:45 2018 +1200
+++ b/hangouts_conversation.c Wed Sep 19 08:29:28 2018 +1200
@@ -1012,6 +1012,16 @@
photo = hangouts_json_path_query_string(node, "$.photo[*].url", NULL);
buddy = purple_blist_find_buddy(ha->account, name);
+ if (purple_account_get_bool(ha->account, "hide_self", FALSE) && purple_strequal(ha->self_gaia_id, name)) {
+ if (buddy != NULL) {
+ purple_blist_remove_buddy(buddy);
+ }
+
+ g_free(alias);
+ g_free(photo);
+ continue;
+ }
+
if (buddy == NULL) {
if (hangouts_group == NULL) {
hangouts_group = purple_blist_find_group("Hangouts");
--- a/libhangouts.c Wed Sep 19 08:13:45 2018 +1200
+++ b/libhangouts.c Wed Sep 19 08:29:28 2018 +1200
@@ -90,6 +90,9 @@
option = purple_account_option_bool_new(N_("Treat invisible users as offline"), "treat_invisible_as_offline", FALSE);
account_options = g_list_append(account_options, option);
+ option = purple_account_option_bool_new(N_("Hide self from buddy list (requires reconnect)"), "hide_self", FALSE);
+ account_options = g_list_append(account_options, option);
+
return account_options;
}