Changeset d18dee42
- Timestamp:
- 2012-03-12T22:36:35Z (13 years ago)
- Branches:
- master
- Children:
- fda194f
- Parents:
- 57a65600
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user-guide/commands.xml
r57a65600 rd18dee42 845 845 <varlistentry><term>rt <screenname|#id></term><listitem><para>Retweet someone's last Tweet (or one with the given ID)</para></listitem></varlistentry> 846 846 <varlistentry><term>reply <screenname|#id></term><listitem><para>Reply to a Tweet (with a reply-to reference)</para></listitem></varlistentry> 847 <varlistentry><term>report <screenname|#id></term><listitem><para>Report the given user (or the user who posted the tweet with the given ID) for sending spam. This will also block them.</para></listitem></varlistentry> 847 848 <varlistentry><term>follow <screenname></term><listitem><para>Start following a person</para></listitem></varlistentry> 848 849 <varlistentry><term>unfollow <screenname></term><listitem><para>Stop following a person</para></listitem></varlistentry> -
protocols/twitter/twitter.c
r57a65600 rd18dee42 530 530 g_free(cmds); 531 531 return; 532 } else if ((g_strcasecmp(cmd[0], "report") == 0 || 533 g_strcasecmp(cmd[0], "spam") == 0) && cmd[1]) { 534 char * screen_name; 535 guint64 id; 536 /* Report nominally works on users but look up the user who 537 posted the given ID if the user wants to do it that way */ 538 if (g_str_has_prefix(cmd[1], "#") && 539 sscanf(cmd[1] + 1, "%" G_GUINT64_FORMAT, &id) == 1) { 540 if (id < TWITTER_LOG_LENGTH && td->log) { 541 if (g_slist_find(ic->bee->users, td->log[id].bu)) { 542 screen_name = td->log[id].bu->handle; 543 } 544 } 545 } else { 546 screen_name = cmd[1]; 547 } 548 twitter_report_spam(ic, screen_name); 549 g_free(cmds); 550 return; 532 551 } else if (g_strcasecmp(cmd[0], "rt") == 0 && cmd[1]) { 533 552 struct twitter_user_data *tud; -
protocols/twitter/twitter_lib.c
r57a65600 rd18dee42 1062 1062 g_free(url); 1063 1063 } 1064 1065 /** 1066 * Report a user for sending spam. 1067 */ 1068 void twitter_report_spam(struct im_connection *ic, char *screen_name) 1069 { 1070 char *args[2] = { 1071 "screen_name", 1072 NULL, 1073 }; 1074 args[1] = screen_name; 1075 twitter_http(ic, TWITTER_REPORT_SPAM_URL, twitter_http_post, 1076 ic, 1, args, 2); 1077 } -
protocols/twitter/twitter_lib.h
r57a65600 rd18dee42 76 76 #define TWITTER_BLOCKS_DESTROY_URL "/blocks/destroy/" 77 77 78 /* Report spam */ 79 #define TWITTER_REPORT_SPAM_URL "/report_spam.xml" 80 78 81 void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor); 79 82 void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor); … … 87 90 void twitter_status_destroy(struct im_connection *ic, guint64 id); 88 91 void twitter_status_retweet(struct im_connection *ic, guint64 id); 92 void twitter_report_spam(struct im_connection *ic, char *screen_name); 89 93 90 94 #endif //_TWITTER_LIB_H
Note: See TracChangeset
for help on using the changeset viewer.