Commit Graph

142 Commits

Author SHA1 Message Date
cb38961988 MDL-64167 core_message: get_conversations() handles self conversations
Those individual conversations created with one's self (via admin user
bulk actions) are now supported in get_conversations(). These had two
records with the same userid in the message_conversation_members table.
The following adjustments have been made to accomodate these:
- Member count adjusted to read 1, not 2 for 'self' conversations.
- Member information for the current user now returned for 'self'
conversations.
- The method now tracks 'self' conversations via $selfconversations.
2018-11-26 08:52:54 +08:00
beb7083381 Merge branch 'MDL-64057-master' of https://github.com/snake/moodle 2018-11-23 14:47:00 +08:00
c296c48f66 MDL-64057 core_message: fix bug with favourite count aggregation 2018-11-23 14:42:33 +08:00
35889e23b7 Merge branch 'MDL-64180_master' of git://github.com/markn86/moodle 2018-11-23 12:21:13 +08:00
720cc99331 MDL-64180 core_message: change stdClass to int for count requests param
This will be used by a new web service and we do not want to fetch
the user unnecessarily in the call.

Also renamed the method for consistency.
2018-11-23 11:34:40 +08:00
252f0e16ea Merge branch 'MDL-64057-master' of https://github.com/snake/moodle 2018-11-23 11:24:58 +08:00
0847aa120c MDL-64057 core_message: return conversations with soft-deleted users
Individual conversations with a soft-deleted user (including messages)
are now displayed in the conversation listing. This brings the behaviour
of individual conversations in line with group conversations, in that
the active user can still view messages.
2018-11-23 11:02:20 +08:00
8e91aaabc9 MDL-64057 core_message: consolidate conversation counts into single call
Counts for types (individual, group) and favourites can be fetched with
a single API call.
2018-11-23 11:02:19 +08:00
715c45aac9 MDL-64018 core_message: added api::get_user_contacts
This is to replace api::get_contacts when that gets deprecated.
2018-11-21 11:09:11 +08:00
43f6899289 MDL-63692 message: Correct favourite fetch 2018-11-20 14:40:39 +08:00
2f7076ebf2 MDL-63692 message: Resolve bad merge conflict 2018-11-20 09:04:53 +08:00
08cd15658a Merge branch 'MDL-63692-master' of git://github.com/sarjona/moodle 2018-11-20 07:51:40 +08:00
6b036d04cf MDL-63692 core_message: Fix the context for favourite conversations
The converation favourites were previously set in the system context
which is not right, as they should be stored:
- In the conversation context when defined.
- In the user context, when contextid is null (that means is an
individual conversation).
2018-11-19 22:08:28 +01:00
90a4438139 Merge branch 'MDL-64035-master' of https://github.com/snake/moodle 2018-11-19 15:08:22 +08:00
237786f159 Merge branch 'MDL-63913-master' of https://github.com/snake/moodle 2018-11-19 14:59:39 +08:00
a54115355a MDL-63913 core_message: fix to ensure favourites is exclusive
If a conversation is included in the favourites unread count, it
cannot be included in any other type-based counts.
2018-11-19 13:51:40 +08:00
8699a985bc Merge branch 'MDL-64034-master' of https://github.com/snake/moodle 2018-11-19 12:59:22 +08:00
d2708759d8 MDL-64034 core_message: return conversationid in search_messages() 2018-11-19 10:23:15 +08:00
33022ee1d5 MDL-63913 core_message: add method to get unread conversation counts 2018-11-19 09:48:58 +08:00
d3d95d5dc2 MDL-63303 message: fix bugs in message drawer part 4
* Add clarification to delete messages lang strings
* Stop message polling when sending a message to fix UI bug
* Publish update last message event when polling finds more messages
* Remove logged in user from group conversation participants list
* Use user object to fetch user preferences to reduce DB calls
* Remove animated slide transitions because the browser breaks when
  showing some conversations
2018-11-16 14:10:10 +08:00
18550c0afb MDL-64035 core_message: get_conversations() excludes disabled chats
Linked conversations which have been disabled must be excluded from
the results.
2018-11-16 12:04:24 +08:00
663ccd58ed MDL-63303 message: fix bugs in message drawer part 3
* Fix bug for newly created conversations being added to overview page
* Fixed bug with use enter to send preference not updating correctly
* Fix unit tests
* Fix race condition loading new messages while conversation resetting
* Fix ordering and rendering of messages with same timestamp
* Fix missing privacy info in get_conversation web service
* Fix linting errors
* Improve bulk message rendering
2018-11-15 14:43:21 +08:00
ecb4755c91 MDL-63303 message: add count_contacts api function 2018-11-15 14:40:12 +08:00
4e3130269c MDL-63303 message: add get_conversation to message api 2018-11-15 14:40:12 +08:00
6399c7ef14 MDL-63303 message: add count_conversations to api 2018-11-15 14:40:12 +08:00
0866b33635 MDL-63303 message: add fields to contact requests 2018-11-15 14:40:12 +08:00
32b4212e50 MDL-63303 message: fix get_conversation_messages 2018-11-15 14:40:12 +08:00
9e189a914d MDL-63303 core_favourites: add get and count functions 2018-11-15 14:40:11 +08:00
41485be2c8 MDL-63974 core_message: fix logic for non-contacts in user search
This should depend on the messagingallusers setting and, if false,
should only return those users having a profile the searcher can see.
If true, then any user can be returned. There is no requirement to
have a conversation with the user.
2018-11-15 09:59:39 +08:00
9acb8b3574 MDL-63974 core_message: restore legacy behaviour for search_users() 2018-11-15 09:58:02 +08:00
657c74416d Merge branch 'MDL-63834_master' of git://github.com/markn86/moodle 2018-11-13 09:35:23 +08:00
869eac8204 MDL-63834 core_message: validate conversation type before creating 2018-11-13 08:41:26 +08:00
623995e589 Merge branch 'MDL-63968-master' of git://github.com/andrewnicols/moodle 2018-11-12 10:02:17 +01:00
b0f45a8b8f Merge branch 'MDL-63724-master-3' of https://github.com/snake/moodle 2018-11-12 14:16:31 +08:00
75e6661940 Merge branch 'MDL-63909_master' of git://github.com/markn86/moodle 2018-11-12 14:01:01 +08:00
e926b4d046 MDL-63968 message: Correct use of get_in_or_equal 2018-11-12 10:32:06 +08:00
52f9cf205e MDL-63724 core_message: add send_message_to_conversation() to api 2018-11-12 10:09:27 +08:00
9f82758c01 MDL-63724 core_message: fix method signature for can_contact_user()
This method required objects, but only used their ids, so has been
changed to require only ids.
2018-11-12 10:09:27 +08:00
8e3bf150d9 MDL-63724 core_message: add can_send_message_to_conversation() to api 2018-11-12 10:09:27 +08:00
080cc5b671 Merge branch 'MDL-63864_master' of git://github.com/markn86/moodle 2018-11-12 10:02:25 +08:00
e2a8ebddb5 Merge branch 'MDL-63850_master' of git://github.com/markn86/moodle 2018-11-12 07:53:09 +08:00
9cef5491fb MDL-63884 core_message: fix for groups without images
If we don't have an image for the group, leave this extra field empty.
2018-11-09 17:59:53 +08:00
accd64827d MDL-63864 core_message: can now specify limit for contact requests 2018-11-09 13:28:38 +08:00
daa33803cd MDL-63864 core_message: get_contact_requests now uses helper 2018-11-09 12:12:17 +08:00
4461288dfa MDL-63909 core_message: undeprecated still used functions by old UI
A note has been made to remove these and other functions once we
remove the old UI.
2018-11-08 18:43:17 +08:00
cef1d977c3 MDL-63850 core_message: get_conversations returns privacy and requests 2018-11-08 16:24:29 +08:00
054834b00c MDL-63850 core_message: moved contact request logic to helper 2018-11-08 16:05:25 +08:00
548cac7dbf MDL-63282 core_message: New Search API function 2018-11-08 13:11:28 +08:00
d4035711f9 Merge branch 'MDL-63898-master' of https://github.com/snake/moodle 2018-11-07 15:30:52 +08:00
74fc14e5b2 MDL-63898 core_message: fix for get_conversations message formatting
This used to return a text version of the message, but needs to return
the message formatted with message_format_message_text().
2018-11-07 14:23:54 +08:00