Ignore:
Timestamp:
2015-05-03T16:47:19Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
5ca1416
Parents:
cd60710
Message:

Make replies to self work in Twitter.

Difficult because there's no bee_user struct pointing at the user themselves
so instead just fake one for very limited use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    rcd60710 rc43146d  
    867867}
    868868
     869bee_user_t twitter_log_local_user;
     870
    869871/** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID
    870872 *  into a twitter tweet ID.
     
    897899                        bu = td->log[id].bu;
    898900                        id = td->log[id].id;
    899                         /* Beware of dangling pointers! */
    900                         if (!g_slist_find(ic->bee->users, bu)) {
    901                                 bu = NULL;
    902                         }
    903901                } else if (twitter_parse_id(arg, 10, &id)) {
    904902                        /* Allow normal tweet IDs as well; not a very useful
     
    911909        }
    912910        if (bu_) {
     911                if (bu == &twitter_log_local_user) {
     912                        /* HACK alert. There's no bee_user object for the local
     913                         * user so just fake one for the few cmds that need it. */
     914                        twitter_log_local_user.handle = td->user;
     915                } else {
     916                        /* Beware of dangling pointers! */
     917                        if (!g_slist_find(ic->bee->users, bu)) {
     918                                bu = NULL;
     919                        }
     920                }
    913921                *bu_ = bu;
    914922        }
Note: See TracChangeset for help on using the changeset viewer.