Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-63850

Extend member info with additional fields

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Blocker
    • 3.6
    • 3.6
    • Messages

    Description

      We need 2 additional fields for the new UI:
      $member->canmessage
      $member->requirescontact

      I'd suggest we add these to the output of the \core_message\helper::get_member_info() function, if they're cheap enough, and adjust theĀ get_conversation_member_structure() method in externallib.php to reflect this.

      Here's some code that Ryan was using to mock this data in the UI at present (for reference of the logic only, we don't want to add more DB hits or method calls if we can avoid it.)

      $privacysetting = self::get_user_privacy_messaging_preference($otheruserid);
              $blocknoncontacts = $privacysetting = self::MESSAGE_PRIVACY_ONLYCONTACTS;
              $data->isblocked = self::is_blocked($userid, $otheruserid);
              $data->iscontact = self::is_contact($userid, $otheruserid);
              $data->canmessage = ($data->iscontact || !$blocknoncontacts) && !self::is_blocked($otheruserid, $userid);
              $data->contactrequests = $contactrequests;
              $data->requirescontact = $blocknoncontacts;

      Attachments

        Issue Links

          Activity

            People

              markn Mark Nelson
              jaked Jake Dallimore
              Jake Dallimore Jake Dallimore
              Andrew Lyons Andrew Lyons
              CiBoT CiBoT
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.