Merge branch 'master' into openpgp

Conflicts:
	.travis.yml
This commit is contained in:
James Booth
2015-06-05 23:02:56 +01:00
82 changed files with 968 additions and 53 deletions

View File

@@ -57,6 +57,8 @@ struct curl_data_t
size_t size;
};
static unsigned long unique_id = 0;
static size_t _data_callback(void *ptr, size_t size, size_t nmemb, void *data);
// taken from glib 2.30.3
@@ -469,7 +471,6 @@ xdg_get_data_home(void)
char *
create_unique_id(char *prefix)
{
static unsigned long unique_id;
char *result = NULL;
GString *result_str = g_string_new("");
@@ -485,6 +486,12 @@ create_unique_id(char *prefix)
return result;
}
void
reset_unique_id(void)
{
unique_id = 0;
}
char *
p_sha1_hash(char *str)
{

View File

@@ -127,6 +127,7 @@ contact_presence_t contact_presence_from_resource_presence(resource_presence_t r
char * p_sha1_hash(char *str);
char * create_unique_id(char *prefix);
void reset_unique_id(void);
int cmp_win_num(gconstpointer a, gconstpointer b);
int get_next_available_win_num(GList *used);

View File

@@ -82,7 +82,7 @@ prefs_load(void)
{
GError *err;
log_info("Loading preferences");
// log_info("Loading preferences");
prefs_loc = _get_preferences_file();
if (g_file_test(prefs_loc, G_FILE_TEST_EXISTS)) {
@@ -743,4 +743,4 @@ _get_default_string(preference_t pref)
default:
return NULL;
}
}
}

View File

@@ -207,12 +207,15 @@ theme_close(void)
{
if (theme) {
g_key_file_free(theme);
theme = NULL;
}
if (theme_loc) {
g_string_free(theme_loc, TRUE);
theme_loc = NULL;
}
if (bold_items) {
g_hash_table_destroy(bold_items);
bold_items = NULL;
}
}
@@ -614,4 +617,4 @@ theme_attrs(theme_item_t attrs)
return result;
}
}
}

View File

@@ -107,4 +107,4 @@ cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char * const msg)
{
message_send_private(privwin->fulljid, msg);
ui_outgoing_private_msg(privwin, msg);
}
}

View File

@@ -163,6 +163,8 @@ otr_init(void)
log_info("Initialising OTR");
OTRL_INIT;
jid = NULL;
ops.policy = cb_policy;
ops.is_logged_in = cb_is_logged_in;
ops.inject_message = cb_inject_message;
@@ -181,6 +183,7 @@ otr_shutdown(void)
{
if (jid) {
free(jid);
jid = NULL;
}
}
@@ -642,7 +645,8 @@ otr_get_their_fingerprint(const char * const recipient)
prof_otrpolicy_t
otr_get_policy(const char * const recipient)
{
ProfAccount *account = accounts_get_account(jabber_get_account_name());
char *account_name = jabber_get_account_name();
ProfAccount *account = accounts_get_account(account_name);
// check contact specific setting
if (g_list_find_custom(account->otr_manual, recipient, (GCompareFunc)g_strcmp0)) {
account_free(account);
@@ -747,4 +751,4 @@ void
otr_free_message(char *message)
{
otrl_message_free(message);
}
}

View File

@@ -103,7 +103,7 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
otr_poll();
#endif
notify_remind();
jabber_process_events();
jabber_process_events(10);
ui_update();
}
}

View File

@@ -35,6 +35,8 @@
#ifndef UI_WINDOWS_H
#define UI_WINDOWS_H
#include "ui/window.h"
void wins_init(void);
ProfWin * wins_new_xmlconsole(void);

View File

@@ -194,7 +194,7 @@ jabber_disconnect(void)
xmpp_disconnect(jabber_conn.conn);
while (jabber_get_connection_status() == JABBER_DISCONNECTING) {
jabber_process_events();
jabber_process_events(10);
}
_connection_free_saved_account();
_connection_free_saved_details();
@@ -222,10 +222,11 @@ jabber_shutdown(void)
_connection_free_session_data();
xmpp_shutdown();
free(jabber_conn.log);
jabber_conn.log = NULL;
}
void
jabber_process_events(void)
jabber_process_events(int millis)
{
int reconnect_sec;
@@ -234,7 +235,7 @@ jabber_process_events(void)
case JABBER_CONNECTED:
case JABBER_CONNECTING:
case JABBER_DISCONNECTING:
xmpp_run_once(jabber_conn.ctx, 10);
xmpp_run_once(jabber_conn.ctx, millis);
break;
case JABBER_DISCONNECTED:
reconnect_sec = prefs_get_reconnect();
@@ -577,4 +578,4 @@ _xmpp_get_file_logger()
file_log->userdata = &level;
return file_log;
}
}

View File

@@ -136,7 +136,7 @@ jabber_conn_status_t jabber_connect_with_details(const char * const jid,
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account);
void jabber_disconnect(void);
void jabber_shutdown(void);
void jabber_process_events(void);
void jabber_process_events(int millis);
const char * jabber_get_fulljid(void);
const char * jabber_get_domain(void);
jabber_conn_status_t jabber_get_connection_status(void);