From 1cf20b24911c3e02b4d29adc9499680cac449bc0 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 20 Jun 2013 17:50:20 +0100 Subject: [PATCH] Start chat session on /msg with no message parameter fixes #173 --- src/command/command.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/command/command.c b/src/command/command.c index 2e6d1a12..72b95f9a 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -2118,6 +2118,20 @@ _cmd_msg(gchar **args, struct cmd_help_t help) return TRUE; } else { + const char * jid = NULL; + + if (roster_barejid_from_name(usr_jid) != NULL) { + jid = roster_barejid_from_name(usr_jid); + } else { + jid = usr_jid; + } + + if (prefs_get_boolean(PREF_STATES)) { + if (!chat_session_exists(jid)) { + chat_session_start(jid, TRUE); + } + } + ui_new_chat_win(usr_jid); return TRUE; }