Hi there, thanks for making such a wonderful module.
I'm running Activity with Buddylist, and while the activity feed handles friend adding and removing just fine, there's a bug with the actual initial friend request. When I ask a user to be my buddy, Activity creates a new entry. However this entry is blank. In the section where I'm supposed to add tokens for buddylist activities, there's no slot for giving tokens to the actual friend request.
So it seems like we need to add "friend request" to the list of activities covered by the buddylist addon. How do I do this? I've looked at the file a bit and I'm not seeing any obvious way to add another activity, token slot etc. to it.
Help? I'd rather not have a crap load of blank messages for all the friend requests.
Comments
Comment #1
sirkitree commentedwhat version of buddylist are you using?
Comment #2
bflora commented5.x-1.1-beta is the version I'm using.
Comment #3
sirkitree commentedThis was actually fairly easy. Here's how I went about it.
First we have to see what all hooks buddylist makes available, or what all actions it reports. So for this I simple grepped the buddylist.module for module_invoke. Each one of these calls lists a specific action, for instance,
module_invoke_all('buddylist', 'add', $requester_account, $requestee_account, false);tells other modules that buddylist has performed and 'add' action. So searching through the module I foundmodule_invoke_all('buddylist', 'request', $user_to_add, $user, false);which is the announcement from buddylist that a request has been performed. I then just add this into buddylistactivity.module in the list of 'ops' as this diff will show you.Comment #4
jaydub commentedThe newer versions of Activity shouldn't write empty records like these
as there are tests for whether the relevant token type and operation type
are enabled now before writing a record. But while I am looking at this, it
looks like we can add in hooks to the additional buddylist operations including
'request', 'deny' and 'cancel'.
Comment #5
jaydub commentedI committed an update to buddylistactivity so that the additional
operations are exposed to activity.
Comment #6
jaydub commentedSo now the buddylist activity module has hooks for these
buddy operations:
add a buddy
remove a buddy
request to add someone as your buddy
deny a request to be added as someone's buddy
cancel your request to add someone as your buddy
See #314433: Activity 6.1 & 5.4 for more details on our new development
branch and help us by testing out a snapshot.
Comment #7
sirkitree commented