Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into new/…
…default-favorite-channels * 'develop' of github.com:RocketChat/Rocket.Chat: (28 commits) [IMPROVE] Notify logged agents when their departments change (#16033) [IMPROVE] Replace fullEmojiData publication by REST (#15901) [IMPROVE] Replace adminRooms publication by REST (#15948) [IMPROVE] Replace webdavAccounts publication by REST (#15926) [IMPROVE] Replace oauth publications by REST (#15878) [IMPROVE] Replace userAutocomplete publication by REST (#15956) [IMPROVE] Replace discussionsOfARoom publication by REST (#15908) [FIX] width of upload-progress-text (#16023) corrected Grammatical errors (#15570) Upgrade limax to 2.0.0 (#16020) [IMPROVE] Replace customSounds publication by REST (#15907) [FIX] Message list scrolling to bottom on reactions (#16018) [IMPROVE] Replace stdout publication by REST (#16004) [FIX] SAML logout error (#15978) [FIX] Added Join button to Read Only rooms. (#16016) [IMPROVE] Replace fullUserStatusData publication by REST (#15942) [IMPROVE] Replace userData subscriptions by REST (#15916) [FIX] z-index of new message button (#16013) [FIX] new message popup (#16017) [FIX] Changed renderMessage priority, fixed Katex on/off setting (#16012) ...
- Loading branch information
Showing
191 changed files
with
4,287 additions
and
1,751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
app/theme/client/vendor/fontello/css/fontello.css | ||
packages/meteor-autocomplete/client/autocomplete.css | ||
app/meteor-autocomplete/client/autocomplete.css | ||
app/katex/katex.min.css | ||
app/emoji-emojione/client/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { CustomSounds } from '../../../models/server/raw'; | ||
|
||
export async function findCustomSounds({ query = {}, pagination: { offset, count, sort } }) { | ||
const cursor = await CustomSounds.find(query, { | ||
sort: sort || { name: 1 }, | ||
skip: offset, | ||
limit: count, | ||
}); | ||
|
||
const total = await cursor.count(); | ||
|
||
const sounds = await cursor.toArray(); | ||
|
||
return { | ||
sounds, | ||
count: sounds.length, | ||
offset, | ||
total, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { CustomUserStatus } from '../../../models/server/raw'; | ||
|
||
export async function findCustomUserStatus({ query = {}, pagination: { offset, count, sort } }) { | ||
const cursor = await CustomUserStatus.find(query, { | ||
sort: sort || { name: 1 }, | ||
skip: offset, | ||
limit: count, | ||
}); | ||
|
||
const total = await cursor.count(); | ||
|
||
const statuses = await cursor.toArray(); | ||
|
||
return { | ||
statuses, | ||
count: statuses.length, | ||
offset, | ||
total, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { EmojiCustom } from '../../../models/server/raw'; | ||
|
||
export async function findEmojisCustom({ query = {}, pagination: { offset, count, sort } }) { | ||
const cursor = EmojiCustom.find(query, { | ||
sort: sort || { name: 1 }, | ||
skip: offset, | ||
limit: count, | ||
}); | ||
|
||
const total = await cursor.count(); | ||
|
||
const emojis = await cursor.toArray(); | ||
|
||
return { | ||
emojis, | ||
count: emojis.length, | ||
offset, | ||
total, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { OAuthApps } from '../../../models/server/raw'; | ||
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; | ||
|
||
export async function findOAuthApps({ uid }) { | ||
if (!await hasPermissionAsync(uid, 'manage-oauth-apps')) { | ||
throw new Error('error-not-allowed'); | ||
} | ||
return OAuthApps.find().toArray(); | ||
} | ||
|
||
export async function findOneAuthApp({ clientId, appId }) { | ||
return OAuthApps.findOneAuthAppByIdOrClientId({ clientId, appId }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; | ||
import { Rooms } from '../../../models/server/raw'; | ||
|
||
export async function findAdminRooms({ uid, filter, types = [], pagination: { offset, count, sort } }) { | ||
if (!await hasPermissionAsync(uid, 'view-room-administration')) { | ||
throw new Error('error-not-authorized'); | ||
} | ||
const fields = { | ||
prid: 1, | ||
fname: 1, | ||
name: 1, | ||
t: 1, | ||
cl: 1, | ||
u: 1, | ||
usernames: 1, | ||
usersCount: 1, | ||
muted: 1, | ||
unmuted: 1, | ||
ro: 1, | ||
default: 1, | ||
topic: 1, | ||
msgs: 1, | ||
archived: 1, | ||
tokenpass: 1, | ||
}; | ||
|
||
const name = filter && filter.trim(); | ||
const discussion = types && types.includes('discussions'); | ||
const showTypes = Array.isArray(types) ? types.filter((type) => type !== 'discussions') : []; | ||
const options = { | ||
fields, | ||
sort: sort || { default: -1, name: 1 }, | ||
skip: offset, | ||
limit: count, | ||
}; | ||
|
||
let cursor = Rooms.findByNameContaining(name, discussion, options); | ||
|
||
if (name && showTypes.length) { | ||
cursor = Rooms.findByNameContainingAndTypes(name, showTypes, discussion, options); | ||
} else if (showTypes.length) { | ||
cursor = Rooms.findByTypes(showTypes, discussion, options); | ||
} | ||
|
||
const total = await cursor.count(); | ||
|
||
const rooms = await cursor.toArray(); | ||
|
||
return { | ||
rooms, | ||
count: rooms.length, | ||
offset, | ||
total, | ||
}; | ||
} | ||
|
||
export async function findChannelAndPrivateAutocomplete({ uid, selector }) { | ||
if (!await hasPermissionAsync(uid, 'view-other-user-channels')) { | ||
return { items: [] }; | ||
} | ||
const options = { | ||
fields: { | ||
_id: 1, | ||
name: 1, | ||
}, | ||
limit: 10, | ||
sort: { | ||
name: 1, | ||
}, | ||
}; | ||
|
||
const rooms = await Rooms.findChannelAndPrivateByNameStarting(selector.name, options).toArray(); | ||
|
||
return { | ||
items: rooms, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Users } from '../../../models/server/raw'; | ||
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; | ||
|
||
export async function findUsersToAutocomplete({ uid, selector }) { | ||
if (!await hasPermissionAsync(uid, 'view-outside-room')) { | ||
return { items: [] }; | ||
} | ||
const exceptions = selector.exceptions || []; | ||
const conditions = selector.conditions || {}; | ||
const options = { | ||
fields: { | ||
name: 1, | ||
username: 1, | ||
status: 1, | ||
}, | ||
sort: { | ||
username: 1, | ||
}, | ||
limit: 10, | ||
}; | ||
|
||
const users = await Users.findActiveByUsernameOrNameRegexWithExceptionsAndConditions(selector.term, exceptions, conditions, options).toArray(); | ||
|
||
return { | ||
items: users, | ||
}; | ||
} |
Oops, something went wrong.