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

Added chat_session_on_window_open

This commit is contained in:
James Booth 2014-12-28 23:56:48 +00:00
parent ac4b59eda0
commit 671ee0b876
3 changed files with 13 additions and 12 deletions

View File

@ -277,6 +277,16 @@ chat_session_on_message_send(const char * const barejid)
return send_state; return send_state;
} }
void
chat_session_on_window_open(const char * const barejid)
{
if (prefs_get_boolean(PREF_STATES)) {
if (!chat_session_exists(barejid)) {
chat_session_new(barejid, TRUE);
}
}
}
static void static void
_chat_session_free(ChatSession *session) _chat_session_free(ChatSession *session)
{ {

View File

@ -57,5 +57,6 @@ void chat_session_set_gone(const char * const recipient);
void chat_session_set_sent(const char * const recipient); void chat_session_set_sent(const char * const recipient);
gboolean chat_session_get_sent(const char * const recipient); gboolean chat_session_get_sent(const char * const recipient);
gboolean chat_session_on_message_send(const char * const barejid); gboolean chat_session_on_message_send(const char * const barejid);
void chat_session_on_window_open(const char * const barejid);
#endif #endif

View File

@ -1231,12 +1231,7 @@ cmd_msg(gchar **args, struct cmd_help_t help)
#endif #endif
} else { // msg == NULL } else { // msg == NULL
if (prefs_get_boolean(PREF_STATES)) { chat_session_on_window_open(barejid);
if (!chat_session_exists(barejid)) {
chat_session_new(barejid, TRUE);
}
}
ui_new_chat_win(barejid); ui_new_chat_win(barejid);
#ifdef HAVE_LIBOTR #ifdef HAVE_LIBOTR
if (otr_is_secure(barejid)) { if (otr_is_secure(barejid)) {
@ -3905,12 +3900,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
barejid = contact; barejid = contact;
} }
if (prefs_get_boolean(PREF_STATES)) { chat_session_on_window_open(barejid);
if (!chat_session_exists(barejid)) {
chat_session_new(barejid, TRUE);
}
}
ui_new_chat_win(barejid); ui_new_chat_win(barejid);
if (ui_current_win_is_otr()) { if (ui_current_win_is_otr()) {