mirror of
https://github.com/bqv/weechat-xmpp/
synced 2024-11-08 13:10:34 +00:00
readme and keepalives
This commit is contained in:
parent
7c15319f50
commit
668eb4ace1
@ -94,6 +94,7 @@
|
||||
* [X] Allow /close without crashing
|
||||
* [ ] [#B] Handle wide errors gracefully
|
||||
* [ ] [#B] Event-driven MUC entrance
|
||||
* [ ] Pings
|
||||
* [ ] MUCs
|
||||
* [X] Opening (/enter)
|
||||
* [ ] Leave on /close
|
||||
@ -127,6 +128,10 @@
|
||||
Please submit a pull request or create an issue
|
||||
to add a new or missing feature.
|
||||
|
||||
* Testemonials
|
||||
|
||||
"Weechat-Strophe - for the discerning dual IRCer XMPPer" -- [[github.com/janicez][Ellenor et al Bjornsdottir]]
|
||||
|
||||
* License
|
||||
|
||||
weechat-xmpp is licensed under the Mozilla Public
|
||||
|
18
account.h
18
account.h
@ -31,14 +31,18 @@ enum t_account_option
|
||||
weechat_config_option_set(account->options[option], value, 1)
|
||||
|
||||
#define account_jid(account) \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])
|
||||
account->connection && xmpp_conn_is_connected(account->connection) ? \
|
||||
xmpp_jid_bare(account->context, xmpp_conn_get_bound_jid(account->connection)) : \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])
|
||||
#define account_jid_device(account) \
|
||||
xmpp_jid_new(account->context, \
|
||||
xmpp_jid_node(account->context, \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])), \
|
||||
xmpp_jid_domain(account->context, \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])), \
|
||||
"weechat")
|
||||
account->connection && xmpp_conn_is_connected(account->connection) ? \
|
||||
xmpp_conn_get_bound_jid(account->connection) : \
|
||||
xmpp_jid_new(account->context, \
|
||||
xmpp_jid_node(account->context, \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])), \
|
||||
xmpp_jid_domain(account->context, \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_JID])), \
|
||||
"weechat")
|
||||
#define account_password(account) \
|
||||
weechat_config_string(account->options[ACCOUNT_OPTION_PASSWORD])
|
||||
#define account_tls(account) \
|
||||
|
@ -460,7 +460,8 @@ void connection__handler(xmpp_conn_t *conn, xmpp_conn_event_t status,
|
||||
|
||||
omemo__init(account);
|
||||
} else {
|
||||
//xmpp_stop(account->context);
|
||||
account__disconnect(account, 1);
|
||||
//xmpp_stop(account->context); //keep context?
|
||||
}
|
||||
}
|
||||
|
||||
@ -482,7 +483,13 @@ char* connection__rand_string(int length)
|
||||
int connection__connect(struct t_account *account, xmpp_conn_t **connection,
|
||||
const char* jid, const char* password, int tls)
|
||||
{
|
||||
static const unsigned ka_timeout_sec = 60;
|
||||
static const unsigned ka_timeout_ivl = 1;
|
||||
|
||||
*connection = xmpp_conn_new(account->context);
|
||||
|
||||
xmpp_conn_set_keepalive(*connection, ka_timeout_sec, ka_timeout_ivl);
|
||||
|
||||
const char *resource = account_resource(account);
|
||||
if (!(resource && strlen(resource)))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user