diff options
author | James Booth <boothj5@gmail.com> | 2015-05-04 01:31:27 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-05-04 01:31:27 +0100 |
commit | c8eaaa0ce918064a4009f706baac4a975999fc3f (patch) | |
tree | 6745a1b7c7c3cb05980a75f26ffa6465eefecb7c /src/ui | |
parent | b1dd1e2726892ac8152ba4b8f880f693c113a6e9 (diff) | |
download | profani-tty-c8eaaa0ce918064a4009f706baac4a975999fc3f.tar.gz |
Added ui_ev_new_private_win to ui events
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/core.c | 19 | ||||
-rw-r--r-- | src/ui/ui.h | 4 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index b4cef52d..8c4d4644 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1273,14 +1273,11 @@ ui_recipient_gone(const char * const barejid, const char * const resource) } } -void +ProfPrivateWin* ui_new_private_win(const char * const fulljid) { - ProfWin *window = (ProfWin*)wins_get_private(fulljid); - if (!window) { - window = wins_new_private(fulljid); - } - ui_ev_focus_win(window); + ProfWin *window = wins_new_private(fulljid); + return (ProfPrivateWin*)window; } void @@ -1357,15 +1354,9 @@ ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const messa } void -ui_outgoing_private_msg(const char * const fulljid, const char * const message) +ui_outgoing_private_msg(ProfPrivateWin *privwin, const char * const message) { - ProfWin *window = (ProfWin*)wins_get_private(fulljid); - if (!window) { - window = wins_new_private(fulljid); - } - - win_print(window, '-', NULL, 0, THEME_TEXT_ME, "me", message); - ui_ev_focus_win(window); + win_print((ProfWin*)privwin, '-', NULL, 0, THEME_TEXT_ME, "me", message); } void diff --git a/src/ui/ui.h b/src/ui/ui.h index 212ed451..c98d45e8 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -84,7 +84,7 @@ void ui_handle_otr_error(const char * const barejid, const char * const message) unsigned long ui_get_idle_time(void); void ui_reset_idle_time(void); -void ui_new_private_win(const char * const fulljid); +ProfPrivateWin* ui_new_private_win(const char * const fulljid); ProfChatWin* ui_new_chat_win(const char * const barejid); void ui_print_system_msg_from_recipient(const char * const barejid, const char *message); gint ui_unread(void); @@ -122,7 +122,7 @@ void ui_recipient_gone(const char * const barejid, const char * const resource); void ui_outgoing_chat_msg(ProfChatWin *chatwin, const char * const message, char *id); void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message); -void ui_outgoing_private_msg(const char * const fulljid, const char * const message); +void ui_outgoing_private_msg(ProfPrivateWin *privwin, const char * const message); void ui_room_join(const char * const roomjid, gboolean focus); void ui_switch_to_room(const char * const roomjid); |