1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge branch 'master' into osx-functional

This commit is contained in:
James Booth 2015-11-08 22:16:09 +00:00
commit a1ed9a57ed
5 changed files with 38 additions and 25 deletions

View File

@ -164,5 +164,5 @@ void
cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg)
{
message_send_private(privwin->fulljid, msg);
ui_outgoing_private_msg(privwin, msg);
privwin_outgoing_msg(privwin, msg);
}

View File

@ -184,7 +184,23 @@ sv_ev_room_message(const char *const room_jid, const char *const nick,
void
sv_ev_incoming_private_message(const char *const fulljid, char *message)
{
ui_incoming_private_msg(fulljid, message, NULL);
ProfPrivateWin *privatewin = wins_get_private(fulljid);
if (privatewin == NULL) {
ProfWin *window = wins_new_private(fulljid);
privatewin = (ProfPrivateWin*)window;
}
privwin_incoming_msg(privatewin, message, NULL);
}
void
sv_ev_delayed_private_message(const char *const fulljid, char *message, GDateTime *timestamp)
{
ProfPrivateWin *privatewin = wins_get_private(fulljid);
if (privatewin == NULL) {
ProfWin *window = wins_new_private(fulljid);
privatewin = (ProfPrivateWin*)window;
}
privwin_incoming_msg(privatewin, message, timestamp);
}
void
@ -319,12 +335,6 @@ sv_ev_incoming_message(char *barejid, char *resource, char *message, char *pgp_m
#endif
}
void
sv_ev_delayed_private_message(const char *const fulljid, char *message, GDateTime *timestamp)
{
ui_incoming_private_msg(fulljid, message, timestamp);
}
void
sv_ev_message_receipt(char *barejid, char *id)
{

View File

@ -32,6 +32,7 @@
*
*/
#include <assert.h>
#include <glib.h>
#include "ui/win_types.h"
@ -41,18 +42,14 @@
#include "config/preferences.h"
void
ui_incoming_private_msg(const char *const fulljid, const char *const message, GDateTime *timestamp)
privwin_incoming_msg(ProfPrivateWin *privatewin, const char *const message, GDateTime *timestamp)
{
ProfPrivateWin *privatewin = wins_get_private(fulljid);
if (privatewin == NULL) {
ProfWin *window = wins_new_private(fulljid);
privatewin = (ProfPrivateWin*)window;
}
assert(privatewin != NULL);
ProfWin *window = (ProfWin*) privatewin;
int num = wins_get_num(window);
char *display_from = get_nick_from_full_jid(fulljid);
char *display_from = get_nick_from_full_jid(privatewin->fulljid);
// currently viewing chat window with sender
if (wins_is_current(window)) {
@ -84,7 +81,9 @@ ui_incoming_private_msg(const char *const fulljid, const char *const message, GD
}
void
ui_outgoing_private_msg(ProfPrivateWin *privwin, const char *const message)
privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message)
{
assert(privwin != NULL);
win_print((ProfWin*)privwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
}

View File

@ -83,9 +83,7 @@ char* ui_get_line(void);
char* ui_ask_pgp_passphrase(const char *hint, int prev_fail);
void ui_contact_online(char *barejid, Resource *resource, GDateTime *last_activity);
void ui_contact_typing(const char *const barejid, const char *const resource);
void ui_incoming_private_msg(const char *const fulljid, const char *const message, GDateTime *timestamp);
void ui_disconnected(void);
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);
void ui_room_destroy(const char *const roomjid);
@ -107,14 +105,9 @@ void ui_handle_recipient_error(const char *const recipient, const char *const er
void ui_handle_error(const char *const err_msg);
void ui_clear_win_title(void);
void ui_goodbye_title(void);
void mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form);
void ui_handle_room_configuration_form_error(const char *const roomjid, const char *const message);
void ui_handle_room_config_submit_result(const char *const roomjid);
void ui_handle_room_config_submit_result_error(const char *const roomjid, const char *const message);
void mucconfwin_show_form(ProfMucConfWin *confwin);
void mucconfwin_show_form_field(ProfMucConfWin *confwin, DataForm *form, char *tag);
void mucconfwin_form_help(ProfMucConfWin *confwin);
void mucconfwin_field_help(ProfMucConfWin *confwin, char *tag);
void ui_show_lines(ProfWin *window, const gchar** lines);
void ui_redraw_all_room_rosters(void);
void ui_show_all_room_rosters(void);
@ -195,6 +188,17 @@ void mucwin_role_list_error(ProfMucWin *mucwin, const char *const role, const ch
void mucwin_handle_role_list(ProfMucWin *mucwin, const char *const role, GSList *nicks);
void mucwin_kick_error(ProfMucWin *mucwin, const char *const nick, const char *const error);
// MUC private chat window
void privwin_incoming_msg(ProfPrivateWin *privatewin, const char *const message, GDateTime *timestamp);
void privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message);
// MUC room config window
void mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form);
void mucconfwin_show_form(ProfMucConfWin *confwin);
void mucconfwin_show_form_field(ProfMucConfWin *confwin, DataForm *form, char *tag);
void mucconfwin_form_help(ProfMucConfWin *confwin);
void mucconfwin_field_help(ProfMucConfWin *confwin, char *tag);
// xml console
void xmlwin_show(ProfXMLWin *xmlwin, const char *const msg);

View File

@ -159,14 +159,14 @@ void ui_contact_typing(const char * const barejid, const char * const resource)
void chatwin_incoming_msg(ProfChatWin *chatwin, const char * const resource, const char * const message, GDateTime *timestamp, gboolean win_created, prof_enc_t enc_mode) {}
void chatwin_receipt_received(ProfChatWin *chatwin, const char * const id) {}
void ui_incoming_private_msg(const char * const fulljid, const char * const message, GDateTime *timestamp) {}
void privwin_incoming_msg(ProfPrivateWin *privatewin, const char * const message, GDateTime *timestamp) {}
void ui_disconnected(void) {}
void chatwin_recipient_gone(ProfChatWin *chatwin) {}
void chatwin_outgoing_msg(ProfChatWin *chatwin, const char * const message, char *id, prof_enc_t enc_mode) {}
void chatwin_outgoing_carbon(ProfChatWin *chatwin, const char * const message) {}
void ui_outgoing_private_msg(ProfPrivateWin *privwin, const char * const message) {}
void privwin_outgoing_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) {}