Tidied chatwin_outgoing_carbon
This commit is contained in:
@@ -180,7 +180,14 @@ sv_ev_incoming_private_message(const char *const fulljid, char *message)
|
|||||||
void
|
void
|
||||||
sv_ev_outgoing_carbon(char *barejid, char *message)
|
sv_ev_outgoing_carbon(char *barejid, char *message)
|
||||||
{
|
{
|
||||||
ui_outgoing_chat_msg_carbon(barejid, message);
|
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||||
|
if (!chatwin) {
|
||||||
|
chatwin = chatwin_new(barejid);
|
||||||
|
}
|
||||||
|
|
||||||
|
chat_state_active(chatwin->state);
|
||||||
|
|
||||||
|
chatwin_outgoing_carbon(chatwin, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -205,6 +205,8 @@ chatwin_otr_untrust(ProfChatWin *chatwin)
|
|||||||
void
|
void
|
||||||
chatwin_recipient_gone(ProfChatWin *chatwin)
|
chatwin_recipient_gone(ProfChatWin *chatwin)
|
||||||
{
|
{
|
||||||
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
const char *display_usr = NULL;
|
const char *display_usr = NULL;
|
||||||
PContact contact = roster_get_contact(chatwin->barejid);
|
PContact contact = roster_get_contact(chatwin->barejid);
|
||||||
if (contact) {
|
if (contact) {
|
||||||
@@ -223,6 +225,8 @@ chatwin_recipient_gone(ProfChatWin *chatwin)
|
|||||||
void
|
void
|
||||||
chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, const char *const message, GDateTime *timestamp, gboolean win_created, prof_enc_t enc_mode)
|
chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, const char *const message, GDateTime *timestamp, gboolean win_created, prof_enc_t enc_mode)
|
||||||
{
|
{
|
||||||
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
ProfWin *window = (ProfWin*)chatwin;
|
ProfWin *window = (ProfWin*)chatwin;
|
||||||
int num = wins_get_num(window);
|
int num = wins_get_num(window);
|
||||||
|
|
||||||
@@ -273,6 +277,8 @@ chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, const cha
|
|||||||
void
|
void
|
||||||
chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode)
|
chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode)
|
||||||
{
|
{
|
||||||
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
char enc_char = '-';
|
char enc_char = '-';
|
||||||
if (enc_mode == PROF_MSG_OTR) {
|
if (enc_mode == PROF_MSG_OTR) {
|
||||||
enc_char = prefs_get_otr_char();
|
enc_char = prefs_get_otr_char();
|
||||||
@@ -288,19 +294,11 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_outgoing_chat_msg_carbon(const char *const barejid, const char *const message)
|
chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message)
|
||||||
{
|
{
|
||||||
ProfChatWin *chatwin = wins_get_chat(barejid);
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
// create new window
|
|
||||||
if (!chatwin) {
|
|
||||||
chatwin = chatwin_new(barejid);
|
|
||||||
}
|
|
||||||
|
|
||||||
chat_state_active(chatwin->state);
|
|
||||||
|
|
||||||
win_print((ProfWin*)chatwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
|
win_print((ProfWin*)chatwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
|
||||||
|
|
||||||
int num = wins_get_num((ProfWin*)chatwin);
|
int num = wins_get_num((ProfWin*)chatwin);
|
||||||
status_bar_active(num);
|
status_bar_active(num);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ void ui_disconnected(void);
|
|||||||
void chatwin_recipient_gone(ProfChatWin *chatwin);
|
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_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode);
|
||||||
void ui_outgoing_chat_msg_carbon(const char *const barejid, const char *const message);
|
void chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message);
|
||||||
void ui_outgoing_private_msg(ProfPrivateWin *privwin, 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_room_join(const char *const roomjid, gboolean focus);
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ void ui_disconnected(void) {}
|
|||||||
void chatwin_recipient_gone(ProfChatWin *chatwin) {}
|
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_msg(ProfChatWin *chatwin, const char * const message, char *id, prof_enc_t enc_mode) {}
|
||||||
void ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message) {}
|
void chatwin_outgoing_carbon(ProfChatWin *chatwin, const char * const message) {}
|
||||||
void ui_outgoing_private_msg(ProfPrivateWin *privwin, 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_room_join(const char * const roomjid, gboolean focus) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user