Opened at 2012-02-23T16:35:54Z
Closed at 2012-03-12T22:39:43Z
#923 closed enhancement (fixed)
Patch to add report-spam functionality to twitter
Reported by: | Flexo | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | BitlBee | Version: | 3.0.5 |
Keywords: | Cc: | ||
IRC client+version: | Client-independent | Operating System: | Public server |
OS version/distro: |
Description
The attached patch adds a 'report' command to the twitter commands.
Attachments (2)
Change History (5)
Changed at 2012-02-23T16:36:47Z by
Attachment: | bitlbee-twitter-reportspam.diff added |
---|
comment:1 Changed at 2012-03-10T00:14:21Z by
Changed at 2012-03-11T14:31:26Z by
Attachment: | bitlbee-twitter-reportspam-2.diff added |
---|
New version with fixed tabs, plus added #id option and doco
comment:2 Changed at 2012-03-11T14:38:44Z by
I was following the template that 'follow' and 'unfollow' used since Twitter's API call works on screen names rather than tweet IDs, but I've added that functionality to reverse map a tweet ID to its user to allow users to specify one.
Also fixed the tabbing and the silly "useless cat" :)
Only line I'm not sure about would be this one on line 540: if (td->log[id].bu)
-- a comment in struct twitter_log_data says to check that bu
isn't a dead pointer -- I've assumed that means check for NULL in absence of more information there.
comment:3 Changed at 2012-03-12T22:39:43Z by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I wonder what the g_free() on an uninitialised url pointer will do! :-P
The check for bu is done because a user might have been removed from the contact list, so then the log->bu is a dangling pointer you shouldn't dereference. And since BitlBee is multi-user, one user shooting himself in the foot could hurt other users as well.
Submitted in changeset:devel,899 with fixed bu check and some other tweaks, including an alias "spam" for this command because I know some day I would accidentally use it.
Hrm. For consistency, it'd probably be good if this also accepted show_ids numbers, don't you think?
g_strdup_printf("%s", TWITTER_REPORT_SPAM_URL); might be the C equivalent of "useless use of cat" BTW :-D