mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-24 19:46:22 +00:00
Show software version result in current window
This commit is contained in:
@@ -421,30 +421,6 @@ cons_show_caps(const char * const fulljid, resource_presence_t presence)
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
void
|
||||
cons_show_software_version(const char * const jid, const char * const presence,
|
||||
const char * const name, const char * const version, const char * const os)
|
||||
{
|
||||
ProfWin *console = wins_get_console();
|
||||
if (name || version || os) {
|
||||
cons_show("");
|
||||
theme_item_t presence_colour = theme_main_presence_attrs(presence);
|
||||
win_vprint(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid);
|
||||
win_print(console, '-', 0, NULL, NO_DATE, 0, "", ":");
|
||||
}
|
||||
if (name) {
|
||||
cons_show("Name : %s", name);
|
||||
}
|
||||
if (version) {
|
||||
cons_show("Version : %s", version);
|
||||
}
|
||||
if (os) {
|
||||
cons_show("OS : %s", os);
|
||||
}
|
||||
|
||||
cons_alert();
|
||||
}
|
||||
|
||||
void
|
||||
cons_show_received_subs(void)
|
||||
{
|
||||
|
||||
@@ -2810,6 +2810,57 @@ ui_handle_software_version_error(const char * const roomjid, const char * const
|
||||
g_string_free(message_str, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
ui_show_software_version(const char * const jid, const char * const presence,
|
||||
const char * const name, const char * const version, const char * const os)
|
||||
{
|
||||
Jid *jidp = jid_create(jid);
|
||||
ProfWin *window = NULL;
|
||||
ProfWin *chatwin = (ProfWin*)wins_get_chat(jidp->barejid);
|
||||
ProfWin *mucwin = (ProfWin*)wins_get_muc(jidp->barejid);
|
||||
ProfWin *privwin = (ProfWin*)wins_get_private(jidp->fulljid);
|
||||
ProfWin *console = wins_get_console();
|
||||
jid_destroy(jidp);
|
||||
|
||||
if (chatwin) {
|
||||
if (wins_is_current(chatwin)) {
|
||||
window = chatwin;
|
||||
} else {
|
||||
window = console;
|
||||
}
|
||||
} else if (privwin) {
|
||||
if (wins_is_current(privwin)) {
|
||||
window = privwin;
|
||||
} else {
|
||||
window = console;
|
||||
}
|
||||
} else if (mucwin) {
|
||||
if (wins_is_current(mucwin)) {
|
||||
window = mucwin;
|
||||
} else {
|
||||
window = console;
|
||||
}
|
||||
} else {
|
||||
window = console;
|
||||
}
|
||||
|
||||
if (name || version || os) {
|
||||
win_println(window, 0, "");
|
||||
theme_item_t presence_colour = theme_main_presence_attrs(presence);
|
||||
win_vprint(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid);
|
||||
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":");
|
||||
}
|
||||
if (name) {
|
||||
win_vprint(window, '-', 0, NULL, 0, 0, "", "Name : %s", name);
|
||||
}
|
||||
if (version) {
|
||||
win_vprint(window, '-', 0, NULL, 0, 0, "", "Version : %s", version);
|
||||
}
|
||||
if (os) {
|
||||
win_vprint(window, '-', 0, NULL, 0, 0, "", "OS : %s", os);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_win_show_history(ProfChatWin *chatwin, const char * const contact)
|
||||
{
|
||||
|
||||
@@ -204,6 +204,8 @@ void ui_show_all_room_rosters(void);
|
||||
void ui_hide_all_room_rosters(void);
|
||||
gboolean ui_chat_win_exists(const char * const barejid);
|
||||
void ui_handle_software_version_error(const char * const roomjid, const char * const message);
|
||||
void ui_show_software_version(const char * const jid, const char * const presence,
|
||||
const char * const name, const char * const version, const char * const os);
|
||||
|
||||
gboolean ui_tidy_wins(void);
|
||||
void ui_prune_wins(void);
|
||||
|
||||
Reference in New Issue
Block a user