mattermost-redux 10.10.0 → 10.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -997,7 +997,7 @@ function getNeededAtMentionedUsernamesAndGroups(state, posts) {
997
997
  if (!groupsByName) {
998
998
  groupsByName = (0, groups_2.getAllGroupsByName)(state);
999
999
  }
1000
- const pattern = /\B@(([a-z0-9_.-]*[a-z0-9_])[.-]*)/gi;
1000
+ const pattern = /\B@(([a-z0-9.\-_:]*[a-z0-9_])[.\-:]*)/gi;
1001
1001
  let match;
1002
1002
  while ((match = pattern.exec(text)) !== null) {
1003
1003
  // match[1] is the matched mention including trailing punctuation
@@ -41,6 +41,9 @@ export declare function createTermsOfService(text: string): ActionFuncAsync<impo
41
41
  export declare function getUser(id: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
42
42
  export declare function getUserByUsername(username: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
43
43
  export declare function getUserByEmail(email: string): ActionFuncAsync<UserProfile, import("@mattermost/types/store").GlobalState, AnyAction>;
44
+ export declare function canUserDirectMessage(userId: string, otherUserId: string): ActionFuncAsync<{
45
+ can_dm: boolean;
46
+ }>;
44
47
  export declare function getStatusesByIds(userIds: Array<UserProfile['id']>): ActionFuncAsync<UserStatus[]>;
45
48
  export declare function setStatus(status: UserStatus): ActionFuncAsync<UserStatus>;
46
49
  export declare function setCustomStatus(customStatus: UserCustomStatus): ActionFuncAsync<unknown, import("@mattermost/types/store").GlobalState, AnyAction>;
@@ -33,6 +33,7 @@ exports.createTermsOfService = createTermsOfService;
33
33
  exports.getUser = getUser;
34
34
  exports.getUserByUsername = getUserByUsername;
35
35
  exports.getUserByEmail = getUserByEmail;
36
+ exports.canUserDirectMessage = canUserDirectMessage;
36
37
  exports.getStatusesByIds = getStatusesByIds;
37
38
  exports.setStatus = setStatus;
38
39
  exports.setCustomStatus = setCustomStatus;
@@ -622,6 +623,19 @@ function getUserByEmail(email) {
622
623
  ],
623
624
  });
624
625
  }
626
+ function canUserDirectMessage(userId, otherUserId) {
627
+ return async (dispatch, getState) => {
628
+ try {
629
+ const result = await client_1.Client4.canUserDirectMessage(userId, otherUserId);
630
+ return { data: result };
631
+ }
632
+ catch (error) {
633
+ (0, helpers_1.forceLogoutIfNecessary)(error, dispatch, getState);
634
+ dispatch((0, errors_1.logError)(error));
635
+ return { error };
636
+ }
637
+ };
638
+ }
625
639
  function getStatusesByIds(userIds) {
626
640
  return async (dispatch, getState) => {
627
641
  if (!userIds || userIds.length === 0) {
@@ -1,5 +1,7 @@
1
1
  import type { Channel, ChannelWithTeamData, ChannelSearchOpts } from '@mattermost/types/channels';
2
+ import type { AccessControlSettings } from '@mattermost/types/config';
2
3
  import type { GlobalState } from '@mattermost/types/store';
4
+ export declare function getAccessControlSettings(state: GlobalState): AccessControlSettings;
3
5
  export declare function getAccessControlPolicy(state: GlobalState, id: string): import("@mattermost/types/access_control").AccessControlPolicy;
4
6
  export declare const getChannelIdsForAccessControlPolicy: (state: GlobalState, parentId: string) => string[];
5
7
  export declare function makeGetChannelsInAccessControlPolicy(): (b: GlobalState, a: {
@@ -3,12 +3,16 @@
3
3
  // See LICENSE.txt for license information.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getChannelIdsForAccessControlPolicy = void 0;
6
+ exports.getAccessControlSettings = getAccessControlSettings;
6
7
  exports.getAccessControlPolicy = getAccessControlPolicy;
7
8
  exports.makeGetChannelsInAccessControlPolicy = makeGetChannelsInAccessControlPolicy;
8
9
  exports.searchChannelsInheritsPolicy = searchChannelsInheritsPolicy;
9
10
  const channel_utils_1 = require("mattermost-redux/utils/channel_utils");
10
11
  const channels_1 = require("./channels");
11
12
  const create_selector_1 = require("../create_selector");
13
+ function getAccessControlSettings(state) {
14
+ return state.entities.admin.config.AccessControlSettings;
15
+ }
12
16
  function getAccessControlPolicy(state, id) {
13
17
  return state.entities.admin.accessControlPolicies[id];
14
18
  }
@@ -30,6 +30,7 @@ export declare function getUserStatuses(state: GlobalState): RelationOneToOne<Us
30
30
  export declare function getUserSessions(state: GlobalState): any[];
31
31
  export declare function getUserAudits(state: GlobalState): any[];
32
32
  export declare function getUser(state: GlobalState, id: UserProfile['id']): UserProfile;
33
+ export declare function getUsersByIDs(state: GlobalState, ids: Array<UserProfile['id']>): UserProfile[];
33
34
  export declare const getUsersByUsername: (a: GlobalState) => Record<string, UserProfile>;
34
35
  export declare function getUserByUsername(state: GlobalState, username: UserProfile['username']): UserProfile;
35
36
  export declare const getUsersByEmail: (a: GlobalState) => Record<string, UserProfile>;
@@ -14,6 +14,7 @@ exports.getUserStatuses = getUserStatuses;
14
14
  exports.getUserSessions = getUserSessions;
15
15
  exports.getUserAudits = getUserAudits;
16
16
  exports.getUser = getUser;
17
+ exports.getUsersByIDs = getUsersByIDs;
17
18
  exports.getUserByUsername = getUserByUsername;
18
19
  exports.getUserByEmail = getUserByEmail;
19
20
  exports.filterProfiles = filterProfiles;
@@ -87,6 +88,9 @@ function getUserAudits(state) {
87
88
  function getUser(state, id) {
88
89
  return state.entities.users.profiles[id];
89
90
  }
91
+ function getUsersByIDs(state, ids) {
92
+ return ids.map((userId) => getUser(state, userId));
93
+ }
90
94
  exports.getUsersByUsername = (0, create_selector_1.createSelector)('getUsersByUsername', exports.getUsers, (users) => {
91
95
  const usersByUsername = {};
92
96
  for (const id in users) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mattermost-redux",
3
- "version": "10.10.0",
3
+ "version": "10.11.0",
4
4
  "description": "Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client",
5
5
  "keywords": [
6
6
  "mattermost"
@@ -39,8 +39,8 @@
39
39
  "directory": "webapp/platform/mattermost-redux"
40
40
  },
41
41
  "dependencies": {
42
- "@mattermost/client": "10.10.0",
43
- "@mattermost/types": "10.10.0",
42
+ "@mattermost/client": "10.11.0",
43
+ "@mattermost/types": "10.11.0",
44
44
  "@redux-devtools/extension": "^3.2.3",
45
45
  "lodash": "^4.17.21",
46
46
  "moment-timezone": "^0.5.38",