mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Don't switch window on sent carbon
This commit is contained in:
parent
ede3368f7a
commit
385336c10b
@ -310,7 +310,7 @@ handle_incoming_private_message(char *fulljid, char *message)
|
||||
|
||||
void
|
||||
handle_carbon(char *barejid, char *message){
|
||||
ui_outgoing_chat_msg("me", barejid, message);
|
||||
ui_outgoing_chat_msg_carbon("me", barejid, message);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1451,6 +1451,48 @@ ui_outgoing_chat_msg(const char * const from, const char * const barejid,
|
||||
ui_switch_win(num);
|
||||
}
|
||||
|
||||
void
|
||||
ui_outgoing_chat_msg_carbon(const char * const from, const char * const barejid,
|
||||
const char * const message)
|
||||
{
|
||||
PContact contact = roster_get_contact(barejid);
|
||||
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
||||
int num = 0;
|
||||
|
||||
// create new window
|
||||
if (window == NULL) {
|
||||
window = wins_new_chat(barejid);
|
||||
#ifdef HAVE_LIBOTR
|
||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
||||
if (otr_is_secure(barejid)) {
|
||||
chatwin->is_otr = TRUE;
|
||||
}
|
||||
#endif
|
||||
num = wins_get_num(window);
|
||||
|
||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
||||
_win_show_history(num, barejid);
|
||||
}
|
||||
|
||||
if (contact != NULL) {
|
||||
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
||||
const char *show = p_contact_presence(contact);
|
||||
const char *status = p_contact_status(contact);
|
||||
win_show_status_string(window, barejid, show, status, NULL, "--", "offline");
|
||||
}
|
||||
}
|
||||
|
||||
// use existing window
|
||||
} else {
|
||||
num = wins_get_num(window);
|
||||
}
|
||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
||||
chat_state_active(chatwin->state);
|
||||
|
||||
win_save_print(window, '-', NULL, 0, THEME_TEXT_ME, from, message);
|
||||
status_bar_active(num);
|
||||
}
|
||||
|
||||
void
|
||||
ui_outgoing_private_msg(const char * const from, const char * const fulljid,
|
||||
const char * const message)
|
||||
|
@ -122,6 +122,8 @@ void ui_recipient_gone(const char * const barejid, const char * const resource);
|
||||
|
||||
void ui_outgoing_chat_msg(const char * const from, const char * const barejid,
|
||||
const char * const message);
|
||||
void ui_outgoing_chat_msg_carbon(const char * const from, const char * const barejid,
|
||||
const char * const message);
|
||||
void ui_outgoing_private_msg(const char * const from, const char * const fulljid,
|
||||
const char * const message);
|
||||
|
||||
|
@ -201,6 +201,8 @@ void ui_recipient_gone(const char * const barejid, const char * const resource)
|
||||
|
||||
void ui_outgoing_chat_msg(const char * const from, const char * const barejid,
|
||||
const char * const message) {}
|
||||
void ui_outgoing_chat_msg_carbon(const char * const from, const char * const barejid,
|
||||
const char * const message) {}
|
||||
void ui_outgoing_private_msg(const char * const from, const char * const fulljid,
|
||||
const char * const message) {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user