-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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/…
…use_scrollableArea * 'develop' of github.com:RocketChat/Rocket.Chat: (30 commits) [FIX] ie11 support (#16682) Regression: Show upload errors (#16681) [FIX] Delete messages while searching bug (#16568) Use insertSync [FIX] Image uploads (thumbnails) out of threads are not visible in regular message view (#16416) [FIX] Added an option to pin/unpin a thread message by admin (#16457) [CHORE] Look for Storybook stories on `app/` too (#16595) [IMPROVE] Removed the 'reply in thread' from thread replies (#16630) [FIX] Changed Opt_In message (#16631) [FIX] LDAP sync admin action was not syncing exisent users (#16671) [IMPROVE] Check agent status when starting a new conversation with an agent assigned (#16618) [FIX] Additional scroll when contextual bar is open (#16667) [FIX] Clear unread red line when the ESC key is pressed (#16668) [FIX] users.info endpoint not handling the error if the user does not exist (#16495) [NEW] Save default filters in the Omnichannel Current Chats list (#16653) Update app/utils/client/lib/RestApiClient.js Update app/utils/client/lib/RestApiClient.js send files over rest api [BUG][FIX] If InternalHubot_Username is undefined then rocket.cat should be default bot Improved isSingular function ...
- Loading branch information
Showing
93 changed files
with
393 additions
and
235 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
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
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,46 @@ | ||
import { check } from 'meteor/check'; | ||
import { Accounts } from 'meteor/accounts-base'; | ||
|
||
import * as Mailer from '../../../mailer'; | ||
import { Users, Subscriptions } from '../../../models'; | ||
import { settings } from '../../../settings'; | ||
|
||
export function setUserActiveStatus(userId, active) { | ||
check(userId, String); | ||
check(active, Boolean); | ||
|
||
const user = Users.findOneById(userId); | ||
|
||
if (!user) { | ||
return false; | ||
} | ||
|
||
Users.setUserActive(userId, active); | ||
|
||
if (user.username) { | ||
Subscriptions.setArchivedByUsername(user.username, !active); | ||
} | ||
|
||
if (active === false) { | ||
Users.unsetLoginTokens(userId); | ||
} else { | ||
Users.unsetReason(userId); | ||
} | ||
if (active && !settings.get('Accounts_Send_Email_When_Activating')) { | ||
return true; | ||
} | ||
if (!active && !settings.get('Accounts_Send_Email_When_Deactivating')) { | ||
return true; | ||
} | ||
|
||
const destinations = Array.isArray(user.emails) && user.emails.map((email) => `${ user.name || user.username }<${ email.address }>`); | ||
|
||
const email = { | ||
to: destinations, | ||
from: settings.get('From_Email'), | ||
subject: Accounts.emailTemplates.userActivated.subject({ active }), | ||
html: Accounts.emailTemplates.userActivated.html({ active, name: user.name, username: user.username }), | ||
}; | ||
|
||
Mailer.sendNoWrap(email); | ||
} |
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
Oops, something went wrong.