mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Removed functions from window.c
This commit is contained in:
parent
d5dee1632d
commit
86dc29d8e8
@ -1794,7 +1794,7 @@ cmd_execute_default(const char * inp)
|
|||||||
ProfWin *current = wins_get_current();
|
ProfWin *current = wins_get_current();
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)current;
|
ProfChatWin *chatwin = (ProfChatWin*)current;
|
||||||
GString *send_recipient = g_string_new(chatwin->barejid);
|
GString *send_recipient = g_string_new(chatwin->barejid);
|
||||||
if (current && win_has_chat_resource(current)) {
|
if (current && chatwin->resource) {
|
||||||
g_string_append(send_recipient, "/");
|
g_string_append(send_recipient, "/");
|
||||||
g_string_append(send_recipient, chatwin->resource);
|
g_string_append(send_recipient, chatwin->resource);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <assert.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
#include <libotr/proto.h>
|
#include <libotr/proto.h>
|
||||||
@ -1151,10 +1152,15 @@ cmd_msg(gchar **args, struct cmd_help_t help)
|
|||||||
}
|
}
|
||||||
GString *send_jid = g_string_new(usr_jid);
|
GString *send_jid = g_string_new(usr_jid);
|
||||||
ProfWin *current = wins_get_current();
|
ProfWin *current = wins_get_current();
|
||||||
if (current->type == WIN_CHAT && win_has_chat_resource(current)) {
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin *)current;
|
// if msg to current recipient, attach resource if set
|
||||||
g_string_append(send_jid, "/");
|
if (current->type == WIN_CHAT) {
|
||||||
g_string_append(send_jid, chatwin->resource);
|
ProfChatWin *chatwin = (ProfChatWin*)current;
|
||||||
|
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||||
|
if ((g_strcmp0(chatwin->barejid, usr_jid) == 0) && (chatwin->resource)) {
|
||||||
|
g_string_append(send_jid, "/");
|
||||||
|
g_string_append(send_jid, chatwin->resource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg != NULL) {
|
if (msg != NULL) {
|
||||||
|
@ -829,11 +829,13 @@ _ui_win_has_unsaved_form(int num)
|
|||||||
{
|
{
|
||||||
ProfWin *window = wins_get_by_num(num);
|
ProfWin *window = wins_get_by_num(num);
|
||||||
|
|
||||||
if (window->type != WIN_MUC_CONFIG) {
|
if (window->type == WIN_MUC_CONFIG) {
|
||||||
|
ProfMucConfWin *confwin = (ProfMucConfWin*)window;
|
||||||
|
assert(confwin->memcheck == PROFCONFWIN_MEMCHECK);
|
||||||
|
return confwin->form->modified;
|
||||||
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return win_has_modified_form(window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -3017,7 +3019,9 @@ _win_show_history(int win_index, const char * const contact)
|
|||||||
{
|
{
|
||||||
ProfWin *window = wins_get_by_num(win_index);
|
ProfWin *window = wins_get_by_num(win_index);
|
||||||
if (window->type == WIN_CHAT) {
|
if (window->type == WIN_CHAT) {
|
||||||
if (win_chat_history_shown(window)) {
|
ProfChatWin *chatwin = (ProfChatWin*) window;
|
||||||
|
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
||||||
|
if (!chatwin->history_shown) {
|
||||||
Jid *jid = jid_create(jabber_get_fulljid());
|
Jid *jid = jid_create(jabber_get_fulljid());
|
||||||
GSList *history = chat_log_get_previous(jid->barejid, contact);
|
GSList *history = chat_log_get_previous(jid->barejid, contact);
|
||||||
jid_destroy(jid);
|
jid_destroy(jid);
|
||||||
@ -3040,7 +3044,6 @@ _win_show_history(int win_index, const char * const contact)
|
|||||||
}
|
}
|
||||||
curr = g_slist_next(curr);
|
curr = g_slist_next(curr);
|
||||||
}
|
}
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
chatwin->history_shown = TRUE;
|
chatwin->history_shown = TRUE;
|
||||||
|
|
||||||
g_slist_free_full(history, free);
|
g_slist_free_full(history, free);
|
||||||
|
@ -921,39 +921,6 @@ win_has_active_subwin(ProfWin *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
win_chat_history_shown(ProfWin *window)
|
|
||||||
{
|
|
||||||
if (window->type == WIN_CHAT) {
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
return chatwin->history_shown;
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
win_has_chat_resource(ProfWin *window)
|
|
||||||
{
|
|
||||||
if (window->type == WIN_CHAT) {
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
return (chatwin->resource != NULL);
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
win_has_modified_form(ProfWin *window)
|
|
||||||
{
|
|
||||||
if (window->type == WIN_MUC_CONFIG) {
|
|
||||||
ProfMucConfWin *confwin = (ProfMucConfWin*)window;
|
|
||||||
return confwin->form->modified;
|
|
||||||
} else {
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
win_unread(ProfWin *window)
|
win_unread(ProfWin *window)
|
||||||
{
|
{
|
||||||
|
@ -177,8 +177,5 @@ void win_printline_nowrap(WINDOW *win, char *msg);
|
|||||||
|
|
||||||
int win_unread(ProfWin *window);
|
int win_unread(ProfWin *window);
|
||||||
gboolean win_has_active_subwin(ProfWin *window);
|
gboolean win_has_active_subwin(ProfWin *window);
|
||||||
gboolean win_has_modified_form(ProfWin *window);
|
|
||||||
gboolean win_chat_history_shown(ProfWin *window);
|
|
||||||
gboolean win_has_chat_resource(ProfWin *window);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user