mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Open new chat win, or use existing for /otr start <contact>
This commit is contained in:
parent
671fa839e8
commit
bc1d4df230
@ -2331,6 +2331,21 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
||||
}
|
||||
return TRUE;
|
||||
} 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();
|
||||
|
||||
if (win_type != WIN_CHAT) {
|
||||
@ -2345,6 +2360,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
||||
message_send("?OTR?", recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
} else if (strcmp(args[0], "end") == 0) {
|
||||
win_type_t win_type = ui_current_win_type();
|
||||
|
Loading…
Reference in New Issue
Block a user