From f831f6573737fc4079219c3159b40fb964b8f1d7 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Wed, 19 Jun 2019 06:43:10 +0200 Subject: Rename prof_message_t into ProfMessage --- src/event/server_events.c | 20 ++++++++++---------- src/event/server_events.h | 14 +++++++------- src/log.c | 8 ++++---- src/log.h | 8 ++++---- src/plugins/api.c | 2 +- src/ui/chatwin.c | 2 +- src/ui/mucwin.c | 2 +- src/ui/privwin.c | 2 +- src/ui/ui.h | 6 +++--- src/ui/window.c | 2 +- src/ui/window.h | 2 +- src/xmpp/message.c | 14 +++++++------- src/xmpp/message.h | 8 ++++---- 13 files changed, 45 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/event/server_events.c b/src/event/server_events.c index 60d2dbf9..7c65a89f 100644 --- a/src/event/server_events.c +++ b/src/event/server_events.c @@ -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); diff --git a/src/event/server_events.h b/src/event/server_events.h index f0e24e54..6687960b 100644 --- a/src/event/server_events.h +++ b/src/event/server_events.h @@ -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, diff --git a/src/log.c b/src/log.c index 732809bd..c1c46a75 100644 --- a/src/log.c +++ b/src/log.c @@ -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(); diff --git a/src/log.h b/src/log.h index e6bea8dc..09238602 100644 --- a/src/log.h +++ b/src/log.h @@ -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); diff --git a/src/plugins/api.c b/src/plugins/api.c index 2761b254..30511443 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -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); diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index f6c1097e..5a32b5ae 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -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; diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 119a0c7d..fcc529cd 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -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; diff --git a/src/ui/privwin.c b/src/ui/privwin.c index 8fc8400a..1ba3c0c2 100644 --- a/src/ui/privwin.c +++ b/src/ui/privwin.c @@ -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); diff --git a/src/ui/ui.h b/src/ui/ui.h index d64e4080..7c5bed89 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -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); diff --git a/src/ui/window.c b/src/ui/window.c index 410e5e97..93e5801c 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -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; diff --git a/src/ui/window.h b/src/ui/window.h index 09dd06bb..b1e78bd9 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -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); diff --git a/src/xmpp/message.c b/src/xmpp/message.c index 19657da0..c100684e 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -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); diff --git a/src/xmpp/message.h b/src/xmpp/message.h index f4861378..7660e9a9 100644 --- a/src/xmpp/message.h +++ b/src/xmpp/message.h @@ -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); -- cgit 1.4.1-2-gfad0