|
static | create_contact ($contact, $prefix='') |
| Helper function for creating a contact object. More...
|
|
static | create_messages ($userid, $messages) |
| Helper function to return an array of messages. More...
|
|
static | format_conversation_messages (int $userid, int $convid, array $messages) |
| Helper function to return a conversation messages with the involved members (only the ones who have sent any of these messages). More...
|
|
static | get_conversation_hash (array $userids) |
| Returns the conversation hash between users for easy look-ups in the DB. More...
|
|
static | get_conversation_messages (int $userid, int $convid, int $timedeleted=0, int $limitfrom=0, int $limitnum=0, string $sort='timecreated ASC', int $timefrom=0, int $timeto=0) |
| Helper function to retrieve conversation messages. More...
|
|
static | get_conversations_legacy_formatter (array $conversations) |
| Backwards compatibility formatter, transforming the new output of get_conversations() into the old format. More...
|
|
static | get_last_message_time_created_cache_key (int $convid) |
| Returns the cache key for the time created value of the last message of this conversation. More...
|
|
static | get_member_info (int $referenceuserid, array $userids, bool $includecontactrequests=false, bool $includeprivacyinfo=false) |
| Returns conversation member info for the supplied users, relative to the supplied referenceuserid. More...
|
|
static | get_messages ($userid, $otheruserid, $timedeleted=0, $limitfrom=0, $limitnum=0, $sort='timecreated ASC', $timefrom=0, $timeto=0) |
| Helper function to retrieve the messages between two users. More...
|
|
static | get_providers_preferences ($providers, $userid) |
| Get providers preferences. More...
|
|
static | is_online ($lastaccess) |
| Helper function for checking the time meets the 'online' condition. More...
|
|
static | legacy_messages_exist ($userid) |
| Checks if legacy messages exist for a given user. More...
|
|
static | messageuser_link_params (int $useridto) |
| Returns the attributes to place on the message user button. More...
|
|
static | messageuser_requirejs () |
| Requires the JS libraries for the message user button. More...
|
|
static | render_messaging_widget (bool $isdrawer, int $sendtouser=null, int $conversationid=null, string $view=null) |
| Renders the messaging widget. More...
|
|
static | search_get_user_details (\stdClass $user) |
| Returns user details for a user, if they are visible to the current user in the message search. More...
|
|
static | show_online_status ($user) |
| Helper function for checking if we should show the user's online status. More...
|
|
static | togglecontact_link_params ($user, $iscontact=false) |
| Returns the attributes to place on a contact button. More...
|
|
static | togglecontact_requirejs () |
| Requires the JS libraries for the toggle contact button. More...
|
|
Helper class for the message area.
- Copyright
- 2016 Mark Nelson markn.nosp@m.@moo.nosp@m.dle.c.nosp@m.om
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
static core_message\helper::get_member_info |
( |
int |
$referenceuserid, |
|
|
array |
$userids, |
|
|
bool |
$includecontactrequests = false , |
|
|
bool |
$includeprivacyinfo = false |
|
) |
| |
|
static |
Returns conversation member info for the supplied users, relative to the supplied referenceuserid.
This is the basic structure used when returning members, and includes information about the relationship between each member and the referenceuser, such as a whether the referenceuser has marked the member as a contact, or has blocked them.
- Parameters
-
int | $referenceuserid | the id of the user which check contact and blocked status. |
array | $userids | |
bool | $includecontactrequests | Do we want to include contact requests with this data? |
bool | $includeprivacyinfo | Do we want to include whether the user can message another, and if the user requires a contact. |
- Return values
-
array | the array of objects containing member info, indexed by userid. |
- Exceptions
-
static core_message\helper::search_get_user_details |
( |
\stdClass |
$user | ) |
|
|
static |
Returns user details for a user, if they are visible to the current user in the message search.
This method checks the visibility of a user specifically for the purpose of inclusion in the message search results. Visibility depends on the site-wide messaging setting 'messagingallusers': If enabled, visibility depends only on the core notion of visibility; a visible site or course profile. If disabled, visibility requires that the user be sharing a course with the searching user, and have a visible profile there. The current user is always returned.
- Parameters
-
- Return values
-
array | the array of userdetails, if visible, or an empty array otherwise. |