Putting solution here to help anybody that runs into same issue:
Problem: I have some code I would like to run after every "un-friend" action on my site ( This is in relation to @Modzzz Circle mod, I would like to remove the user from circle if they un-friend each other) . As mentioned above, it is not recommended to alter core code but make the changes in the module itself. So I need to use Dolphins event subscription service which uses "alerts" to pass event notifications which I can handle in my module.
Solution:
1. Create the alert handler method.
Inserted the following into the sys_alerts_handlers table in database:
INSERT INTO `sys_alerts_handlers` VALUES (NULL, 'modzzz_circle_friend_delete', '', '', 'BxDolService::call(''circle'', ''response_friend_delete'', array($this));');
Create the corresponding method in BxCircleModule.php:
function serviceResponseFriendDelete ($oAlert)
{
....
}
2. Create an alert that will receive event notification and call up alert handler method
Inserted the following into the sys_alerts table in database:
INSERT INTO `sys_alerts` VALUES (NULL , 'friend', 'delete', {Must be id of the corresponding row in sys_alerts_handlers table});
Note: I got the name for the un-friend action event from BxDolCommunicator.php : line 261.
case 'sys_friend_list':
$oZ = new BxDolAlerts('friend', 'delete', $iID, $iProfile);
$oZ -> alert();
break;
If anyone has anything to add, please feel free. Especially about how the BxDolAlerts work exactly, thanks.