Changeset b5fe39b


Ignore:
Timestamp:
2012-02-10T23:49:28Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
00d6760
Parents:
fc0640e
Message:

Applied patch from #895, making show_old_mentions an integer setting instead
of boolean so you can change the number of mentions being fetched.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    rfc0640e rb5fe39b  
    14551455        </bitlbee-setting>
    14561456
     1457        <bitlbee-setting name="show_old_mentions" type="integer" scope="account">
     1458                <default>20</default>
     1459
     1460                <description>
     1461                        <para>
     1462                                This setting specifies the number of old mentions to fetch on connection. Must be less or equal to 200. Setting it to 0 disables this feature.
     1463                        </para>
     1464                </description>
     1465        </bitlbee-setting>
     1466
    14571467        <bitlbee-setting name="switchboard_keepalives" type="boolean" scope="account">
    14581468                <default>false</default>
  • protocols/twitter/twitter.c

    rfc0640e rb5fe39b  
    279279        s->flags |= ACC_SET_OFFLINE_ONLY;
    280280
    281         s = set_add(&acc->set, "show_old_mentions", "true", set_eval_bool, acc);
     281        s = set_add(&acc->set, "show_old_mentions", "20", set_eval_int, acc);
    282282
    283283        s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc);
  • protocols/twitter/twitter_lib.c

    rfc0640e rb5fe39b  
    752752        struct twitter_data *td = ic->proto_data;
    753753        gboolean include_mentions = set_getbool(&ic->acc->set, "fetch_mentions");
    754         gboolean show_old_mentions = set_getbool(&ic->acc->set, "show_old_mentions");
     754        int show_old_mentions = set_getint(&ic->acc->set, "show_old_mentions");
    755755        struct twitter_xml_list *home_timeline = td->home_timeline_obj;
    756756        struct twitter_xml_list *mentions = td->mentions_obj;
     
    774774        if (include_mentions && mentions && mentions->list) {
    775775                for (l = mentions->list; l; l = g_slist_next(l)) {
    776                         if (!show_old_mentions && output && twitter_compare_elements(l->data, output->data) < 0) {
     776                        if (show_old_mentions < 1 && output && twitter_compare_elements(l->data, output->data) < 0) {
    777777                                continue;
    778778                        }
     
    852852                args[4] = "since_id";
    853853                args[5] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id);
    854         }
    855 
    856         if (twitter_http(ic, TWITTER_MENTIONS_URL, twitter_http_get_mentions, ic, 0, args,
    857                      td->timeline_id ? 6 : 4) == NULL) {
     854        } else {
     855                args[4] = "count";
     856                args[5] = g_strdup_printf("%d", set_getint(&ic->acc->set, "show_old_mentions"));
     857        }
     858
     859        if (twitter_http(ic, TWITTER_MENTIONS_URL, twitter_http_get_mentions,
     860                         ic, 0, args, 6) == NULL) {
    858861                if (++td->http_fails >= 5)
    859862                        imcb_error(ic, "Could not retrieve %s: %s",
Note: See TracChangeset for help on using the changeset viewer.