Open new chat win, or use existing for /otr start <contact>
This commit is contained in:
@@ -2331,6 +2331,21 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (strcmp(args[0], "start") == 0) {
|
} else if (strcmp(args[0], "start") == 0) {
|
||||||
|
if (args[1] != NULL) {
|
||||||
|
char *contact = args[1];
|
||||||
|
char *barejid = roster_barejid_from_name(contact);
|
||||||
|
if (barejid == NULL) {
|
||||||
|
barejid = contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefs_get_boolean(PREF_STATES)) {
|
||||||
|
if (!chat_session_exists(barejid)) {
|
||||||
|
chat_session_start(barejid, TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_new_chat_win(barejid);
|
||||||
|
} else {
|
||||||
win_type_t win_type = ui_current_win_type();
|
win_type_t win_type = ui_current_win_type();
|
||||||
|
|
||||||
if (win_type != WIN_CHAT) {
|
if (win_type != WIN_CHAT) {
|
||||||
@@ -2345,6 +2360,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
message_send("?OTR?", recipient);
|
message_send("?OTR?", recipient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (strcmp(args[0], "end") == 0) {
|
} else if (strcmp(args[0], "end") == 0) {
|
||||||
win_type_t win_type = ui_current_win_type();
|
win_type_t win_type = ui_current_win_type();
|
||||||
|
|||||||
Reference in New Issue
Block a user