mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Rename prof_message_t into ProfMessage
This commit is contained in:
parent
9482ce6168
commit
f831f65737
@ -267,7 +267,7 @@ sv_ev_room_subject(const char *const room, const char *const nick, const char *c
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_room_history(prof_message_t *message)
|
||||
sv_ev_room_history(ProfMessage *message)
|
||||
{
|
||||
ProfMucWin *mucwin = wins_get_muc(message->jid->barejid);
|
||||
if (mucwin) {
|
||||
@ -289,7 +289,7 @@ sv_ev_room_history(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_room_message(prof_message_t *message)
|
||||
sv_ev_room_message(ProfMessage *message)
|
||||
{
|
||||
ProfMucWin *mucwin = wins_get_muc(message->jid->barejid);
|
||||
if (!mucwin) {
|
||||
@ -381,7 +381,7 @@ sv_ev_room_message(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_incoming_private_message(prof_message_t *message)
|
||||
sv_ev_incoming_private_message(ProfMessage *message)
|
||||
{
|
||||
char *old_plain = message->plain;
|
||||
message->plain = plugins_pre_priv_message_display(message->jid->fulljid, message->plain);
|
||||
@ -401,7 +401,7 @@ sv_ev_incoming_private_message(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_delayed_private_message(prof_message_t *message)
|
||||
sv_ev_delayed_private_message(ProfMessage *message)
|
||||
{
|
||||
char *old_plain = message->plain;
|
||||
message->plain = plugins_pre_priv_message_display(message->jid->fulljid, message->plain);
|
||||
@ -483,7 +483,7 @@ sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message, gboolean
|
||||
|
||||
#ifdef HAVE_LIBGPGME
|
||||
static void
|
||||
_sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, prof_message_t *message)
|
||||
_sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
|
||||
{
|
||||
message->plain = p_gpg_decrypt(message->encrypted);
|
||||
if (message->plain) {
|
||||
@ -504,7 +504,7 @@ _sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, prof_message_t *mess
|
||||
|
||||
#ifdef HAVE_LIBOTR
|
||||
static void
|
||||
_sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, prof_message_t *message)
|
||||
_sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
|
||||
{
|
||||
gboolean decrypted = FALSE;
|
||||
message->plain = otr_on_message_recv(message->jid->barejid, message->jid->resourcepart, message->body, &decrypted);
|
||||
@ -528,7 +528,7 @@ _sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, prof_message_t *mess
|
||||
|
||||
#ifdef HAVE_OMEMO
|
||||
static void
|
||||
_sv_ev_incoming_omemo(ProfChatWin *chatwin, gboolean new_win, prof_message_t *message)
|
||||
_sv_ev_incoming_omemo(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
|
||||
{
|
||||
chatwin_incoming_msg(chatwin, message, new_win);
|
||||
chat_log_omemo_msg_in(message);
|
||||
@ -537,7 +537,7 @@ _sv_ev_incoming_omemo(ProfChatWin *chatwin, gboolean new_win, prof_message_t *me
|
||||
#endif
|
||||
|
||||
static void
|
||||
_sv_ev_incoming_plain(ProfChatWin *chatwin, gboolean new_win, prof_message_t *message)
|
||||
_sv_ev_incoming_plain(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
|
||||
{
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_incoming_msg(chatwin, message, new_win);
|
||||
@ -546,7 +546,7 @@ _sv_ev_incoming_plain(ProfChatWin *chatwin, gboolean new_win, prof_message_t *me
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_incoming_message(prof_message_t *message)
|
||||
sv_ev_incoming_message(ProfMessage *message)
|
||||
{
|
||||
gboolean new_win = FALSE;
|
||||
ProfChatWin *chatwin = wins_get_chat(message->jid->barejid);
|
||||
@ -689,7 +689,7 @@ sv_ev_incoming_message(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
sv_ev_incoming_carbon(prof_message_t *message)
|
||||
sv_ev_incoming_carbon(ProfMessage *message)
|
||||
{
|
||||
gboolean new_win = FALSE;
|
||||
ProfChatWin *chatwin = wins_get_chat(message->jid->barejid);
|
||||
|
@ -46,11 +46,11 @@ void sv_ev_room_invite(jabber_invite_t invite_type,
|
||||
const char *const reason, const char *const password);
|
||||
void sv_ev_room_broadcast(const char *const room_jid, const char *const message);
|
||||
void sv_ev_room_subject(const char *const room, const char *const nick, const char *const subject);
|
||||
void sv_ev_room_history(prof_message_t *message);
|
||||
void sv_ev_room_message(prof_message_t *message);
|
||||
void sv_ev_incoming_message(prof_message_t *message);
|
||||
void sv_ev_incoming_private_message(prof_message_t *message);
|
||||
void sv_ev_delayed_private_message(prof_message_t *message);
|
||||
void sv_ev_room_history(ProfMessage *message);
|
||||
void sv_ev_room_message(ProfMessage *message);
|
||||
void sv_ev_incoming_message(ProfMessage *message);
|
||||
void sv_ev_incoming_private_message(ProfMessage *message);
|
||||
void sv_ev_delayed_private_message(ProfMessage *message);
|
||||
void sv_ev_typing(char *barejid, char *resource);
|
||||
void sv_ev_paused(char *barejid, char *resource);
|
||||
void sv_ev_inactive(char *barejid, char *resource);
|
||||
@ -72,8 +72,8 @@ void sv_ev_room_occupent_kicked(const char *const room, const char *const nick,
|
||||
void sv_ev_room_banned(const char *const room, const char *const actor, const char *const reason);
|
||||
void sv_ev_room_occupent_banned(const char *const room, const char *const nick, const char *const actor,
|
||||
const char *const reason);
|
||||
void sv_ev_outgoing_carbon(prof_message_t *message);
|
||||
void sv_ev_incoming_carbon(prof_message_t *message);
|
||||
void sv_ev_outgoing_carbon(ProfMessage *message);
|
||||
void sv_ev_incoming_carbon(ProfMessage *message);
|
||||
void sv_ev_xmpp_stanza(const char *const msg);
|
||||
void sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean config_required,
|
||||
const char *const role, const char *const affiliation, const char *const actor, const char *const reason,
|
||||
|
@ -329,7 +329,7 @@ chat_log_omemo_msg_out(const char *const barejid, const char *const msg)
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_otr_msg_in(prof_message_t *message)
|
||||
chat_log_otr_msg_in(ProfMessage *message)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
@ -346,7 +346,7 @@ chat_log_otr_msg_in(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_pgp_msg_in(prof_message_t *message)
|
||||
chat_log_pgp_msg_in(ProfMessage *message)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
@ -363,7 +363,7 @@ chat_log_pgp_msg_in(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_omemo_msg_in(prof_message_t *message)
|
||||
chat_log_omemo_msg_in(ProfMessage *message)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
@ -380,7 +380,7 @@ chat_log_omemo_msg_in(prof_message_t *message)
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_msg_in(prof_message_t *message)
|
||||
chat_log_msg_in(ProfMessage *message)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
|
@ -75,10 +75,10 @@ void chat_log_otr_msg_out(const char *const barejid, const char *const msg);
|
||||
void chat_log_pgp_msg_out(const char *const barejid, const char *const msg);
|
||||
void chat_log_omemo_msg_out(const char *const barejid, const char *const msg);
|
||||
|
||||
void chat_log_msg_in(prof_message_t *message);
|
||||
void chat_log_otr_msg_in(prof_message_t *message);
|
||||
void chat_log_pgp_msg_in(prof_message_t *message);
|
||||
void chat_log_omemo_msg_in(prof_message_t *message);
|
||||
void chat_log_msg_in(ProfMessage *message);
|
||||
void chat_log_otr_msg_in(ProfMessage *message);
|
||||
void chat_log_pgp_msg_in(ProfMessage *message);
|
||||
void chat_log_omemo_msg_in(ProfMessage *message);
|
||||
|
||||
void chat_log_close(void);
|
||||
GSList* chat_log_get_previous(const gchar *const login, const gchar *const recipient);
|
||||
|
@ -473,7 +473,7 @@ api_settings_int_set(const char *const group, const char *const key, int value)
|
||||
void
|
||||
api_incoming_message(const char *const barejid, const char *const resource, const char *const plain)
|
||||
{
|
||||
prof_message_t *message = message_init();
|
||||
ProfMessage *message = message_init();
|
||||
message->jid = jid_create_from_bare_and_resource(barejid, resource);
|
||||
message->plain = strdup(plain);
|
||||
|
||||
|
@ -241,7 +241,7 @@ chatwin_recipient_gone(ProfChatWin *chatwin)
|
||||
}
|
||||
|
||||
void
|
||||
chatwin_incoming_msg(ProfChatWin *chatwin, prof_message_t *message, gboolean win_created)
|
||||
chatwin_incoming_msg(ProfChatWin *chatwin, ProfMessage *message, gboolean win_created)
|
||||
{
|
||||
assert(chatwin != NULL);
|
||||
char *old_plain = message->plain;
|
||||
|
@ -524,7 +524,7 @@ mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *c
|
||||
}
|
||||
|
||||
void
|
||||
mucwin_incoming_msg(ProfMucWin *mucwin, prof_message_t *message, GSList *mentions, GList *triggers)
|
||||
mucwin_incoming_msg(ProfMucWin *mucwin, ProfMessage *message, GSList *mentions, GList *triggers)
|
||||
{
|
||||
assert(mucwin != NULL);
|
||||
int flags = 0;
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "ui/window_list.h"
|
||||
|
||||
void
|
||||
privwin_incoming_msg(ProfPrivateWin *privatewin, prof_message_t *message)
|
||||
privwin_incoming_msg(ProfPrivateWin *privatewin, ProfMessage *message)
|
||||
{
|
||||
assert(privatewin != NULL);
|
||||
|
||||
|
@ -120,7 +120,7 @@ gboolean ui_win_has_unsaved_form(int num);
|
||||
|
||||
// Chat window
|
||||
ProfChatWin* chatwin_new(const char *const barejid);
|
||||
void chatwin_incoming_msg(ProfChatWin *chatwin, prof_message_t *message, gboolean win_created);
|
||||
void chatwin_incoming_msg(ProfChatWin *chatwin, ProfMessage *message, gboolean win_created);
|
||||
void chatwin_receipt_received(ProfChatWin *chatwin, const char *const id);
|
||||
void chatwin_recipient_gone(ProfChatWin *chatwin);
|
||||
void chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode,
|
||||
@ -159,7 +159,7 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char
|
||||
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char *const presence);
|
||||
void mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp, const char *const message);
|
||||
void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *const id, prof_enc_t enc_mode);
|
||||
void mucwin_incoming_msg(ProfMucWin *mucwin, prof_message_t *message, GSList *mentions, GList *triggers);
|
||||
void mucwin_incoming_msg(ProfMucWin *mucwin, ProfMessage *message, GSList *mentions, GList *triggers);
|
||||
void mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const subject);
|
||||
void mucwin_requires_config(ProfMucWin *mucwin);
|
||||
void mucwin_info(ProfMucWin *mucwin);
|
||||
@ -197,7 +197,7 @@ void mucwin_set_message_char(ProfMucWin *mucwin, const char *const ch);
|
||||
void mucwin_unset_message_char(ProfMucWin *mucwin);
|
||||
|
||||
// MUC private chat window
|
||||
void privwin_incoming_msg(ProfPrivateWin *privatewin, prof_message_t *message);
|
||||
void privwin_incoming_msg(ProfPrivateWin *privatewin, ProfMessage *message);
|
||||
void privwin_outgoing_msg(ProfPrivateWin *privwin, const char *const message);
|
||||
void privwin_message_occupant_offline(ProfPrivateWin *privwin);
|
||||
|
||||
|
@ -1044,7 +1044,7 @@ win_show_status_string(ProfWin *window, const char *const from,
|
||||
}
|
||||
|
||||
void
|
||||
win_print_incoming(ProfWin *window, const char *const from, prof_message_t *message)
|
||||
win_print_incoming(ProfWin *window, const char *const from, ProfMessage *message)
|
||||
{
|
||||
char enc_char = '-';
|
||||
int flags = NO_ME;
|
||||
|
@ -65,7 +65,7 @@ void win_println_them_message(ProfWin *window, char ch, int flags, const char *c
|
||||
void win_println_me_message(ProfWin *window, char ch, const char *const me, const char *const message, ...);
|
||||
|
||||
void win_print_outgoing(ProfWin *window, const char ch, const char *const message, ...);
|
||||
void win_print_incoming(ProfWin *window, const char *const from, prof_message_t *message);
|
||||
void win_print_incoming(ProfWin *window, const char *const from, ProfMessage *message);
|
||||
void win_print_history(ProfWin *window, GDateTime *timestamp, const char *const message, ...);
|
||||
|
||||
void win_print_http_upload(ProfWin *window, const char *const message, char *url);
|
||||
|
@ -179,10 +179,10 @@ message_handlers_init(void)
|
||||
pubsub_event_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
|
||||
}
|
||||
|
||||
prof_message_t *
|
||||
ProfMessage *
|
||||
message_init(void)
|
||||
{
|
||||
prof_message_t *message = malloc(sizeof(prof_message_t));
|
||||
ProfMessage *message = malloc(sizeof(ProfMessage));
|
||||
|
||||
message->jid = NULL;
|
||||
message->id = NULL;
|
||||
@ -196,7 +196,7 @@ message_init(void)
|
||||
}
|
||||
|
||||
void
|
||||
message_free(prof_message_t *message)
|
||||
message_free(ProfMessage *message)
|
||||
{
|
||||
xmpp_ctx_t *ctx = connection_get_ctx();
|
||||
if (message->jid) {
|
||||
@ -796,7 +796,7 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
|
||||
return;
|
||||
}
|
||||
|
||||
prof_message_t *message = message_init();
|
||||
ProfMessage *message = message_init();
|
||||
message->jid = jid;
|
||||
message->id = strdup(id);
|
||||
|
||||
@ -898,7 +898,7 @@ static void
|
||||
_private_chat_handler(xmpp_stanza_t *const stanza)
|
||||
{
|
||||
// standard chat message, use jid without resource
|
||||
prof_message_t *message = message_init();
|
||||
ProfMessage *message = message_init();
|
||||
|
||||
const gchar *from = xmpp_stanza_get_from(stanza);
|
||||
message->jid = jid_create(from);
|
||||
@ -966,7 +966,7 @@ _handle_carbons(xmpp_stanza_t *const stanza)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
prof_message_t *message = message_init();
|
||||
ProfMessage *message = message_init();
|
||||
|
||||
// check omemo encryption
|
||||
#ifdef HAVE_OMEMO
|
||||
@ -1054,7 +1054,7 @@ _handle_chat(xmpp_stanza_t *const stanza)
|
||||
}
|
||||
|
||||
// standard chat message, use jid without resource
|
||||
prof_message_t *message = message_init();
|
||||
ProfMessage *message = message_init();
|
||||
message->jid = jid;
|
||||
|
||||
message->timestamp = stanza_get_delay(stanza);
|
||||
|
@ -44,7 +44,7 @@ typedef enum {
|
||||
PROF_MSG_ENC_OMEMO
|
||||
} prof_enc_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct prof_message_t {
|
||||
Jid *jid;
|
||||
char *id;
|
||||
/* The raw body from xmpp message, either plaintext or OTR encrypted text */
|
||||
@ -56,13 +56,13 @@ typedef struct {
|
||||
GDateTime *timestamp;
|
||||
prof_enc_t enc;
|
||||
gboolean trusted;
|
||||
} prof_message_t;
|
||||
} ProfMessage;
|
||||
|
||||
typedef int(*ProfMessageCallback)(xmpp_stanza_t *const stanza, void *const userdata);
|
||||
typedef void(*ProfMessageFreeCallback)(void *userdata);
|
||||
|
||||
prof_message_t *message_init(void);
|
||||
void message_free(prof_message_t *message);
|
||||
ProfMessage *message_init(void);
|
||||
void message_free(ProfMessage *message);
|
||||
void message_handlers_init(void);
|
||||
void message_handlers_clear(void);
|
||||
void message_pubsub_event_handler_add(const char *const node, ProfMessageCallback func, ProfMessageFreeCallback free_func, void *userdata);
|
||||
|
@ -60,10 +60,10 @@ void chat_log_otr_msg_out(const char * const barejid, const char * const msg) {}
|
||||
void chat_log_pgp_msg_out(const char * const barejid, const char * const msg) {}
|
||||
void chat_log_omemo_msg_out(const char *const barejid, const char *const msg) {}
|
||||
|
||||
void chat_log_msg_in(prof_message_t *message) {}
|
||||
void chat_log_otr_msg_in(prof_message_t *message) {}
|
||||
void chat_log_pgp_msg_in(prof_message_t *message) {}
|
||||
void chat_log_omemo_msg_in(prof_message_t *message) {}
|
||||
void chat_log_msg_in(ProfMessage *message) {}
|
||||
void chat_log_otr_msg_in(ProfMessage *message) {}
|
||||
void chat_log_pgp_msg_in(ProfMessage *message) {}
|
||||
void chat_log_omemo_msg_in(ProfMessage *message) {}
|
||||
|
||||
void chat_log_close(void) {}
|
||||
GSList * chat_log_get_previous(const gchar * const login,
|
||||
|
@ -152,10 +152,10 @@ void ui_contact_online(char *barejid, Resource *resource, GDateTime *last_activi
|
||||
}
|
||||
|
||||
void ui_contact_typing(const char * const barejid, const char * const resource) {}
|
||||
void chatwin_incoming_msg(ProfChatWin *chatwin, prof_message_t *message, gboolean win_created) {}
|
||||
void chatwin_incoming_msg(ProfChatWin *chatwin, ProfMessage *message, gboolean win_created) {}
|
||||
void chatwin_receipt_received(ProfChatWin *chatwin, const char * const id) {}
|
||||
|
||||
void privwin_incoming_msg(ProfPrivateWin *privatewin, prof_message_t *message) {}
|
||||
void privwin_incoming_msg(ProfPrivateWin *privatewin, ProfMessage *message) {}
|
||||
|
||||
void ui_disconnected(void) {}
|
||||
void chatwin_recipient_gone(ProfChatWin *chatwin) {}
|
||||
@ -190,7 +190,7 @@ void mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char
|
||||
const char * const affiliation, const char * const actor, const char * const reason) {}
|
||||
void mucwin_roster(ProfMucWin *mucwin, GList *occupants, const char * const presence) {}
|
||||
void mucwin_history(ProfMucWin *mucwin, const char * const nick, GDateTime *timestamp, const char * const message) {}
|
||||
void mucwin_incoming_msg(ProfMucWin *mucwin, prof_message_t *message, GSList *mentions, GList *triggers) {}
|
||||
void mucwin_incoming_msg(ProfMucWin *mucwin, ProfMessage *message, GSList *mentions, GList *triggers) {}
|
||||
void mucwin_outgoing_msg(ProfMucWin *mucwin, const char *const message, const char *const id, prof_enc_t enc_mode) {}
|
||||
void mucwin_subject(ProfMucWin *mucwin, const char * const nick, const char * const subject) {}
|
||||
void mucwin_requires_config(ProfMucWin *mucwin) {}
|
||||
|
Loading…
Reference in New Issue
Block a user