mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Merge branch 'master' into pgp
This commit is contained in:
commit
0fece78dfe
@ -113,7 +113,7 @@ cmd_execute_default(const char * inp)
|
|||||||
case WIN_CHAT:
|
case WIN_CHAT:
|
||||||
{
|
{
|
||||||
ProfChatWin *chatwin = wins_get_current_chat();
|
ProfChatWin *chatwin = wins_get_current_chat();
|
||||||
cl_ev_send_msg(chatwin->barejid, inp);
|
cl_ev_send_msg(chatwin, inp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WIN_PRIVATE:
|
case WIN_PRIVATE:
|
||||||
@ -1338,24 +1338,23 @@ cmd_msg(gchar **args, struct cmd_help_t help)
|
|||||||
barejid = usr;
|
barejid = usr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg) {
|
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||||
cl_ev_send_msg(barejid, msg);
|
if (!chatwin) {
|
||||||
return TRUE;
|
chatwin = ui_ev_new_chat_win(barejid);
|
||||||
} else {
|
|
||||||
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
|
||||||
if (window) {
|
|
||||||
ui_ev_focus_win(window);
|
|
||||||
} else {
|
|
||||||
ui_ev_new_chat_win(barejid);
|
|
||||||
}
|
}
|
||||||
|
ui_ev_focus_win((ProfWin*)chatwin);
|
||||||
|
|
||||||
|
if (msg) {
|
||||||
|
cl_ev_send_msg(chatwin, msg);
|
||||||
|
} else {
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
if (otr_is_secure(barejid)) {
|
if (otr_is_secure(barejid)) {
|
||||||
ui_gone_secure(barejid, otr_is_trusted(barejid));
|
ui_gone_secure(barejid, otr_is_trusted(barejid));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3153,7 +3152,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
|
|||||||
case WIN_CHAT:
|
case WIN_CHAT:
|
||||||
{
|
{
|
||||||
ProfChatWin *chatwin = wins_get_current_chat();
|
ProfChatWin *chatwin = wins_get_current_chat();
|
||||||
cl_ev_send_msg(chatwin->barejid, tiny);
|
cl_ev_send_msg(chatwin, tiny);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WIN_PRIVATE:
|
case WIN_PRIVATE:
|
||||||
@ -4236,12 +4235,11 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
barejid = contact;
|
barejid = contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||||
if (window) {
|
if (!chatwin) {
|
||||||
ui_ev_focus_win(window);
|
chatwin = ui_ev_new_chat_win(barejid);
|
||||||
} else {
|
|
||||||
ui_ev_new_chat_win(barejid);
|
|
||||||
}
|
}
|
||||||
|
ui_ev_focus_win((ProfWin*)chatwin);
|
||||||
|
|
||||||
if (ui_current_win_is_otr()) {
|
if (ui_current_win_is_otr()) {
|
||||||
ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
|
ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
#include "ui/windows.h"
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
#include "otr/otr.h"
|
#include "otr/otr.h"
|
||||||
@ -60,14 +61,21 @@ cl_ev_connect_account(ProfAccount *account)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cl_ev_send_msg(const char * const barejid, const char * const msg)
|
cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg)
|
||||||
{
|
{
|
||||||
|
chat_state_active(chatwin->state);
|
||||||
|
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
otr_on_message_send(barejid, msg);
|
prof_otrsendres_t res = otr_on_message_send(chatwin->barejid, msg);
|
||||||
|
if (res != PROF_OTRSUCCESS) {
|
||||||
|
char *errmsg = otr_senderror_str(res);
|
||||||
|
// TODO reference passed window
|
||||||
|
ui_current_error_line(errmsg);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
char *id = message_send_chat(barejid, msg);
|
char *id = message_send_chat(chatwin->barejid, msg);
|
||||||
chat_log_msg_out(barejid, msg);
|
chat_log_msg_out(chatwin->barejid, msg);
|
||||||
ui_outgoing_chat_msg(barejid, msg, id);
|
ui_outgoing_chat_msg(chatwin->barejid, msg, id);
|
||||||
free(id);
|
free(id);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
jabber_conn_status_t cl_ev_connect_jid(const char * const jid, const char * const passwd, const char * const altdomain, const int port);
|
jabber_conn_status_t cl_ev_connect_jid(const char * const jid, const char * const passwd, const char * const altdomain, const int port);
|
||||||
jabber_conn_status_t cl_ev_connect_account(ProfAccount *account);
|
jabber_conn_status_t cl_ev_connect_account(ProfAccount *account);
|
||||||
|
|
||||||
void cl_ev_send_msg(const char * const barejid, const char * const msg);
|
void cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg);
|
||||||
void cl_ev_send_muc_msg(const char * const roomjid, const char * const msg);
|
void cl_ev_send_muc_msg(const char * const roomjid, const char * const msg);
|
||||||
void cl_ev_send_priv_msg(const char * const fulljid, const char * const msg);
|
void cl_ev_send_priv_msg(const char * const fulljid, const char * const msg);
|
||||||
|
|
||||||
|
@ -40,9 +40,8 @@ ui_ev_focus_win(ProfWin *win)
|
|||||||
ui_switch_win(win);
|
ui_switch_win(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
ProfChatWin*
|
||||||
ui_ev_new_chat_win(const char * const barejid)
|
ui_ev_new_chat_win(const char * const barejid)
|
||||||
{
|
{
|
||||||
ProfWin *win = ui_new_chat_win(barejid);
|
return ui_new_chat_win(barejid);
|
||||||
ui_switch_win(win);
|
|
||||||
}
|
}
|
@ -36,6 +36,6 @@
|
|||||||
#define UI_EVENTS_H
|
#define UI_EVENTS_H
|
||||||
|
|
||||||
void ui_ev_focus_win(ProfWin *win);
|
void ui_ev_focus_win(ProfWin *win);
|
||||||
void ui_ev_new_chat_win(const char * const barejid);
|
ProfChatWin* ui_ev_new_chat_win(const char * const barejid);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -313,7 +313,7 @@ otr_on_message_recv(const char * const barejid, const char * const resource, con
|
|||||||
otr_free_message(decrypted);
|
otr_free_message(decrypted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
prof_otrsendres_t
|
||||||
otr_on_message_send(const char * const barejid, const char * const message)
|
otr_on_message_send(const char * const barejid, const char * const message)
|
||||||
{
|
{
|
||||||
char *id = NULL;
|
char *id = NULL;
|
||||||
@ -322,17 +322,17 @@ otr_on_message_send(const char * const barejid, const char * const message)
|
|||||||
|
|
||||||
if (otr_is_secure(barejid)) {
|
if (otr_is_secure(barejid)) {
|
||||||
char *encrypted = otr_encrypt_message(barejid, message);
|
char *encrypted = otr_encrypt_message(barejid, message);
|
||||||
if (encrypted != NULL) {
|
if (encrypted) {
|
||||||
id = message_send_chat_encrypted(barejid, encrypted);
|
id = message_send_chat_encrypted(barejid, encrypted);
|
||||||
chat_log_otr_msg_out(barejid, message);
|
chat_log_otr_msg_out(barejid, message);
|
||||||
ui_outgoing_chat_msg(barejid, message, id);
|
ui_outgoing_chat_msg(barejid, message, id);
|
||||||
otr_free_message(encrypted);
|
otr_free_message(encrypted);
|
||||||
} else {
|
} else {
|
||||||
cons_show_error("Failed to encrypt and send message.");
|
return PROF_OTRENCFAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (policy == PROF_OTRPOLICY_ALWAYS) {
|
} else if (policy == PROF_OTRPOLICY_ALWAYS) {
|
||||||
cons_show_error("Failed to send message. Please check OTR policy");
|
return PROF_OTRPOLICYFAIL;
|
||||||
|
|
||||||
} else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
|
} else if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
|
||||||
char *otr_tagged_msg = otr_tag_message(message);
|
char *otr_tagged_msg = otr_tag_message(message);
|
||||||
@ -348,6 +348,8 @@ otr_on_message_send(const char * const barejid, const char * const message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(id);
|
free(id);
|
||||||
|
|
||||||
|
return PROF_OTRSUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -741,6 +743,16 @@ otr_decrypt_message(const char * const from, const char * const message, gboolea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char*
|
||||||
|
otr_senderror_str(prof_otrsendres_t res)
|
||||||
|
{
|
||||||
|
switch (res) {
|
||||||
|
case PROF_OTRENCFAIL: return "Failed to encrypt and send message.";
|
||||||
|
case PROF_OTRPOLICYFAIL: return "Failed to send message. OTR policy set to: always";
|
||||||
|
default: return "Unknown OTR error.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
otr_free_message(char *message)
|
otr_free_message(char *message)
|
||||||
{
|
{
|
||||||
|
@ -46,6 +46,12 @@ typedef enum {
|
|||||||
PROF_OTRPOLICY_ALWAYS
|
PROF_OTRPOLICY_ALWAYS
|
||||||
} prof_otrpolicy_t;
|
} prof_otrpolicy_t;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
PROF_OTRENCFAIL,
|
||||||
|
PROF_OTRPOLICYFAIL,
|
||||||
|
PROF_OTRSUCCESS
|
||||||
|
} prof_otrsendres_t;
|
||||||
|
|
||||||
OtrlUserState otr_userstate(void);
|
OtrlUserState otr_userstate(void);
|
||||||
OtrlMessageAppOps* otr_messageops(void);
|
OtrlMessageAppOps* otr_messageops(void);
|
||||||
GHashTable* otr_smpinitators(void);
|
GHashTable* otr_smpinitators(void);
|
||||||
@ -58,7 +64,7 @@ void otr_poll(void);
|
|||||||
void otr_on_connect(ProfAccount *account);
|
void otr_on_connect(ProfAccount *account);
|
||||||
|
|
||||||
void otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message);
|
void otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message);
|
||||||
void otr_on_message_send(const char * const barejid, const char * const message);
|
prof_otrsendres_t otr_on_message_send(const char * const barejid, const char * const message);
|
||||||
|
|
||||||
void otr_keygen(ProfAccount *account);
|
void otr_keygen(ProfAccount *account);
|
||||||
|
|
||||||
@ -88,4 +94,6 @@ void otr_free_message(char *message);
|
|||||||
|
|
||||||
prof_otrpolicy_t otr_get_policy(const char * const recipient);
|
prof_otrpolicy_t otr_get_policy(const char * const recipient);
|
||||||
|
|
||||||
|
char* otr_senderror_str(prof_otrsendres_t res);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
121
src/ui/core.c
121
src/ui/core.c
@ -88,7 +88,7 @@ static Display *display;
|
|||||||
static GTimer *ui_idle_time;
|
static GTimer *ui_idle_time;
|
||||||
|
|
||||||
//static void _win_handle_switch(const wint_t ch);
|
//static void _win_handle_switch(const wint_t ch);
|
||||||
static void _win_show_history(int win_index, const char * const contact);
|
static void _win_show_history(ProfChatWin *chatwin, const char * const contact);
|
||||||
static void _ui_draw_term_title(void);
|
static void _ui_draw_term_title(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -441,7 +441,7 @@ ui_incoming_msg(const char * const barejid, const char * const resource, const c
|
|||||||
|
|
||||||
chatwin->unread++;
|
chatwin->unread++;
|
||||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
||||||
_win_show_history(num, barejid);
|
_win_show_history(chatwin, barejid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// show users status first, when receiving message via delayed delivery
|
// show users status first, when receiving message via delayed delivery
|
||||||
@ -501,19 +501,14 @@ ui_incoming_private_msg(const char * const fulljid, const char * const message,
|
|||||||
|
|
||||||
// not currently viewing chat window with sender
|
// not currently viewing chat window with sender
|
||||||
} else {
|
} else {
|
||||||
|
privatewin->unread++;
|
||||||
status_bar_new(num);
|
status_bar_new(num);
|
||||||
cons_show_incoming_message(display_from, num);
|
cons_show_incoming_message(display_from, num);
|
||||||
|
win_print_incoming_message(window, tv_stamp, display_from, message);
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_FLASH)) {
|
if (prefs_get_boolean(PREF_FLASH)) {
|
||||||
flash();
|
flash();
|
||||||
}
|
}
|
||||||
|
|
||||||
privatewin->unread++;
|
|
||||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
|
||||||
_win_show_history(num, fulljid);
|
|
||||||
}
|
|
||||||
|
|
||||||
win_print_incoming_message(window, tv_stamp, display_from, message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ui_index = num;
|
int ui_index = num;
|
||||||
@ -1365,30 +1360,6 @@ ui_recipient_gone(const char * const barejid, const char * const resource)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfWin*
|
|
||||||
ui_new_chat_win(const char * const barejid)
|
|
||||||
{
|
|
||||||
ProfWin* window = wins_new_chat(barejid);
|
|
||||||
|
|
||||||
int num = wins_get_num(window);
|
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
|
||||||
_win_show_history(num, barejid);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if the contact is offline, show a message
|
|
||||||
PContact contact = roster_get_contact(barejid);
|
|
||||||
if (contact != NULL) {
|
|
||||||
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
|
||||||
const char * const show = p_contact_presence(contact);
|
|
||||||
const char * const status = p_contact_status(contact);
|
|
||||||
win_show_status_string(window, barejid, show, status, NULL, "--", "offline");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return window;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_new_private_win(const char * const fulljid)
|
ui_new_private_win(const char * const fulljid)
|
||||||
{
|
{
|
||||||
@ -1424,89 +1395,62 @@ ui_open_xmlconsole_win(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
ProfChatWin*
|
||||||
ui_outgoing_chat_msg(const char * const barejid, const char * const message, char *id)
|
ui_new_chat_win(const char * const barejid)
|
||||||
{
|
{
|
||||||
PContact contact = roster_get_contact(barejid);
|
ProfWin *window = wins_new_chat(barejid);
|
||||||
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
|
||||||
int num = 0;
|
|
||||||
|
|
||||||
// create new window
|
|
||||||
if (window == NULL) {
|
|
||||||
window = wins_new_chat(barejid);
|
|
||||||
#ifdef HAVE_LIBOTR
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin *)window;
|
ProfChatWin *chatwin = (ProfChatWin *)window;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBOTR
|
||||||
if (otr_is_secure(barejid)) {
|
if (otr_is_secure(barejid)) {
|
||||||
chatwin->is_otr = TRUE;
|
chatwin->is_otr = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
num = wins_get_num(window);
|
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
||||||
_win_show_history(num, barejid);
|
_win_show_history(chatwin, barejid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contact != NULL) {
|
// if the contact is offline, show a message
|
||||||
|
PContact contact = roster_get_contact(barejid);
|
||||||
|
if (contact) {
|
||||||
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
||||||
const char *show = p_contact_presence(contact);
|
const char * const show = p_contact_presence(contact);
|
||||||
const char *status = p_contact_status(contact);
|
const char * const status = p_contact_status(contact);
|
||||||
win_show_status_string(window, barejid, show, status, NULL, "--", "offline");
|
win_show_status_string(window, barejid, show, status, NULL, "--", "offline");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// use existing window
|
return chatwin;
|
||||||
} else {
|
|
||||||
num = wins_get_num(window);
|
|
||||||
}
|
}
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
chat_state_active(chatwin->state);
|
void
|
||||||
|
ui_outgoing_chat_msg(const char * const barejid, const char * const message, char *id)
|
||||||
|
{
|
||||||
|
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST) && id) {
|
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST) && id) {
|
||||||
win_print_with_receipt(window, '-', NULL, 0, THEME_TEXT_ME, "me", message, id);
|
win_print_with_receipt(window, '-', NULL, 0, THEME_TEXT_ME, "me", message, id);
|
||||||
} else {
|
} else {
|
||||||
win_print(window, '-', NULL, 0, THEME_TEXT_ME, "me", message);
|
win_print(window, '-', NULL, 0, THEME_TEXT_ME, "me", message);
|
||||||
}
|
}
|
||||||
ui_switch_win_num(num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message)
|
ui_outgoing_chat_msg_carbon(const char * const barejid, const char * const message)
|
||||||
{
|
{
|
||||||
PContact contact = roster_get_contact(barejid);
|
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||||
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
|
|
||||||
int num = 0;
|
|
||||||
|
|
||||||
// create new window
|
// create new window
|
||||||
if (window == NULL) {
|
if (!chatwin) {
|
||||||
window = wins_new_chat(barejid);
|
chatwin = ui_new_chat_win(barejid);
|
||||||
#ifdef HAVE_LIBOTR
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
if (otr_is_secure(barejid)) {
|
|
||||||
chatwin->is_otr = TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
num = wins_get_num(window);
|
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_CHLOG) && prefs_get_boolean(PREF_HISTORY)) {
|
|
||||||
_win_show_history(num, barejid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contact != NULL) {
|
|
||||||
if (strcmp(p_contact_presence(contact), "offline") == 0) {
|
|
||||||
const char *show = p_contact_presence(contact);
|
|
||||||
const char *status = p_contact_status(contact);
|
|
||||||
win_show_status_string(window, barejid, show, status, NULL, "--", "offline");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// use existing window
|
|
||||||
} else {
|
|
||||||
num = wins_get_num(window);
|
|
||||||
}
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin*)window;
|
|
||||||
chat_state_active(chatwin->state);
|
chat_state_active(chatwin->state);
|
||||||
|
|
||||||
win_print(window, '-', NULL, 0, THEME_TEXT_ME, "me", message);
|
win_print((ProfWin*)chatwin, '-', NULL, 0, THEME_TEXT_ME, "me", message);
|
||||||
|
|
||||||
|
int num = wins_get_num((ProfWin*)chatwin);
|
||||||
status_bar_active(num);
|
status_bar_active(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3003,12 +2947,8 @@ ui_hide_roster(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_win_show_history(int win_index, const char * const contact)
|
_win_show_history(ProfChatWin *chatwin, const char * const contact)
|
||||||
{
|
{
|
||||||
ProfWin *window = wins_get_by_num(win_index);
|
|
||||||
if (window->type == WIN_CHAT) {
|
|
||||||
ProfChatWin *chatwin = (ProfChatWin*) window;
|
|
||||||
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
|
|
||||||
if (!chatwin->history_shown) {
|
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);
|
||||||
@ -3024,11 +2964,11 @@ _win_show_history(int win_index, const char * const contact)
|
|||||||
GDateTime *time = g_date_time_new_local(2000, 1, 1, ihh, imm, iss);
|
GDateTime *time = g_date_time_new_local(2000, 1, 1, ihh, imm, iss);
|
||||||
GTimeVal tv;
|
GTimeVal tv;
|
||||||
g_date_time_to_timeval(time, &tv);
|
g_date_time_to_timeval(time, &tv);
|
||||||
win_print(window, '-', &tv, NO_COLOUR_DATE, 0, "", curr->data+11);
|
win_print((ProfWin*)chatwin, '-', &tv, NO_COLOUR_DATE, 0, "", curr->data+11);
|
||||||
g_date_time_unref(time);
|
g_date_time_unref(time);
|
||||||
// header
|
// header
|
||||||
} else {
|
} else {
|
||||||
win_print(window, '-', NULL, 0, 0, "", curr->data);
|
win_print((ProfWin*)chatwin, '-', NULL, 0, 0, "", curr->data);
|
||||||
}
|
}
|
||||||
curr = g_slist_next(curr);
|
curr = g_slist_next(curr);
|
||||||
}
|
}
|
||||||
@ -3037,5 +2977,4 @@ _win_show_history(int win_index, const char * const contact)
|
|||||||
g_slist_free_full(history, free);
|
g_slist_free_full(history, free);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void ui_handle_otr_error(const char * const barejid, const char * const message)
|
|||||||
unsigned long ui_get_idle_time(void);
|
unsigned long ui_get_idle_time(void);
|
||||||
void ui_reset_idle_time(void);
|
void ui_reset_idle_time(void);
|
||||||
void ui_new_private_win(const char * const fulljid);
|
void ui_new_private_win(const char * const fulljid);
|
||||||
ProfWin* ui_new_chat_win(const char * const barejid);
|
ProfChatWin* ui_new_chat_win(const char * const barejid);
|
||||||
void ui_print_system_msg_from_recipient(const char * const barejid, const char *message);
|
void ui_print_system_msg_from_recipient(const char * const barejid, const char *message);
|
||||||
gint ui_unread(void);
|
gint ui_unread(void);
|
||||||
void ui_close_connected_win(int index);
|
void ui_close_connected_win(int index);
|
||||||
|
@ -42,7 +42,10 @@ char* otr_start_query(void)
|
|||||||
void otr_poll(void) {}
|
void otr_poll(void) {}
|
||||||
void otr_on_connect(ProfAccount *account) {}
|
void otr_on_connect(ProfAccount *account) {}
|
||||||
void otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message) {}
|
void otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message) {}
|
||||||
void otr_on_message_send(const char * const barejid, const char * const message) {}
|
prof_otrsendres_t otr_on_message_send(const char * const barejid, const char * const message)
|
||||||
|
{
|
||||||
|
return PROF_OTRSUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
void otr_keygen(ProfAccount *account)
|
void otr_keygen(ProfAccount *account)
|
||||||
{
|
{
|
||||||
@ -106,3 +109,9 @@ prof_otrpolicy_t otr_get_policy(const char * const recipient)
|
|||||||
{
|
{
|
||||||
return PROF_OTRPOLICY_MANUAL;
|
return PROF_OTRPOLICY_MANUAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* otr_senderror_str(prof_otrsendres_t res)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ unsigned long ui_get_idle_time(void)
|
|||||||
|
|
||||||
void ui_reset_idle_time(void) {}
|
void ui_reset_idle_time(void) {}
|
||||||
void ui_new_private_win(const char * const fulljid) {}
|
void ui_new_private_win(const char * const fulljid) {}
|
||||||
ProfWin* ui_new_chat_win(const char * const barejid)
|
ProfChatWin* ui_new_chat_win(const char * const barejid)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user