Changeset 0d581bd for protocols/twitter
- Timestamp:
- 2016-03-31T22:25:49Z (9 years ago)
- Branches:
- master
- Children:
- 166a571
- Parents:
- 9cf63ac
- git-author:
- Flexo <nick@…> (31-03-16 22:04:33)
- git-committer:
- Flexo <nick@…> (31-03-16 22:25:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r9cf63ac r0d581bd 954 954 955 955 /* Check this is not a tweet that should be muted */ 956 uid_str = g_strdup_printf("%" PRIu64, status->user->uid);956 uid_str = g_strdup_printf("%" G_GINT64_FORMAT, status->user->uid); 957 957 if (g_slist_find_custom(td->mutes_ids, uid_str, (GCompareFunc)strcmp)) { 958 958 g_free(uid_str); … … 1122 1122 json_value *target = json_o_get(o, "target"); 1123 1123 const char *type = json_o_str(o, "event"); 1124 struct twitter_xml_user *us = NULL; 1125 struct twitter_xml_user *ut = NULL; 1124 1126 1125 1127 if (!type || !source || source->type != json_object … … 1129 1131 1130 1132 if (strcmp(type, "follow") == 0) { 1131 struct twitter_xml_user *us = twitter_xt_get_user(source);1132 struct twitter_xml_user *ut = twitter_xt_get_user(target);1133 us = twitter_xt_get_user(source); 1134 ut = twitter_xt_get_user(target); 1133 1135 if (g_strcasecmp(us->screen_name, td->user) == 0) { 1134 1136 twitter_add_buddy(ic, ut->screen_name, ut->name); 1135 1137 } 1136 txu_free(us); 1137 txu_free(ut); 1138 } 1138 } else if (strcmp(type, "mute") == 0) { 1139 GSList *ids = td->mutes_ids; 1140 ut = twitter_xt_get_user(target); 1141 ids = g_slist_prepend(ids, 1142 g_strdup_printf("%" G_GINT64_FORMAT, ut->uid)); 1143 1144 td->mutes_ids = ids; 1145 } else if (strcmp(type, "unmute") == 0) { 1146 GSList *found; 1147 char *uid_str; 1148 ut = twitter_xt_get_user(target); 1149 uid_str = g_strdup_printf("%" G_GINT64_FORMAT, ut->uid); 1150 if ((found = g_slist_find_custom(td->mutes_ids, uid_str, 1151 (GCompareFunc)strcmp))) { 1152 td->mutes_ids = g_slist_remove(td->mutes_ids, found); 1153 } 1154 g_free(uid_str); 1155 } 1156 1157 txu_free(us); 1158 txu_free(ut); 1139 1159 1140 1160 return TRUE;
Note: See TracChangeset
for help on using the changeset viewer.