|
@@ -63,7 +63,7 @@ GHashTable *id_to_chat;
|
|
|
/* Account ID to PurpleAccount */
|
|
|
GHashTable *id_to_account;
|
|
|
|
|
|
-/* Blist Chat ID -> bool isJoined*/
|
|
|
+/* Blist Chat ID set */
|
|
|
GHashTable *id_to_joined;
|
|
|
|
|
|
/* All known buddies/other users are maintained in a hash table from network
|
|
@@ -348,12 +348,11 @@ sapphire_process_message(Connection *conn, JsonObject *data)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- gboolean is_joined = (uintptr_t) g_hash_table_lookup(id_to_joined, id);
|
|
|
gboolean is_subscribed = g_hash_table_contains(conn->subscribed_ids, id);
|
|
|
|
|
|
- if (!is_joined) {
|
|
|
+ if (g_hash_table_contains(id_to_joined, id)) {
|
|
|
purple_roomlist_room_join(chat->roomlist, chat->room);
|
|
|
- g_hash_table_insert(id_to_joined, g_strdup(id), (void *) TRUE);
|
|
|
+ g_hash_table_add(id_to_joined, g_strdup(id));
|
|
|
} else if (!is_subscribed) {
|
|
|
/* If we already joined but not in this connection, just send back details */
|
|
|
|
|
@@ -1250,6 +1249,14 @@ sapphire_joined_chat(PurpleConversation *conv, gpointer null)
|
|
|
}
|
|
|
|
|
|
g_hash_table_insert(blist_id_to_conversation, id, conv);
|
|
|
+
|
|
|
+ /* It's joined! */
|
|
|
+
|
|
|
+ if (!g_hash_table_contains(id_to_joined, id)) {
|
|
|
+ g_hash_table_add(id_to_joined, g_strdup(id));
|
|
|
+ g_hash_table_insert(id_to_chat, g_strdup(id), schat);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/* Certain prpls, particularly those for third-party protocols, should be
|