about summary refs log tree commit diff stats
path: root/src/event
diff options
context:
space:
mode:
authorDominik Heidler <dominik@heidler.eu>2016-04-11 20:13:18 +0200
committerDominik Heidler <dominik@heidler.eu>2016-04-26 23:50:55 +0200
commit1b0ce852bba81c3bbed1f7cbf04d0b60f1f0961b (patch)
tree6a611a76d29452910014f9cee4060b372145ece4 /src/event
parent28e260c7da7bddebcb7b08003174eb16b9a6f596 (diff)
downloadprofani-tty-1b0ce852bba81c3bbed1f7cbf04d0b60f1f0961b.tar.gz
Implement XEP-0363: HTTP File Upload
Diffstat (limited to 'src/event')
-rw-r--r--src/event/client_events.c18
-rw-r--r--src/event/client_events.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/src/event/client_events.c b/src/event/client_events.c
index 20a1a861..1c715f03 100644
--- a/src/event/client_events.c
+++ b/src/event/client_events.c
@@ -106,7 +106,7 @@ cl_ev_presence_send(const resource_presence_t presence_type, const char *const m
 }
 
 void
-cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
+cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg, const char *const oob_url)
 {
     chat_state_active(chatwin->state);
     char *plugin_msg = plugins_pre_chat_message_send(chatwin->barejid, msg);
@@ -122,7 +122,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
     } else {
         gboolean handled = otr_on_message_send(chatwin, plugin_msg);
         if (!handled) {
-            char *id = message_send_chat(chatwin->barejid, plugin_msg);
+            char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url);
             chat_log_msg_out(chatwin->barejid, plugin_msg);
             chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_PLAIN);
             free(id);
@@ -140,7 +140,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
 #ifndef HAVE_LIBGPGME
     gboolean handled = otr_on_message_send(chatwin, plugin_msg);
     if (!handled) {
-        char *id = message_send_chat(chatwin->barejid, plugin_msg);
+        char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url);
         chat_log_msg_out(chatwin->barejid, plugin_msg);
         chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_PLAIN);
         free(id);
@@ -161,7 +161,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
         chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_PGP);
         free(id);
     } else {
-        char *id = message_send_chat(chatwin->barejid, plugin_msg);
+        char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url);
         chat_log_msg_out(chatwin->barejid, plugin_msg);
         chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_PLAIN);
         free(id);
@@ -176,7 +176,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
 // OTR unsupported, PGP unsupported
 #ifndef HAVE_LIBOTR
 #ifndef HAVE_LIBGPGME
-    char *id = message_send_chat(chatwin->barejid, plugin_msg);
+    char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url);
     chat_log_msg_out(chatwin->barejid, plugin_msg);
     chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_PLAIN);
     free(id);
@@ -189,18 +189,18 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg)
 }
 
 void
-cl_ev_send_muc_msg(ProfMucWin *mucwin, const char *const msg)
+cl_ev_send_muc_msg(ProfMucWin *mucwin, const char *const msg, const char *const oob_url)
 {
     char *plugin_msg = plugins_pre_room_message_send(mucwin->roomjid, msg);
 
-    message_send_groupchat(mucwin->roomjid, plugin_msg);
+    message_send_groupchat(mucwin->roomjid, plugin_msg, oob_url);
 
     plugins_post_room_message_send(mucwin->roomjid, plugin_msg);
     free(plugin_msg);
 }
 
 void
-cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg)
+cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg, const char *const oob_url)
 {
     if (privwin->occupant_offline) {
         privwin_message_occupant_offline(privwin);
@@ -209,7 +209,7 @@ cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg)
     } else {
         char *plugin_msg = plugins_pre_priv_message_send(privwin->fulljid, msg);
 
-        message_send_private(privwin->fulljid, plugin_msg);
+        message_send_private(privwin->fulljid, plugin_msg, oob_url);
         privwin_outgoing_msg(privwin, plugin_msg);
 
         plugins_post_priv_message_send(privwin->fulljid, plugin_msg);
diff --git a/src/event/client_events.h b/src/event/client_events.h
index 7b7ec13a..3231ade9 100644
--- a/src/event/client_events.h
+++ b/src/event/client_events.h
@@ -42,8 +42,8 @@ void cl_ev_disconnect(void);
 
 void cl_ev_presence_send(const resource_presence_t presence_type, const char *const msg, const int idle_secs);
 
-void cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg);
-void cl_ev_send_muc_msg(ProfMucWin *mucwin, const char *const msg);
-void cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg);
+void cl_ev_send_msg(ProfChatWin *chatwin, const char *const msg, const char *const oob_url);
+void cl_ev_send_muc_msg(ProfMucWin *mucwin, const char *const msg, const char *const oob_url);
+void cl_ev_send_priv_msg(ProfPrivateWin *privwin, const char *const msg, const char *const oob_url);
 
 #endif