about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-18 00:07:48 +0100
committerJames Booth <boothj5@gmail.com>2014-10-18 00:07:48 +0100
commit9f2f54b2a0ee51f7f946c8bd259920a1df1b52cc (patch)
tree7c7a939aaaa4b4cab31a801bb0e4bfd45c79b013 /src/xmpp
parent6b6ed6a93eab0809d32a95cc7e879b5378bf7678 (diff)
downloadprofani-tty-9f2f54b2a0ee51f7f946c8bd259920a1df1b52cc.tar.gz
Removed /duck command
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/message.c29
-rw-r--r--src/xmpp/xmpp.h1
2 files changed, 1 insertions, 29 deletions
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 16a51829..b0b17214 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -136,18 +136,6 @@ _message_send_groupchat_subject(const char * const room, const char * const subj
 }
 
 static void
-_message_send_duck(const char * const query)
-{
-    xmpp_conn_t * const conn = connection_get_conn();
-    xmpp_ctx_t * const ctx = connection_get_ctx();
-    xmpp_stanza_t *message = stanza_create_message(ctx, "im@ddg.gg",
-        STANZA_TYPE_CHAT, query, NULL);
-
-    xmpp_send(conn, message);
-    xmpp_stanza_release(message);
-}
-
-static void
 _message_send_invite(const char * const room, const char * const contact,
     const char * const reason)
 {
@@ -438,22 +426,8 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     gchar *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
     Jid *jid = jid_create(from);
 
-    // handle ddg searches
-    if (strcmp(jid->barejid, "im@ddg.gg") == 0) {
-        xmpp_stanza_t *body = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_BODY);
-        if (body != NULL) {
-            char *message = xmpp_stanza_get_text(body);
-            if (message != NULL) {
-                handle_duck_result(message);
-                xmpp_free(ctx, message);
-            }
-        }
-
-        jid_destroy(jid);
-        return 1;
-
     // private message from chat room use full jid (room/nick)
-    } else if (muc_active(jid->barejid)) {
+    if (muc_active(jid->barejid)) {
         // determine if the notifications happened whilst offline
         GTimeVal tv_stamp;
         gboolean delayed = stanza_get_delay(stanza, &tv_stamp);
@@ -533,7 +507,6 @@ message_init_module(void)
 {
     message_send = _message_send;
     message_send_groupchat = _message_send_groupchat;
-    message_send_duck = _message_send_duck;
     message_send_invite = _message_send_invite;
     message_send_composing = _message_send_composing;
     message_send_paused = _message_send_paused;
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index 798cb339..1d391cbc 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -164,7 +164,6 @@ void (*message_send_paused)(const char * const recipient);
 void (*message_send_gone)(const char * const recipient);
 void (*message_send_invite)(const char * const room, const char * const contact,
     const char * const reason);
-void (*message_send_duck)(const char * const query);
 
 // presence functions
 void (*presence_subscription)(const char * const jid, const jabber_subscr_t action);