diff --git a/README.org b/README.org index 01cce45..43336ac 100644 --- a/README.org +++ b/README.org @@ -17,24 +17,23 @@ [[https://github.com/bqv/weechat-xmpp/blob/master/LICENSE][file:https://img.shields.io/github/license/bqv/weechat-xmpp.svg]] [[https://github.com/bqv/weechat-extras/][file:https://img.shields.io/badge/weechat--extras-xmpp-blue.svg]] - | Status: | Aaaaaaaaaaaaaaaaa | - | Location: | [[http://github.com/bqv/weechat-xmpp]] | - | Version: | 0.1.0 | - | Disclaimer: | I'm lazy | + | Status: | XMPP for power users and digital masochists | + | Location: | [[http://github.com/bqv/weechat-xmpp]] | + | Version: | 0.1.1 | + | Disclaimer: | I'm lazy and unashamedly clinically insane | * Description A weechat plugin in C to extend the chat client to - support XMPP and ideally a maximal set of XEPs. - + support XMPP and a currently minimal but ideally maximal + set of XEPs. + * Usage - 1. Start with =/xmpp register= for instructions on how - to obtain a token, or if you already have a token, use - =/xmpp register =. + 1. Start with =/xmpp add=, use =/help xmpp= for instructions. - 2. Use =/xmpp connect = with the name - returned by register + 2. Use =/xmpp connect = with the name set at + add-time. * Installing @@ -42,9 +41,9 @@ * Dependencies - - libstrophe (static, submodule) - - json-c (static, submodule) - - weechat (>= v1.7) + - libstrophe (dynamic, dependency) + - libxml2 (dynamic, dependency) + - weechat (>= v2.5) * Building @@ -54,19 +53,19 @@ make make install #+end_src - + Do *NOT* run make install as root, it installs the plugin to your local weechat plugins directory - + * Development - + I use emacs for development of this, although I am also a fan of vim. My debug build process involves static analysis with clang and cppcheck, and dynamic analysis with address-sanitizer and leak-sanitizer. My debug evaluation process involves gdb/mi run with the arguments =-ex "handle SIGPIPE nostop noprint pass" --args weechat -a 2>asan.log= since part of weechat and it's default plugins use SIGPIPE as control. - + I have no real requests for style of pull requests besides a wish that you keep vaguely to the style I have adopted for this project. @@ -74,8 +73,16 @@ * Tasks -** TODO [#A] Implement basic functionality (milestone v0.1) -** TODO [#A] Implement essential events (milestone v0.2) +** DONE [#A] Implement basic functionality (milestone v0.1) + * [x] Connecting + * [x] Pretty-printing stanzas + * [x] Receiveing and formatting PMs to a dedicated buffer + * [x] Responding to PMs and formatting responses +** TODO [#A] Implement essential functionality (milestone v0.2) + * [ ] MUCs + * [ ] OMEMO presence + * [ ] OMEMO messages + * [ ] MUC PMs ** TODO [#B] Implement completion engine (milestone v0.3) ** TODO [#D] Close all issues (milestone v1.0) diff --git a/channel.c b/channel.c index 04c277f..c7da101 100644 --- a/channel.c +++ b/channel.c @@ -597,3 +597,9 @@ struct t_channel_member *channel__add_member(struct t_account *account, return member; } + +void channel__send_message(struct t_account *account, struct t_channel *channel, + const char *to, const char *message) +{ + +} diff --git a/connection.c b/connection.c index 8b0a787..39a3111 100644 --- a/connection.c +++ b/connection.c @@ -95,23 +95,7 @@ int message_handler(xmpp_conn_t *conn, xmpp_stanza_t *stanza, void *userdata) weechat_printf(channel->buffer, "<-(%s)- %s: %s", to, from, intext); - reply = xmpp_stanza_reply(stanza); - if (xmpp_stanza_get_type(reply) == NULL) - xmpp_stanza_set_type(reply, "chat"); - - replytext = (char *)malloc(strlen(" received!") + strlen(intext) + 1); - strcpy(replytext, intext); - strcat(replytext, " received!"); - xmpp_free(account->context, intext); - xmpp_message_set_body(reply, replytext); - - xmpp_send(conn, reply); - xmpp_stanza_release(reply); - weechat_printf(channel->buffer, "-> %s: %s", - weechat_config_string(account->options[ACCOUNT_OPTION_JID]), - replytext); - free(replytext); return 1; } diff --git a/plugin.h b/plugin.h index bc5ff5d..d2a3f07 100644 --- a/plugin.h +++ b/plugin.h @@ -7,7 +7,7 @@ #define weechat_plugin weechat_xmpp_plugin #define WEECHAT_XMPP_PLUGIN_NAME "xmpp" -#define WEECHAT_XMPP_PLUGIN_VERSION "0.1" +#define WEECHAT_XMPP_PLUGIN_VERSION "0.1.1" extern struct t_weechat_plugin *weechat_xmpp_plugin;