Added /duck command to perform searches using duckduckgo chat bot

This commit is contained in:
James Booth
2013-05-05 02:31:04 +01:00
parent 8c5866ff52
commit 90ac69beb3
11 changed files with 182 additions and 10 deletions

View File

@@ -55,7 +55,7 @@ stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const recipient,
xmpp_stanza_t *
stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient,
const char * const type, const char * const message,
const char * const state)
const char * const state, const char * const id)
{
char *encoded_xml = encode_xml(message);
@@ -65,6 +65,9 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient,
xmpp_stanza_set_name(msg, STANZA_NAME_MESSAGE);
xmpp_stanza_set_type(msg, type);
xmpp_stanza_set_attribute(msg, STANZA_ATTR_TO, recipient);
if (id != NULL) {
xmpp_stanza_set_id(msg, id);
}
body = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(body, STANZA_NAME_BODY);