HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Reactions on all Activities

R_JR_J Ex-FanboyMunich Admin

Why not react on all of the activity items? I simply commented out the check if($Activity->AllowComments == 0) in class.hooks.php and that helped showing the reactions in nearly all activity items!

The only place where it wasn't shown, although I expected it, was everywhere when the Session->User was involved:

  1. Chico, Harpo and You joined
  2. Chico -> Groucho 'Hey there' (when me being Groucho)

My thoughts on 1.

Showing is only one part and storing is one other. In every reaction where multiple users are involved ('Groucho, Chico, Harpo joined'), clicking on a reaction failed.

I've tried to change that with modifying/adding a little bit in the ReactionsModel:

  public function Set($ID, $Type, $AuthorIDs, $UserID, $ActionID) {
    if (is_array($AuthorIDs)) {
        foreach ($AuthorIDs as $AuthorID) {
            $this->Set($ID, $Type, $AuthorID, $UserID, $ActionID);
        }
    } else {
        $AuthorID = $AuthorIDs;
    }

    ...

But you can only react once for each content ID and therefore the reaction "ended" by the last user in the array. Because of that I think it is not possible to use a "Awesome that you all are here!" reaction :(

My thoughts on 2.

When a user (id 1) writes something on the wall of another user (id 2), the ActivityUserID is 2 (the "owner" of the wall) and the RegardingUserID as well as the InsertUserID is 1 (the author of that entry)
So the check in the hooks file should better be

    else if(
      (strtolower($Activity->ActivityType) != 'wallpost' &&
      $CurrentUserID == $Activity->ActivityUserID) ||
      (strtolower($Activity->ActivityType) == 'wallpost' &&
      $CurrentUserID == $Activity->RegardingUserID) ||
    ) {
      // User is the author of this activity

    ...

That alone won't do the trick. On clicking the reactions (that will show after this tweak), I'm informed that I cannot react on my own content. Well, this check has to be in the index function of the ReactionController, also!

      case 'activity':
        if (strtolower($Item['ActivityType']) == 'wallpost') {
          $ItemOwnerID = $Item['RegardingUserID'];
          $UserID = $Item['ActivityUserID'];
        } else {
          $ItemOwnerID = $Item['ActivityUserID'];
        }
        break;

What else?

The changes above should mostly do the trick, although they show reactions for group activities which cannot be saved. I don't know any solution for that. Maybe this is really something that couldn't be reacted on :(

If someone reacts on "admin changed his picture", that reaction will not show up in /profile/reactions

ActivityComments should be a reactable content! As far as I have seen you can react on entries in discussion, comment and activity. But I think adding a complete new content will be quite a lot of work.

Comments

  • hgtonighthgtonight ∞ · New Moderator

    Thank you for the feedback!

    I chose to only allow reactions on commentable activity types for a few reasons:

    • It provides an easy way to discern what activity are purely informational and what are actionable items
    • Gets rid of the issues you described above
    • I don't like enumerating configured names since that could easily break in the future (or by simply changing the data in the db)

    If you really want to see it happen, pull requests are always considered. :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Taking it a step further, since Yaga "provides a gamification platform for Vanilla Forums and other Garden applications" it would be really cool if a plugin could define more reaction types.

    e.g. Article, or ArticleComment

    But the reaction model would have to be a lot more generic for that. Currentliy "activity, comment, discussion" are hardcoded everywhere.

    I hope we are not giving you too much of a headache hgtonight...

  • hgtonighthgtonight ∞ · New Moderator

    @Bleistivt said:
    Taking it a step further, since Yaga "provides a gamification platform for Vanilla Forums and other Garden applications" it would be really cool if a plugin could define more reaction types.

    e.g. Article, or ArticleComment

    I think this is a great idea that shouldn't require too much work to be done. There is already an issue filed on the article repo about integrating with Yaga, so now would be a good time to change that.

    I hope we are not giving you too much of a headache hgtonight...

    Collaboration is why I really dig OS. I can't possibly write perfect code, so bug fixes and feedback is always welcome. What I am saying is "keep it coming!"

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.