I was thinking about this stuff. Having likes constantly popping up on the mentions tab is, IMO, just a pointless PITA. They're not really "mentions" as such anyway, so it doesn't even fit with the tab title. Mentions should be reserved for when someone deliberately tags you in a post to bring your attention to it.
So that probably won't happen very often, meaning a separate tab for it is probably waste of space. It'd make more sense if mentions were in the droppy off the "My Messages" tab and just popped up a little number there instead. Getting tagged really is a kind of message (as in "Hey, check this out").
As for tracking likes, who gives a rat's? Even Farcebook, the originator of this bit of web lint, has basically now admitted that just having likes by themselves is pretty useless.
Ok, so to bring about this new golden age of less web lint would obviously require some modifications to sources. AFAICT at the moment, deleting the following from Mentions.controller.php should deal with the basics.
// liked messages
'like' => array(
'callback' => array($this, 'prepareMentionMessage'),
'enabled' => !empty($modSettings['likes_enabled']),
),
// likes removed
'rlike' => array(
'callback' => array($this, 'prepareMentionMessage'),
'enabled' => !empty($modSettings['likes_enabled']) && empty($modSettings['mentions_dont_notify_rlike']),
),
Along with:
// These things are associated to messages and require permission checks
if (in_array($row['mention_type'], array('men', 'like', 'rlike')))
// These things are associated to messages and require permission checks
if (in_array($row['mention_type'], array('men')))
And:
/**
* Politley remove a mention when a post like is taken back
*/
public function action_rlike()
{
global $user_info;
// Common checks to determine if we can go on
if (!$this->_isValid())
return;
// Cleanup, validate and remove the invalid values (0 and $user_info['id'])
$id_target = array_diff(array_map('intval', array_unique($this->_validator->uid)), array(0, $user_info['id']));
if (empty($id_target))
return false;
rlikeMentions($user_info['id'], $id_target, $this->_validator->msg);
}
That should detach likes from mentions without borking anything, AFAICT. Is this right? Am I missing anything here?
Anyway, the next bit is getting the counter on the My Messages tab to recognise the mentions. What sort of syntax would work for that? Is 'counter' => 'unread_messages && mentions', going to do the job, or would it need something else?