Modify

#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)

bitlbee-twitter-reportspam.diff (2.1 KB) - added by Flexo at 2012-02-23T16:36:47Z.
bitlbee-twitter-reportspam-2.diff (3.7 KB) - added by Flexo at 2012-03-11T14:31:26Z.
New version with fixed tabs, plus added #id option and doco

Download all attachments as: .zip

Change History (5)

Changed at 2012-02-23T16:36:47Z by Flexo

comment:1 Changed at 2012-03-10T00:14:21Z by wilmer

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

Changed at 2012-03-11T14:31:26Z by Flexo

New version with fixed tabs, plus added #id option and doco

comment:2 Changed at 2012-03-11T14:38:44Z by Flexo

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 wilmer

Resolution: fixed
Status: newclosed

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.

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.