Added chlog preference for chat logging

This commit is contained in:
James Booth
2012-07-22 23:07:34 +01:00
parent a3efcb7e05
commit 6b697054b6
5 changed files with 47 additions and 13 deletions

View File

@@ -166,10 +166,11 @@ void jabber_send(const char * const msg, const char * const recipient)
free(coded_msg);
free(coded_msg2);
free(coded_msg3);
const char *jid = xmpp_conn_get_jid(jabber_conn.conn);
chat_log_chat(jid, (char *)recipient, msg, OUT);
if (prefs_get_chlog()) {
const char *jid = xmpp_conn_get_jid(jabber_conn.conn);
chat_log_chat(jid, (char *)recipient, msg, OUT);
}
}
void jabber_roster_request(void)
@@ -255,13 +256,14 @@ static int _jabber_message_handler(xmpp_conn_t * const conn,
win_show_incomming_msg(from, message);
win_page_off();
char from_cpy[strlen(from) + 1];
strcpy(from_cpy, from);
char *short_from = strtok(from_cpy, "/");
const char *jid = xmpp_conn_get_jid(jabber_conn.conn);
chat_log_chat(jid, short_from, message, IN);
if (prefs_get_chlog()) {
char from_cpy[strlen(from) + 1];
strcpy(from_cpy, from);
char *short_from = strtok(from_cpy, "/");
const char *jid = xmpp_conn_get_jid(jabber_conn.conn);
chat_log_chat(jid, short_from, message, IN);
}
return 1;
}