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

xmlwin_show takes window as argument

This commit is contained in:
James Booth 2015-11-01 19:45:35 +00:00
parent db4bcd3e6d
commit aa59cf98b8
4 changed files with 10 additions and 8 deletions

View File

@ -521,7 +521,10 @@ sv_ev_roster_update(const char *const barejid, const char *const name,
void void
sv_ev_xmpp_stanza(const char *const msg) sv_ev_xmpp_stanza(const char *const msg)
{ {
xmlwin_show(msg); ProfXMLWin *xmlwin = wins_get_xmlconsole();
if (xmlwin) {
xmlwin_show(xmlwin, msg);
}
} }
void void

View File

@ -209,7 +209,7 @@ void chatwin_otr_smp_event(ProfChatWin *chatwin, prof_otr_smp_event_t event, voi
#endif #endif
// xml console // xml console
void xmlwin_show(const char *const msg); void xmlwin_show(ProfXMLWin *xmlwin, const char *const msg);
// Input window // Input window
char* inp_readline(void); char* inp_readline(void);

View File

@ -32,16 +32,15 @@
* *
*/ */
#include <assert.h>
#include "ui/win_types.h" #include "ui/win_types.h"
#include "window_list.h" #include "window_list.h"
void void
xmlwin_show(const char *const msg) xmlwin_show(ProfXMLWin *xmlwin, const char *const msg)
{ {
ProfXMLWin *xmlwin = wins_get_xmlconsole(); assert(xmlwin != NULL);
if (!xmlwin) {
return;
}
ProfWin *window = (ProfWin*)xmlwin; ProfWin *window = (ProfWin*)xmlwin;
if (g_str_has_prefix(msg, "SENT:")) { if (g_str_has_prefix(msg, "SENT:")) {

View File

@ -165,7 +165,7 @@ char *ui_get_line(void)
return NULL; return NULL;
} }
void xmlwin_show(const char * const msg) {} void xmlwin_show(ProfXMLWin *xmlwin, const char * const msg) {}
// ui events // ui events
void ui_contact_online(char *barejid, Resource *resource, GDateTime *last_activity) void ui_contact_online(char *barejid, Resource *resource, GDateTime *last_activity)