Ignore:
Timestamp:
2016-12-27T17:24:50Z (3 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
2e8523b
Parents:
9cdcef0
Message:

Per-account handle_unknown

Credit for the idea goes to russian XMPP spammers. Thanks!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee_user.c

    r9cdcef0 r7801298  
    170170
    171171        if (!(bu = bee_user_by_handle(bee, ic, handle))) {
    172                 if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "add") == 0) {
     172                char *h = set_getstr(&ic->acc->set, "handle_unknown") ? :
     173                          set_getstr(&ic->bee->set, "handle_unknown");
     174
     175                if (g_strncasecmp(h, "add", 3) == 0) {
    173176                        bu = bee_user_new(bee, ic, handle, BEE_USER_LOCAL);
    174177                } else {
    175                         if (g_strcasecmp(set_getstr(&ic->bee->set, "handle_unknown"), "ignore") != 0) {
     178                        if (g_strcasecmp(h, "ignore") != 0) {
    176179                                imcb_log(ic, "imcb_buddy_status() for unknown handle %s:\n"
    177180                                         "flags = %d, state = %s, message = %s", handle, flags,
     
    255258
    256259        if (!bu && !(ic->flags & OPT_LOGGING_OUT)) {
    257                 char *h = set_getstr(&bee->set, "handle_unknown");
     260                char *h = set_getstr(&ic->acc->set, "handle_unknown") ? :
     261                          set_getstr(&ic->bee->set, "handle_unknown");
    258262
    259263                if (g_strcasecmp(h, "ignore") == 0) {
Note: See TracChangeset for help on using the changeset viewer.