1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Removed bookmark autojoin limit

This commit is contained in:
James Booth 2014-11-20 22:33:46 +00:00
parent 81b1009fd9
commit 5030d49952

View File

@ -50,10 +50,6 @@
#include "ui/ui.h" #include "ui/ui.h"
#define BOOKMARK_TIMEOUT 5000 #define BOOKMARK_TIMEOUT 5000
/* TODO: replace with a preference */
#define BOOKMARK_AUTOJOIN_MAX 5
static int autojoin_count;
static Autocomplete bookmark_ac; static Autocomplete bookmark_ac;
static GList *bookmark_list; static GList *bookmark_list;
@ -76,7 +72,6 @@ bookmark_request(void)
id = strdup("bookmark_init_request"); id = strdup("bookmark_init_request");
autojoin_count = 0;
autocomplete_free(bookmark_ac); autocomplete_free(bookmark_ac);
bookmark_ac = autocomplete_new(); bookmark_ac = autocomplete_new();
if (bookmark_list != NULL) { if (bookmark_list != NULL) {
@ -330,11 +325,8 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
bookmark_list = g_list_append(bookmark_list, item); bookmark_list = g_list_append(bookmark_list, item);
if (autojoin_val) { if (autojoin_val) {
if (autojoin_count < BOOKMARK_AUTOJOIN_MAX) {
Jid *room_jid; Jid *room_jid;
++autojoin_count;
char *account_name = jabber_get_account_name(); char *account_name = jabber_get_account_name();
ProfAccount *account = accounts_get_account(account_name); ProfAccount *account = accounts_get_account(account_name);
if (name == NULL) { if (name == NULL) {
@ -349,9 +341,6 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
} }
jid_destroy(room_jid); jid_destroy(room_jid);
account_free(account); account_free(account);
} else {
log_debug("Rejected autojoin %s (maximum has been reached)", jid);
}
} }
ptr = xmpp_stanza_get_next(ptr); ptr = xmpp_stanza_get_next(ptr);