Changeset 9f8bb17 for protocols


Ignore:
Timestamp:
2014-11-24T05:16:11Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
6f6725c
Parents:
b38d399
Message:

twitter: Use g_strcasecmp for screen_name

Fixes a few minor bugs with users who have uppercase characters in nicks
(see trac ticket 1138). Most notably, the "follow" command showing no
feedback that a user was followed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    rb38d399 r9f8bb17  
    638638           remember OUR id instead so undo will work. In other cases, the
    639639           original tweet's id should be remembered for deduplicating. */
    640         if (strcmp(txs->user->screen_name, td->user) == 0)
     640        if (g_strcasecmp(txs->user->screen_name, td->user) == 0)
    641641                td->log[td->log_id].id = txs->rt_id;
    642642       
     
    802802        } else if ((c = json_o_get(o, "direct_message")) &&
    803803                   (txs = twitter_xt_get_dm(c))) {
    804                 if (strcmp(txs->user->screen_name, td->user) != 0)
     804                if (g_strcasecmp(txs->user->screen_name, td->user) != 0)
    805805                        imcb_buddy_msg(ic, txs->user->screen_name,
    806806                                       txs->text, 0, txs->created_at);
     
    836836        }
    837837       
    838         if (!(strcmp(txs->user->screen_name, td->user) == 0 ||
     838        if (!(g_strcasecmp(txs->user->screen_name, td->user) == 0 ||
    839839              set_getbool(&ic->acc->set, "fetch_mentions") ||
    840840              bee_user_by_handle(ic->bee, ic, txs->user->screen_name))) {
     
    868868                struct twitter_xml_user *us = twitter_xt_get_user(source);
    869869                struct twitter_xml_user *ut = twitter_xt_get_user(target);
    870                 if (strcmp(us->screen_name, td->user) == 0) {
     870                if (g_strcasecmp(us->screen_name, td->user) == 0) {
    871871                        twitter_add_buddy(ic, ut->screen_name, ut->name);
    872872                }
Note: See TracChangeset for help on using the changeset viewer.