diff options
author | Marius Halden <marius.h@lden.org> | 2017-01-01 21:52:49 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-01-01 21:52:49 +0100 |
commit | efaa514039a4b907e2c5c6309295c66b27b1f691 (patch) | |
tree | 55f4962e14be3df95c4168d06a8d1b95ccfb8298 /protocols | |
parent | d35affbcea87f453fb20c4bb545a10b668eae81b (diff) | |
parent | 2e8523b30bafa86685655001457a2615936b646a (diff) |
Merge branch 'master' into patched-master
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/account.c | 3 | ||||
-rw-r--r-- | protocols/bee_user.c | 10 | ||||
-rw-r--r-- | protocols/jabber/s5bytestream.c | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/protocols/account.c b/protocols/account.c index aa1ffe61..80b1d020 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -59,6 +59,9 @@ account_t *account_add(bee_t *bee, struct prpl *prpl, char *user, char *pass) s = set_add(&a->set, "auto_reconnect", "true", set_eval_bool, a); + s = set_add(&a->set, "handle_unknown", NULL, NULL, a); + s->flags |= SET_NULL_OK; + s = set_add(&a->set, "nick_format", NULL, NULL, a); s->flags |= SET_NULL_OK; diff --git a/protocols/bee_user.c b/protocols/bee_user.c index ced92ee9..79c99ec9 100644 --- a/protocols/bee_user.c +++ b/protocols/bee_user.c @@ -169,10 +169,13 @@ void imcb_buddy_status(struct im_connection *ic, const char *handle, int flags, bee_user_t *bu, *old; if (!(bu = bee_user_by_handle(bee, ic, handle))) { - if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) { + char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : + set_getstr(&ic->bee->set, "handle_unknown"); + + if (g_strncasecmp(h, "add", 3) == 0) { bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL); } else { - if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) { + if (g_strcasecmp(h, "ignore") != 0) { imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n" "flags = %d, state = %s, message = %s", handle, flags, state ? state : "NULL", message ? message : "NULL"); @@ -254,7 +257,8 @@ void imcb_buddy_msg(struct im_connection *ic, const char *handle, const char *ms bu = bee_user_by_handle(bee, ic, handle); if (!bu && !(ic->flags & OPT_LOGGING_OUT)) { - char *h = set_getstr(&bee->set, "handle_unknown"); + char *h = set_getstr(&ic->acc->set, "handle_unknown") ? : + set_getstr(&ic->bee->set, "handle_unknown"); if (g_strcasecmp(h, "ignore") == 0) { return; diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c index 9c79de8e..7380d565 100644 --- a/protocols/jabber/s5bytestream.c +++ b/protocols/jabber/s5bytestream.c @@ -887,7 +887,7 @@ void jabber_si_set_proxies(struct bs_transfer *bt) char *proxysetting = g_strdup(set_getstr(&tf->ic->acc->set, "proxy")); char *proxy, *next, *errmsg = NULL; char port[6]; - char host[HOST_NAME_MAX + 1]; + char host[NI_MAXHOST + 1]; jabber_streamhost_t *sh, *sh2; GSList *streamhosts = jd->streamhosts; |