├── .sandstorm ├── stack ├── .gitignore ├── CHANGELOG.md ├── pgp-keyring ├── pgp-signature ├── screenshot1.png ├── screenshot2.png ├── screenshot3.png ├── screenshot4.png ├── description.md └── README.md ├── .meteor ├── release ├── .gitignore ├── platforms └── .id ├── packages ├── rocketchat-2fa │ ├── README.md │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── server │ │ └── methods │ │ ├── checkCodesRemaining.js │ │ └── enable.js ├── rocketchat-sms │ ├── README.md │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── package.js ├── rocketchat-ui │ ├── README.md │ └── client │ │ ├── views │ │ ├── 404 │ │ │ ├── roomNotFound.js │ │ │ └── invalidSecretURL.html │ │ ├── modal.js │ │ ├── app │ │ │ ├── notAuthorized.html │ │ │ ├── home.js │ │ │ ├── roomSearch.html │ │ │ ├── burger.js │ │ │ ├── userSearch.html │ │ │ ├── secretURL.html │ │ │ ├── burger.html │ │ │ ├── audioNotification.html │ │ │ ├── roomSearch.js │ │ │ └── home.html │ │ └── cmsPage.html │ │ └── lib │ │ ├── codeMirror │ │ └── codeMirrorComponent.html │ │ ├── accounts.js │ │ └── customEventPolyfill.js ├── rocketchat-tooltip │ ├── README.md │ ├── init.js │ └── rocketchat-tooltip.html ├── rocketchat-ui-admin │ ├── README.md │ └── client │ │ └── users │ │ ├── adminUserEdit.html │ │ ├── adminUserInfo.html │ │ └── adminUserChannels.html ├── rocketchat-ui-login │ ├── README.md │ └── client │ │ ├── login │ │ ├── social.js │ │ ├── layout.js │ │ ├── header.html │ │ ├── footer.html │ │ ├── layout.html │ │ └── header.js │ │ ├── routes.js │ │ └── username │ │ └── layout.html ├── autoupdate │ └── .gitignore ├── rocketchat-reactions │ ├── README.md │ └── server │ │ └── models │ │ └── Messages.js ├── rocketchat-ui-account │ ├── README.md │ └── client │ │ ├── avatar │ │ ├── avatar.html │ │ └── avatar.js │ │ ├── account.js │ │ └── account.html ├── rocketchat-ui-flextab │ └── README.md ├── rocketchat-ui-master │ ├── README.md │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── client │ │ ├── loading.html │ │ ├── error.html │ │ └── logoLayout.html ├── rocketchat-ui-message │ ├── README.md │ └── client │ │ └── popup │ │ ├── messagePopupEmoji.html │ │ ├── messagePopupChannel.html │ │ ├── messagePopupChannel.js │ │ ├── messagePopupEmoji.js │ │ ├── messagePopupSlashCommand.html │ │ ├── messagePopupConfig.html │ │ └── messagePopupUser.html ├── rocketchat-ui-sidenav │ └── README.md ├── rocketchat-ui-vrecord │ ├── README.md │ └── server │ │ └── settings.js ├── rocketchat-custom-oauth │ ├── .gitignore │ └── README.md ├── meteor-timesync │ ├── .gitignore │ └── .travis.yml ├── rocketchat-emoji-emojione │ └── .gitignore ├── rocketchat-livechat │ ├── .gitignore │ ├── app │ │ ├── .meteor │ │ │ ├── release │ │ │ ├── platforms │ │ │ ├── .gitignore │ │ │ └── .id │ │ ├── i18n │ │ │ ├── az.i18n.json │ │ │ ├── eo.i18n.json │ │ │ ├── lt.i18n.json │ │ │ └── da.i18n.json │ │ ├── client │ │ │ ├── lib │ │ │ │ ├── error.js │ │ │ │ ├── collections.js │ │ │ │ ├── autolinker.js │ │ │ │ └── parentCall.js │ │ │ ├── startup │ │ │ │ └── customFields.js │ │ │ ├── views │ │ │ │ ├── avatar.html │ │ │ │ ├── loading.html │ │ │ │ ├── poweredBy.html │ │ │ │ └── options.html │ │ │ ├── components │ │ │ │ └── modal.html │ │ │ └── routes │ │ │ │ └── router.js │ │ └── run.sh │ ├── client │ │ ├── collections │ │ │ ├── AgentUsers.js │ │ │ ├── LivechatQueueUser.js │ │ │ ├── LivechatInquiry.js │ │ │ ├── LivechatIntegration.js │ │ │ ├── LivechatTrigger.js │ │ │ ├── LivechatDepartment.js │ │ │ ├── livechatOfficeHour.js │ │ │ ├── LivechatCustomField.js │ │ │ ├── LivechatPageVisited.js │ │ │ └── LivechatDepartmentAgents.js │ │ ├── views │ │ │ ├── app │ │ │ │ ├── livechatNotSubscribed.html │ │ │ │ ├── livechatDashboard.html │ │ │ │ └── tabbar │ │ │ │ │ └── externalSearch.html │ │ │ └── sideNav │ │ │ │ └── livechatFlex.js │ │ └── methods │ │ │ └── changeLivechatStatus.js │ └── server │ │ ├── api.js │ │ ├── methods │ │ ├── getCustomFields.js │ │ ├── pageVisited.js │ │ ├── saveOfficeHours.js │ │ ├── addAgent.js │ │ ├── addManager.js │ │ ├── removeAgent.js │ │ ├── removeDepartment.js │ │ ├── removeManager.js │ │ ├── setDepartmentForVisitor.js │ │ ├── sendMessageLivechat.js │ │ ├── removeTrigger.js │ │ ├── saveDepartment.js │ │ └── changeLivechatStatus.js │ │ ├── publications │ │ ├── externalMessages.js │ │ └── livechatOfficeHours.js │ │ ├── models │ │ └── indexes.js │ │ └── lib │ │ └── OfficeClock.js ├── rocketchat-oauth2-server-config │ ├── .gitignore │ ├── admin │ │ ├── client │ │ │ ├── collection.js │ │ │ ├── startup.js │ │ │ └── views │ │ │ │ └── oauthApps.js │ │ └── server │ │ │ └── publications │ │ │ └── oauthApps.js │ ├── server │ │ └── models │ │ │ └── OAuthApps.js │ └── oauth │ │ └── server │ │ └── default-services.js ├── rocketchat-api │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── server │ │ ├── v1 │ │ └── helpers │ │ │ ├── requestParams.js │ │ │ ├── isUserFromParams.js │ │ │ └── getLoggedInUser.js │ │ └── default │ │ ├── metrics.js │ │ ├── info.js │ │ └── helpers │ │ └── getLoggedInUser.js ├── rocketchat-assets │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── package.js ├── rocketchat-cas │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ └── README ├── rocketchat-crowd │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ ├── npm-shrinkwrap.json │ │ └── README ├── rocketchat-file │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── package.js ├── rocketchat-irc │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ ├── npm-shrinkwrap.json │ │ └── README ├── rocketchat-lib │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ ├── rocketchat.info │ ├── server │ │ ├── methods │ │ │ ├── getServerInfo.js │ │ │ ├── addUserToRoom.js │ │ │ ├── checkRegistrationSecretURL.js │ │ │ ├── getFullUserData.js │ │ │ ├── insertOrUpdateUser.js │ │ │ ├── joinDefaultChannels.js │ │ │ ├── createToken.js │ │ │ └── getSingleMessage.js │ │ ├── functions │ │ │ ├── unarchiveRoom.js │ │ │ ├── checkEmailAvailability.js │ │ │ └── archiveRoom.js │ │ ├── lib │ │ │ └── metrics.js │ │ ├── oauth │ │ │ └── proxy.js │ │ └── models │ │ │ └── Reports.js │ ├── lib │ │ └── core.js │ └── client │ │ ├── models │ │ ├── Avatars.js │ │ └── Uploads.js │ │ └── lib │ │ └── Layout.js ├── rocketchat-oembed │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── client │ │ ├── baseWidget.html │ │ ├── oembedAudioWidget.js │ │ ├── oembedFrameWidget.js │ │ ├── oembedYoutubeWidget.js │ │ └── oembedSandstormGrain.html ├── rocketchat-theme │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── client │ │ ├── vendor │ │ └── fontello │ │ │ └── font │ │ │ ├── fontello.eot │ │ │ ├── fontello.ttf │ │ │ ├── fontello.woff │ │ │ └── fontello.woff2 │ │ ├── main.css │ │ └── imports │ │ └── variables.css ├── rocketchat-tutum │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ ├── README │ │ │ └── npm-shrinkwrap.json │ └── package.js ├── meteor-accounts-saml │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ └── README ├── rocketchat-autolinker │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ ├── npm-shrinkwrap.json │ │ │ └── README │ └── package.js ├── rocketchat-file-upload │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ └── ufs │ │ ├── AmazonS3 │ │ └── client.js │ │ └── GoogleStorage │ │ └── client.js ├── rocketchat-importer-csv │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ ├── npm-shrinkwrap.json │ │ │ └── README │ ├── main.js │ └── package.js ├── rocketchat-importer │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ ├── lib │ │ ├── _importer.js │ │ └── importTool.js │ ├── client │ │ └── admin │ │ │ └── adminImportProgress.html │ └── server │ │ ├── models │ │ ├── Imports.js │ │ └── RawImports.js │ │ └── classes │ │ └── ImporterProgress.js ├── rocketchat-slackbridge │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ ├── logger.js │ └── slashcommand │ │ └── slackbridge_import.client.js ├── rocketchat-authorization │ ├── lib │ │ └── rocketchat.js │ ├── server │ │ ├── functions │ │ │ ├── getRoles.js │ │ │ ├── getUsersInRole.js │ │ │ └── hasRole.js │ │ ├── publications │ │ │ └── roles.js │ │ └── models │ │ │ └── Users.js │ └── client │ │ ├── hasRole.js │ │ ├── startup.js │ │ ├── lib │ │ └── ChatPermissions.js │ │ └── requiresPermission.html ├── rocketchat-i18n │ └── i18n │ │ ├── az.i18n.json │ │ ├── eo.i18n.json │ │ ├── da.i18n.json │ │ └── lt.i18n.json ├── rocketchat-internal-hubot │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ └── README ├── rocketchat-mailer │ ├── lib │ │ └── Mailer.js │ ├── client │ │ ├── views │ │ │ ├── mailerUnsubscribe.js │ │ │ └── mailerUnsubscribe.html │ │ ├── startup.js │ │ └── router.js │ └── server │ │ ├── startup.js │ │ ├── functions │ │ └── unsubscribe.js │ │ ├── methods │ │ └── unsubscribe.js │ │ └── models │ │ └── Users.js ├── rocketchat-chatops │ ├── client │ │ ├── views │ │ │ ├── chatops.js │ │ │ ├── chatops.html │ │ │ └── stylesheets │ │ │ │ └── chatops.css │ │ └── startup.js │ └── server │ │ └── settings.js ├── rocketchat-smarsh-connector │ ├── lib │ │ └── rocketchat.js │ └── server │ │ └── models │ │ └── SmarshHistory.js ├── rocketchat-statistics │ ├── lib │ │ └── rocketchat.js │ └── server │ │ └── functions │ │ └── save.js ├── rocketchat-google-natural-language │ ├── .npm │ │ └── package │ │ │ ├── .gitignore │ │ │ └── README │ ├── server │ │ └── models │ │ │ └── Rooms.js │ └── client │ │ └── index.js ├── rocketchat-importer-hipchat-enterprise │ └── .npm │ │ └── package │ │ ├── .gitignore │ │ └── README ├── rocketchat-postcss │ └── .npm │ │ └── plugin │ │ └── minifier-postcss │ │ ├── .gitignore │ │ └── README ├── rocketchat-message-pin │ ├── client │ │ ├── lib │ │ │ └── PinnedMessage.js │ │ └── messageType.js │ └── server │ │ ├── startup │ │ └── indexes.js │ │ └── settings.js ├── rocketchat-message-star │ ├── client │ │ ├── lib │ │ │ └── StarredMessage.js │ │ ├── tabBar.js │ │ ├── views │ │ │ └── stylesheets │ │ │ │ └── messagestar.less │ │ └── starMessage.js │ └── server │ │ ├── settings.js │ │ └── startup │ │ └── indexes.js ├── rocketchat-message-snippet │ ├── client │ │ ├── lib │ │ │ └── collections.js │ │ ├── messageType.js │ │ └── router.js │ └── server │ │ └── startup │ │ └── settings.js ├── rocketchat-mentions-flextab │ └── client │ │ ├── lib │ │ └── MentionedMessage.js │ │ ├── views │ │ └── stylesheets │ │ │ └── mentionsFlexTab.less │ │ └── tabBar.js ├── rocketchat-videobridge │ ├── server │ │ ├── actionLink.js │ │ └── models │ │ │ └── Rooms.js │ ├── lib │ │ └── messageType.js │ └── client │ │ ├── stylesheets │ │ └── video.less │ │ └── views │ │ └── videoFlexTab.html ├── rocketchat-slashcommands-archiveroom │ ├── client.js │ └── messages.js ├── rocketchat-slashcommands-create │ ├── client.js │ └── package.js ├── rocketchat-slashcommands-unarchiveroom │ ├── client.js │ └── messages.js ├── rocketchat-importer-slack │ ├── main.js │ └── package.js ├── rocketchat-slashcommands-mute │ └── client │ │ ├── mute.js │ │ └── unmute.js ├── rocketchat-emoji-custom │ ├── server │ │ └── methods │ │ │ └── listEmojiCustom.js │ ├── admin │ │ ├── adminEmojiEdit.html │ │ ├── adminEmojiInfo.html │ │ ├── startup.js │ │ ├── emojiPreview.html │ │ └── route.js │ └── client │ │ ├── notifications │ │ ├── deleteEmojiCustom.js │ │ └── updateEmojiCustom.js │ │ └── models │ │ └── EmojiCustom.js ├── rocketchat-slashcommands-invite │ ├── client.js │ └── package.js ├── rocketchat-slashcommands-msg │ ├── client.js │ └── package.js ├── rocketchat-custom-sounds │ ├── server │ │ ├── methods │ │ │ └── listCustomSounds.js │ │ └── startup │ │ │ └── permissions.js │ ├── admin │ │ ├── adminSoundEdit.html │ │ ├── adminSoundInfo.html │ │ ├── startup.js │ │ └── route.js │ └── client │ │ ├── notifications │ │ ├── deleteCustomSound.js │ │ └── updateCustomSound.js │ │ └── models │ │ └── CustomSounds.js ├── rocketchat-error-handler │ ├── server │ │ └── startup │ │ │ └── settings.js │ └── package.js ├── rocketchat-importer-hipchat │ ├── main.js │ └── package.js ├── rocketchat-otr │ └── server │ │ ├── settings.js │ │ ├── methods │ │ └── updateOTRAck.js │ │ └── models │ │ └── Messages.js ├── rocketchat-cors │ ├── common.js │ └── package.js ├── rocketchat-integrations │ ├── client │ │ ├── collections.js │ │ ├── views │ │ │ └── integrationsNew.js │ │ └── startup.js │ └── server │ │ └── logger.js ├── rocketchat-message-mark-as-unread │ └── server │ │ └── logger.js ├── rocketchat-colors │ ├── settings.js │ ├── style.css │ └── package.js ├── rocketchat-favico │ └── package.js ├── rocketchat-wordpress │ ├── client │ │ └── wordpress-login-button.css │ └── package.js ├── rocketchat-autotranslate │ ├── README.md │ └── server │ │ ├── permissions.js │ │ ├── methods │ │ └── translateMessage.js │ │ └── settings.js ├── rocketchat-katex │ ├── client │ │ └── style.css │ └── package.json ├── rocketchat-channel-settings-mail-messages │ ├── server │ │ └── lib │ │ │ └── startup.js │ └── client │ │ ├── stylesheets │ │ └── mail-messages.less │ │ ├── views │ │ └── channelSettingsMailMessages.html │ │ ├── resetSelection.js │ │ └── lib │ │ └── startup.js ├── rocketchat-slashcommands-kick │ ├── client.js │ └── package.js ├── rocketchat-emoji │ └── rocketchat.js ├── rocketchat-push-notifications │ └── client │ │ └── tabBar.js ├── rocketchat-slashcommands-inviteall │ ├── client.js │ └── package.js ├── rocketchat-channel-settings │ ├── client │ │ └── startup │ │ │ └── tabBar.js │ └── server │ │ ├── functions │ │ ├── saveRoomReadOnly.js │ │ ├── saveReactWhenReadOnly.js │ │ └── saveRoomSystemMessages.js │ │ ├── startup.js │ │ └── models │ │ └── Messages.js ├── rocketchat-slashcommands-leave │ └── package.js ├── rocketchat-slashcommands-me │ ├── package.js │ └── me.js ├── rocketchat-bot-helpers │ └── server │ │ └── settings.js ├── rocketchat-version │ └── package.js ├── rocketchat-migrations │ └── package.js ├── rocketchat-slashcommands-join │ ├── client.js │ └── package.js ├── rocketchat-sandstorm │ ├── client │ │ └── setPath.js │ └── package.js ├── rocketchat-mapview │ ├── package.js │ └── server │ │ └── settings.js ├── rocketchat-mentions │ └── package.js ├── rocketchat-slashcommands-open │ └── package.js ├── rocketchat-slashcommands-topic │ └── package.js ├── rocketchat-markdown │ └── settings.js ├── rocketchat-token-login │ ├── server │ │ └── login_token_server.js │ └── client │ │ └── login_token_client.js ├── rocketchat-gitlab │ └── package.js └── rocketchat-slashcommand-asciiarts │ ├── gimme.js │ └── shrug.js ├── client ├── lib │ └── toastr.js ├── helpers │ ├── not.js │ └── log.js ├── methods │ ├── setUserActiveStatus.js │ ├── openRoom.js │ ├── toggleFavorite.js │ ├── hideRoom.js │ └── leaveRoom.js ├── notifications │ └── updateAvatar.js ├── routes │ └── roomRoute.js └── startup │ ├── roomObserve.js │ ├── userSetUtcOffset.js │ └── emailVerification.js ├── .dockerignore ├── mocha.opts ├── public ├── favicon.ico ├── sounds │ ├── beep.mp3 │ ├── chelle.mp3 │ ├── chime.mp3 │ ├── ding.mp3 │ ├── door.mp3 │ ├── droplet.mp3 │ ├── highbell.mp3 │ └── seasons.mp3 ├── images │ ├── logo │ │ ├── 512x512.jpg │ │ ├── 512x512.png │ │ ├── favicon.ico │ │ ├── 1024x1024.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── 1024x1024-circle.png │ │ ├── apple-touch-icon.png │ │ ├── mstile-144x144.png │ │ ├── mstile-150x150.png │ │ ├── mstile-310x150.png │ │ ├── mstile-310x310.png │ │ ├── android-chrome-192x192.png │ │ └── apple-touch-icon-precomposed.png │ ├── onepassword-button.png │ ├── browserconfig.xml │ └── manifest.json └── manifest.webapp ├── .travis ├── setdeploydir.sh ├── sign.key.gpg ├── update-releases.sh ├── setartname.sh ├── namefiles.sh ├── setupsig.sh └── docker.sh ├── private ├── avatars │ ├── hubot.png │ ├── hubot2.png │ └── rocketcat.png └── node_scripts │ ├── package.json │ └── unsubscribe_csv │ └── package.json ├── .snapcraft ├── launchpadkey.enc └── resources │ ├── Caddyfile │ ├── startmongo │ ├── initcaddy │ ├── rcbackup │ └── initreplset.js ├── lib ├── RegExp.js ├── francocatena_fix.js └── underscore.string.js ├── tests ├── data │ ├── interactions.js │ ├── channel.js │ └── user.js └── pageobjects │ └── Page.js ├── .stylelintignore ├── .scripts ├── start-xvfb.sh └── version.js ├── server ├── startup │ ├── appcache.js │ ├── migrations │ │ ├── v086.js │ │ ├── v028.js │ │ ├── v016.js │ │ ├── v017.js │ │ ├── v062.js │ │ ├── v052.js │ │ ├── v024.js │ │ ├── v078.js │ │ ├── v013.js │ │ ├── v050.js │ │ ├── v061.js │ │ ├── v026.js │ │ ├── v043.js │ │ ├── v096.js │ │ ├── v023.js │ │ ├── v046.js │ │ ├── v098.js │ │ ├── v032.js │ │ ├── v075.js │ │ ├── v081.js │ │ ├── xrun.js │ │ ├── v022.js │ │ ├── v082.js │ │ ├── v058.js │ │ ├── v025.js │ │ ├── v067.js │ │ ├── v076.js │ │ ├── v011.js │ │ ├── v064.js │ │ ├── v034.js │ │ ├── v092.js │ │ ├── v056.js │ │ ├── v071.js │ │ ├── v072.js │ │ ├── v055.js │ │ ├── v073.js │ │ ├── v035.js │ │ ├── v041.js │ │ ├── v080.js │ │ ├── v090.js │ │ ├── v066.js │ │ └── v079.js │ └── presence.js ├── methods │ ├── logoutCleanUp.js │ ├── loadLocale.js │ ├── getTotalChannels.js │ ├── hideRoom.js │ ├── openRoom.js │ ├── readMessages.js │ ├── deleteFileMessage.js │ ├── toogleFavorite.js │ └── userSetUtcOffset.js ├── publications │ ├── activeUsers.js │ ├── fullUserData.js │ ├── privateHistory.js │ ├── userChannels.js │ └── roomSubscriptionsByRole.js └── restapi │ └── README.md ├── publish_packages.sh ├── .github ├── ISSUE_TEMPLATE.md └── templates │ ├── footer.hbs │ └── template.hbs ├── SECURITY.md ├── example-settings.json ├── example-ecosystem.json ├── .editorconfig ├── example-build.sh └── install.sh /.sandstorm/stack: -------------------------------------------------------------------------------- 1 | meteor 2 | -------------------------------------------------------------------------------- /.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.5 2 | -------------------------------------------------------------------------------- /packages/rocketchat-2fa/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-sms/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.sandstorm/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /packages/rocketchat-tooltip/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-admin/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | dev_bundle 2 | local 3 | -------------------------------------------------------------------------------- /packages/autoupdate/.gitignore: -------------------------------------------------------------------------------- 1 | .build* 2 | -------------------------------------------------------------------------------- /packages/rocketchat-reactions/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-account/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-flextab/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-sidenav/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-vrecord/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.meteor/platforms: -------------------------------------------------------------------------------- 1 | browser 2 | ios 3 | server 4 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/social.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-oauth/.gitignore: -------------------------------------------------------------------------------- 1 | .build* 2 | -------------------------------------------------------------------------------- /client/lib/toastr.js: -------------------------------------------------------------------------------- 1 | import 'toastr/build/toastr.min.css'; 2 | -------------------------------------------------------------------------------- /packages/meteor-timesync/.gitignore: -------------------------------------------------------------------------------- 1 | .build* 2 | .versions 3 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-emojione/.gitignore: -------------------------------------------------------------------------------- 1 | emoji.json 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/.gitignore: -------------------------------------------------------------------------------- 1 | /public/ 2 | .npm/ 3 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.5 2 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/.gitignore: -------------------------------------------------------------------------------- 1 | .build* 2 | -------------------------------------------------------------------------------- /packages/rocketchat-2fa/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-api/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-assets/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-cas/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-crowd/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-file/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-irc/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-sms/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-tutum/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.sandstorm/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### FIRST Sandstorm VERSION of Rocket.Chat 2 | -------------------------------------------------------------------------------- /packages/meteor-accounts-saml/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-autolinker/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-file-upload/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-csv/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/.meteor/platforms: -------------------------------------------------------------------------------- 1 | browser 2 | server 3 | -------------------------------------------------------------------------------- /packages/rocketchat-slackbridge/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/lib/rocketchat.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz = {}; 2 | -------------------------------------------------------------------------------- /packages/rocketchat-i18n/i18n/az.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "#channel": "#kanal" 3 | } -------------------------------------------------------------------------------- /packages/rocketchat-i18n/i18n/eo.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "#channel": "#kanalo" 3 | } -------------------------------------------------------------------------------- /packages/rocketchat-internal-hubot/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | dev_bundle 2 | local 3 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/lib/Mailer.js: -------------------------------------------------------------------------------- 1 | Mailer = {};//eslint-disable-line 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | LICENSE 4 | README.md 5 | docker-compose.yml -------------------------------------------------------------------------------- /packages/rocketchat-chatops/client/views/chatops.js: -------------------------------------------------------------------------------- 1 | Template.chatops.helpers; 2 | -------------------------------------------------------------------------------- /packages/rocketchat-smarsh-connector/lib/rocketchat.js: -------------------------------------------------------------------------------- 1 | RocketChat.smarsh = {}; 2 | -------------------------------------------------------------------------------- /packages/rocketchat-statistics/lib/rocketchat.js: -------------------------------------------------------------------------------- 1 | RocketChat.statistics = {}; 2 | -------------------------------------------------------------------------------- /mocha.opts: -------------------------------------------------------------------------------- 1 | --compilers js:babel-mocha-es6-compiler 2 | --reporter spec 3 | --ui bdd 4 | -------------------------------------------------------------------------------- /packages/rocketchat-google-natural-language/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-i18n/i18n/da.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "0_Errors_Only": "0 - Fejl Kun" 3 | } -------------------------------------------------------------------------------- /packages/rocketchat-importer-hipchat-enterprise/.npm/package/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/rocketchat.info: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.57.0-develop" 3 | } 4 | -------------------------------------------------------------------------------- /packages/rocketchat-postcss/.npm/plugin/minifier-postcss/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /packages/rocketchat-i18n/i18n/lt.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "0_Errors_Only": "0 - Klaidos Tik" 3 | } -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/modal.js: -------------------------------------------------------------------------------- 1 | Template.modal.rendered = function() {}; 2 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/favicon.ico -------------------------------------------------------------------------------- /.travis/setdeploydir.sh: -------------------------------------------------------------------------------- 1 | export ROCKET_DEPLOY_DIR="/tmp/deploy" 2 | mkdir -p $ROCKET_DEPLOY_DIR 3 | -------------------------------------------------------------------------------- /.travis/sign.key.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.travis/sign.key.gpg -------------------------------------------------------------------------------- /client/helpers/not.js: -------------------------------------------------------------------------------- 1 | Template.registerHelper('not', (value) => { 2 | return !value; 3 | }); 4 | -------------------------------------------------------------------------------- /.sandstorm/pgp-keyring: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/pgp-keyring -------------------------------------------------------------------------------- /.sandstorm/pgp-signature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/pgp-signature -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/i18n/az.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "Additional_Feedback": "əlavə Əlaqə" 3 | } -------------------------------------------------------------------------------- /public/sounds/beep.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/beep.mp3 -------------------------------------------------------------------------------- /public/sounds/chelle.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/chelle.mp3 -------------------------------------------------------------------------------- /public/sounds/chime.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/chime.mp3 -------------------------------------------------------------------------------- /public/sounds/ding.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/ding.mp3 -------------------------------------------------------------------------------- /public/sounds/door.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/door.mp3 -------------------------------------------------------------------------------- /.sandstorm/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/screenshot1.png -------------------------------------------------------------------------------- /.sandstorm/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/screenshot2.png -------------------------------------------------------------------------------- /.sandstorm/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/screenshot3.png -------------------------------------------------------------------------------- /.sandstorm/screenshot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.sandstorm/screenshot4.png -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/i18n/eo.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "Additional_Feedback": "Kromaj Rimarkojn" 3 | } -------------------------------------------------------------------------------- /private/avatars/hubot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/private/avatars/hubot.png -------------------------------------------------------------------------------- /private/avatars/hubot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/private/avatars/hubot2.png -------------------------------------------------------------------------------- /public/sounds/droplet.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/droplet.mp3 -------------------------------------------------------------------------------- /public/sounds/highbell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/highbell.mp3 -------------------------------------------------------------------------------- /public/sounds/seasons.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/sounds/seasons.mp3 -------------------------------------------------------------------------------- /.snapcraft/launchpadkey.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/.snapcraft/launchpadkey.enc -------------------------------------------------------------------------------- /lib/RegExp.js: -------------------------------------------------------------------------------- 1 | RegExp.escape = function(s) { 2 | return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/i18n/lt.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "Additional_Feedback": "Papildoma Atsiliepimai" 3 | } -------------------------------------------------------------------------------- /private/avatars/rocketcat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/private/avatars/rocketcat.png -------------------------------------------------------------------------------- /.snapcraft/resources/Caddyfile: -------------------------------------------------------------------------------- 1 | http://:8080 2 | proxy / localhost:3000 { 3 | websocket 4 | transparent 5 | } 6 | -------------------------------------------------------------------------------- /client/helpers/log.js: -------------------------------------------------------------------------------- 1 | Template.registerHelper('log', () => { 2 | console.log.apply(console, arguments); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/i18n/da.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "Appearance": "Udseende", 3 | "Cancel": "Ophæve" 4 | } -------------------------------------------------------------------------------- /packages/rocketchat-tooltip/init.js: -------------------------------------------------------------------------------- 1 | Template.main.onCreated(function() { 2 | RocketChat.tooltip.init(); 3 | }); 4 | -------------------------------------------------------------------------------- /public/images/logo/512x512.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/512x512.jpg -------------------------------------------------------------------------------- /public/images/logo/512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/512x512.png -------------------------------------------------------------------------------- /public/images/logo/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/favicon.ico -------------------------------------------------------------------------------- /lib/francocatena_fix.js: -------------------------------------------------------------------------------- 1 | this.i18n_status_func = function(key, options) { 2 | return TAPi18n.__(key, options); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/lib/_importer.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | Importer = {}; 3 | export default Importer; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/AgentUsers.js: -------------------------------------------------------------------------------- 1 | this.AgentUsers = new Mongo.Collection('agentUsers'); 2 | -------------------------------------------------------------------------------- /public/images/logo/1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/1024x1024.png -------------------------------------------------------------------------------- /public/images/logo/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/favicon-16x16.png -------------------------------------------------------------------------------- /public/images/logo/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/favicon-32x32.png -------------------------------------------------------------------------------- /public/images/onepassword-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/onepassword-button.png -------------------------------------------------------------------------------- /public/images/logo/1024x1024-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/1024x1024-circle.png -------------------------------------------------------------------------------- /public/images/logo/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/apple-touch-icon.png -------------------------------------------------------------------------------- /public/images/logo/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/mstile-144x144.png -------------------------------------------------------------------------------- /public/images/logo/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/mstile-150x150.png -------------------------------------------------------------------------------- /public/images/logo/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/mstile-310x150.png -------------------------------------------------------------------------------- /public/images/logo/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/mstile-310x310.png -------------------------------------------------------------------------------- /packages/rocketchat-message-pin/client/lib/PinnedMessage.js: -------------------------------------------------------------------------------- 1 | this.PinnedMessage = new Mongo.Collection('rocketchat_pinned_message'); 2 | -------------------------------------------------------------------------------- /tests/data/interactions.js: -------------------------------------------------------------------------------- 1 | export const targetUser = 'rocket.cat'; 2 | export const imgURL = './public/images/logo/1024x1024.png'; 3 | -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | packages/rocketchat-theme/client/vendor/fontello/css/fontello.css 2 | packages/meteor-autocomplete/client/autocomplete.css 3 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatQueueUser.js: -------------------------------------------------------------------------------- 1 | this.LivechatQueueUser = new Mongo.Collection('livechatQueueUser'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/client/lib/StarredMessage.js: -------------------------------------------------------------------------------- 1 | this.StarredMessage = new Mongo.Collection('rocketchat_starred_message'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/admin/client/collection.js: -------------------------------------------------------------------------------- 1 | this.ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/getServerInfo.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | getServerInfo() { 3 | return RocketChat.Info; 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/lib/error.js: -------------------------------------------------------------------------------- 1 | this.showError = msg => { 2 | $('.error').addClass('show').find('span').html(msg); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatInquiry.js: -------------------------------------------------------------------------------- 1 | this.LivechatInquiry = new Mongo.Collection('rocketchat_livechat_inquiry'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatIntegration.js: -------------------------------------------------------------------------------- 1 | this.LivechatIntegration = new Mongo.Collection('livechatIntegration'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatTrigger.js: -------------------------------------------------------------------------------- 1 | this.LivechatTrigger = new Mongo.Collection('rocketchat_livechat_trigger'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-message-snippet/client/lib/collections.js: -------------------------------------------------------------------------------- 1 | this.SnippetedMessages = new Mongo.Collection('rocketchat_snippeted_message'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/client/baseWidget.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/images/logo/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/android-chrome-192x192.png -------------------------------------------------------------------------------- /packages/rocketchat-mentions-flextab/client/lib/MentionedMessage.js: -------------------------------------------------------------------------------- 1 | this.MentionedMessage = new Mongo.Collection('rocketchat_mentioned_message'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/layout.js: -------------------------------------------------------------------------------- 1 | Template.loginLayout.onRendered(function() { 2 | $('#initial-page-loading').remove(); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-videobridge/server/actionLink.js: -------------------------------------------------------------------------------- 1 | RocketChat.actionLinks.register('joinJitsiCall', function(/*message, params*/) { 2 | 3 | }); 4 | -------------------------------------------------------------------------------- /.scripts/start-xvfb.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then 4 | sh -e /etc/init.d/xvfb start 5 | sleep 3 6 | fi 7 | -------------------------------------------------------------------------------- /packages/meteor-timesync/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | before_install: 5 | - "curl -L http://git.io/ejPSng | /bin/sh" 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatDepartment.js: -------------------------------------------------------------------------------- 1 | this.LivechatDepartment = new Mongo.Collection('rocketchat_livechat_department'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/livechatOfficeHour.js: -------------------------------------------------------------------------------- 1 | this.LivechatOfficeHour = new Mongo.Collection('rocketchat_livechat_office_hour'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/notAuthorized.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /public/images/logo/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/public/images/logo/apple-touch-icon-precomposed.png -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/lib/collections.js: -------------------------------------------------------------------------------- 1 | this.ChatMessage = new Mongo.Collection(null); 2 | this.Department = new Mongo.Collection(null); 3 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatCustomField.js: -------------------------------------------------------------------------------- 1 | this.LivechatCustomField = new Mongo.Collection('rocketchat_livechat_custom_field'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatPageVisited.js: -------------------------------------------------------------------------------- 1 | this.LivechatPageVisited = new Mongo.Collection('rocketchat_livechat_page_visited'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupEmoji.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/server/functions/getRoles.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz.getRoles = function() { 2 | return RocketChat.models.Roles.find().fetch(); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/startup/customFields.js: -------------------------------------------------------------------------------- 1 | /* globals CustomFields */ 2 | 3 | Meteor.startup(function() { 4 | CustomFields.init(); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-archiveroom/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('archive', null, { 2 | description: 'Archive', 3 | params: '#channel' 4 | }); 5 | -------------------------------------------------------------------------------- /tests/data/channel.js: -------------------------------------------------------------------------------- 1 | export const publicChannelName = `channel-test-${ Date.now() }`; 2 | export const privateChannelName = `private-channel-test-${ Date.now() }`; 3 | -------------------------------------------------------------------------------- /.snapcraft/resources/startmongo: -------------------------------------------------------------------------------- 1 | env LC_ALL=C mongod --bind_ip 127.0.0.1 --pidfilepath $SNAP_COMMON/mongod.pid --smallfiles --journal --dbpath=$SNAP_COMMON --replSet rs0 2 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/client/views/mailerUnsubscribe.js: -------------------------------------------------------------------------------- 1 | Template.mailerUnsubscribe.onRendered(function() { 2 | return $('#initial-page-loading').remove(); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupChannel.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /.snapcraft/resources/initcaddy: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cp $SNAP/bin/Caddyfile $SNAP_DATA/Caddyfile 3 | echo "Replace $SNAP_DATA/Caddyfile with your own to customize reverse proxy" 4 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/lib/core.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Kick off the global namespace for RocketChat. 4 | * @namespace RocketChat 5 | */ 6 | RocketChat = { 7 | models: {} 8 | }; 9 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/collections/LivechatDepartmentAgents.js: -------------------------------------------------------------------------------- 1 | this.LivechatDepartmentAgents = new Mongo.Collection('rocketchat_livechat_department_agents'); 2 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-create/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('create', null, { 2 | description: 'Create_A_New_Channel', 3 | params: '#channel' 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-unarchiveroom/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('unarchive', null, { 2 | description: 'Unarchive', 3 | params: '#channel' 4 | }); 5 | -------------------------------------------------------------------------------- /server/startup/appcache.js: -------------------------------------------------------------------------------- 1 | if (Meteor.AppCache) { 2 | Meteor.AppCache.config({ 3 | onlineOnly: ['/elements/', '/landing/', '/moment-locales/', '/scripts/'] 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /server/startup/migrations/v086.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 86, 3 | up() { 4 | // Disabled this migration for it was not updating any user 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /.travis/update-releases.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | CURL_URL="https://rocket.chat/releases/update" 7 | 8 | curl -X POST "$CURL_URL" 9 | -------------------------------------------------------------------------------- /packages/rocketchat-chatops/client/startup.js: -------------------------------------------------------------------------------- 1 | /* globals GoogleMaps */ 2 | Meteor.startup(function() { 3 | console.log('startup hooked'); 4 | return GoogleMaps.load(); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-slack/main.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | Importer.addImporter('slack', Importer.Slack, { 3 | name: 'Slack', 4 | mimeType: 'application/zip' 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-mute/client/mute.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('mute', undefined, { 2 | description: 'Mute_someone_in_room', 3 | params: '@username' 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/server/methods/listEmojiCustom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | listEmojiCustom() { 3 | return RocketChat.models.EmojiCustom.find({}).fetch(); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export DDP_DEFAULT_CONNECTION_URL=http://localhost:3000 4 | export MONGO_URL=mongodb://localhost:27017 5 | meteor -p 5000 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/views/app/livechatNotSubscribed.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/api.js: -------------------------------------------------------------------------------- 1 | import '../imports/server/rest/departments.js'; 2 | import '../imports/server/rest/sms.js'; 3 | import '../imports/server/rest/users.js'; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-invite/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('invite', undefined, { 2 | description: 'Invite_user_to_join_channel', 3 | params: '@username' 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-msg/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('msg', undefined, { 2 | description: 'Direct_message_someone', 3 | params: '@username ' 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-mute/client/unmute.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('unmute', undefined, { 2 | description: 'Unmute_someone_in_room', 3 | params: '@username' 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/vendor/fontello/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/packages/rocketchat-theme/client/vendor/fontello/font/fontello.eot -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/vendor/fontello/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/packages/rocketchat-theme/client/vendor/fontello/font/fontello.ttf -------------------------------------------------------------------------------- /server/startup/migrations/v028.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 28, 3 | up() { 4 | return RocketChat.models.Permissions.addRole('view-c-room', 'bot'); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /client/methods/setUserActiveStatus.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | setUserActiveStatus(userId, active) { 3 | Meteor.users.update(userId, { $set: { active } }); 4 | return true; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/server/methods/listCustomSounds.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | listCustomSounds() { 3 | return RocketChat.models.CustomSounds.find({}).fetch(); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-error-handler/server/startup/settings.js: -------------------------------------------------------------------------------- 1 | RocketChat.settings.addGroup('Logs', function() { 2 | this.add('Log_Exceptions_to_Channel', '', { type: 'string' }); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/vendor/fontello/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/packages/rocketchat-theme/client/vendor/fontello/font/fontello.woff -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/vendor/fontello/font/fontello.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/al3x/Rocket.Chat/develop/packages/rocketchat-theme/client/vendor/fontello/font/fontello.woff2 -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/header.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupChannel.js: -------------------------------------------------------------------------------- 1 | Template.messagePopupChannel.helpers({ 2 | icon() { 3 | return RocketChat.roomTypes.getIcon(this.t); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /server/startup/migrations/v016.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 16, 3 | up() { 4 | return RocketChat.models.Messages.tryDropIndex({ 5 | _hidden: 1 6 | }); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v017.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 17, 3 | up() { 4 | return RocketChat.models.Messages.tryDropIndex({ 5 | _hidden: 1 6 | }); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-hipchat/main.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | 3 | Importer.addImporter('hipchat', Importer.HipChat, { 4 | name: 'HipChat', 5 | mimeType: 'application/zip' 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/lib/autolinker.js: -------------------------------------------------------------------------------- 1 | import Autolinker from 'autolinker'; 2 | 3 | this.livechatAutolinker = new Autolinker({ 4 | twitter: false, 5 | phone: false 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-account/client/avatar/avatar.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/startup/migrations/v062.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 62, 3 | up() { 4 | RocketChat.models.Settings.remove({ _id: 'Atlassian Crowd', type: 'group' }); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/client/admin/adminImportProgress.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/views/avatar.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/getCustomFields.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:getCustomFields'() { 3 | return RocketChat.models.LivechatCustomField.find().fetch(); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/client/models/Avatars.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Avatars = new class extends RocketChat.models._Base { 2 | constructor() { 3 | super(); 4 | this._initModel('avatars'); 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/pageVisited.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:pageVisited'(token, pageInfo) { 3 | return RocketChat.Livechat.savePageHistory(token, pageInfo); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /publish_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | for d in packages/* ; do 7 | echo "$d" 8 | cd $d 9 | meteor publish 10 | cd ../../ 11 | done 12 | -------------------------------------------------------------------------------- /server/startup/migrations/v052.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 52, 3 | up() { 4 | RocketChat.models.Users.update({ _id: 'rocket.cat' }, { $addToSet: { roles: 'bot' } }); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Rocket.Chat Version: 4 | Running Instances: 5 | DB Replicaset OpLog: 6 | Node Version: 7 | -------------------------------------------------------------------------------- /packages/rocketchat-google-natural-language/server/models/Rooms.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Rooms.setSentiment = function(roomId, sentiment) { 2 | return this.update({ _id: roomId }, { $set: { sentiment } }); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/client/models/Uploads.js: -------------------------------------------------------------------------------- 1 | 2 | RocketChat.models.Uploads = new class extends RocketChat.models._Base { 3 | constructor() { 4 | super(); 5 | this._initModel('uploads'); 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /packages/rocketchat-smarsh-connector/server/models/SmarshHistory.js: -------------------------------------------------------------------------------- 1 | RocketChat.smarsh.History = new class extends RocketChat.models._Base { 2 | constructor() { 3 | super('smarsh_history'); 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-account/client/account.js: -------------------------------------------------------------------------------- 1 | Template.account.onRendered(function() { 2 | Tracker.afterFlush(function() { 3 | SideNav.setFlex('accountFlex'); 4 | SideNav.openFlex(); 5 | }); 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupEmoji.js: -------------------------------------------------------------------------------- 1 | Template.messagePopupEmoji.helpers({ 2 | value() { 3 | const length = this.data.length; 4 | return this.data[length - 1]; 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /server/startup/migrations/v024.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 24, 3 | up() { 4 | return RocketChat.models.Permissions.remove({ 5 | _id: 'access-rocket-permissions' 6 | }); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-otr/server/settings.js: -------------------------------------------------------------------------------- 1 | RocketChat.settings.addGroup('OTR', function() { 2 | this.add('OTR_Enable', true, { 3 | type: 'boolean', 4 | i18nLabel: 'Enabled', 5 | public: true 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-admin/client/users/adminUserEdit.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /.travis/setartname.sh: -------------------------------------------------------------------------------- 1 | if [[ $TRAVIS_TAG ]] 2 | then 3 | export ARTIFACT_NAME="$(meteor npm run version --silent)" 4 | else 5 | export ARTIFACT_NAME="$(meteor npm run version --silent).$TRAVIS_BUILD_NUMBER" 6 | fi 7 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/server/publications/roles.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('roles', function() { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | return RocketChat.models.Roles.find(); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-cors/common.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return RocketChat.settings.onload('Force_SSL', function(key, value) { 3 | return Meteor.absoluteUrl.defaultOptions.secure = value; 4 | }); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/admin/adminSoundEdit.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/admin/adminSoundInfo.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/client/notifications/deleteCustomSound.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => 2 | RocketChat.Notifications.onAll('deleteCustomSound', data => RocketChat.CustomSounds.remove(data.soundData)) 3 | ); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/client/notifications/updateCustomSound.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => 2 | RocketChat.Notifications.onAll('updateCustomSound', data => RocketChat.CustomSounds.update(data.soundData)) 3 | ); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/admin/adminEmojiEdit.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/admin/adminEmojiInfo.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-integrations/client/collections.js: -------------------------------------------------------------------------------- 1 | this.ChatIntegrations = new Mongo.Collection('rocketchat_integrations'); 2 | this.ChatIntegrationHistory = new Mongo.Collection('rocketchat_integration_history'); 3 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/functions/unarchiveRoom.js: -------------------------------------------------------------------------------- 1 | RocketChat.unarchiveRoom = function(rid) { 2 | RocketChat.models.Rooms.unarchiveById(rid); 3 | RocketChat.models.Subscriptions.unarchiveByRoomId(rid); 4 | }; 5 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/publications/externalMessages.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('livechat:externalMessages', function(roomId) { 2 | return RocketChat.models.LivechatExternalMessage.findByRoomId(roomId); 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/routes.js: -------------------------------------------------------------------------------- 1 | FlowRouter.route('/reset-password/:token', { 2 | name: 'resetPassword', 3 | action() { 4 | BlazeLayout.render('loginLayout', {center: 'resetPassword'}); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/404/roomNotFound.js: -------------------------------------------------------------------------------- 1 | Template.roomNotFound.helpers({ 2 | data() { 3 | return Session.get('roomNotFound'); 4 | }, 5 | name() { 6 | return Blaze._escape(this.name); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/addUserToRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | addUserToRoom(data) { 3 | return Meteor.call('addUsersToRoom', { 4 | rid: data.rid, 5 | users: [ data.username ] 6 | }); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-message-mark-as-unread/server/logger.js: -------------------------------------------------------------------------------- 1 | const logger = new Logger('MessageMarkAsUnread', { 2 | sections: { 3 | connection: 'Connection', 4 | events: 'Events' 5 | } 6 | }); 7 | export default logger; 8 | -------------------------------------------------------------------------------- /packages/rocketchat-message-pin/client/messageType.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.MessageTypes.registerType({ 3 | id: 'message_pinned', 4 | system: true, 5 | message: 'Pinned_a_message' 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-tooltip/rocketchat-tooltip.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/server/functions/getUsersInRole.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz.getUsersInRole = function(roleName, scope, options) { 2 | return RocketChat.models.Roles.findUsersInRole(roleName, scope, options); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/views/app/livechatDashboard.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /packages/rocketchat-colors/settings.js: -------------------------------------------------------------------------------- 1 | RocketChat.settings.add('HexColorPreview_Enabled', true, { 2 | type: 'boolean', 3 | i18nLabel: 'Enabled', 4 | group: 'Message', 5 | section: 'Hex_Color_Preview', 6 | public: true 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/server/models/Imports.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | Importer.Imports = new (Importer.Imports = class Imports extends RocketChat.models._Base { 3 | constructor() { 4 | super('import'); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/client/startup.js: -------------------------------------------------------------------------------- 1 | RocketChat.AdminBox.addOption({ 2 | href: 'mailer', 3 | i18nLabel: 'Mailer', 4 | permissionGranted() { 5 | return RocketChat.authz.hasAllPermission('access-mailer'); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return RocketChat.settings.add('Message_AllowStarring', true, { 3 | type: 'boolean', 4 | group: 'Message', 5 | 'public': true 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-videobridge/lib/messageType.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.MessageTypes.registerType({ 3 | id: 'jitsi_call_started', 4 | system: true, 5 | message: 'Started a Video Call!' 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/client/hasRole.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz.hasRole = function(userId, roleNames, scope) { 2 | roleNames = [].concat(roleNames); 3 | return RocketChat.models.Roles.isUserInRoles(userId, roleNames, scope); 4 | }; 5 | -------------------------------------------------------------------------------- /packages/rocketchat-chatops/client/views/chatops.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/saveOfficeHours.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:saveOfficeHours'(day, start, finish, open) { 3 | RocketChat.models.LivechatOfficeHour.updateHours(day, start, finish, open); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /server/methods/logoutCleanUp.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | logoutCleanUp(user) { 3 | check(user, Object); 4 | 5 | Meteor.defer(function() { 6 | RocketChat.callbacks.run('afterLogoutCleanUp', user); 7 | }); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /.github/templates/footer.hbs: -------------------------------------------------------------------------------- 1 | {{#if noteGroups}} 2 | {{#each noteGroups}} 3 | 4 | ### {{title}} 5 | 6 | {{#each notes}} 7 | * {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}} 8 | {{/each}} 9 | {{/each}} 10 | 11 | {{/if}} 12 | -------------------------------------------------------------------------------- /client/notifications/updateAvatar.js: -------------------------------------------------------------------------------- 1 | /* globals updateAvatarOfUsername */ 2 | 3 | Meteor.startup(function() { 4 | RocketChat.Notifications.onLogged('updateAvatar', function(data) { 5 | updateAvatarOfUsername(data.username); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/v1/helpers/requestParams.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.v1.helperMethods.set('requestParams', function _requestParams() { 2 | return ['POST', 'PUT'].includes(this.request.method) ? this.bodyParams : this.queryParams; 3 | }); 4 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/server/startup/permissions.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => { 2 | if (RocketChat.models && RocketChat.models.Permissions) { 3 | RocketChat.models.Permissions.createOrUpdate('manage-sounds', ['admin']); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/client/notifications/deleteEmojiCustom.js: -------------------------------------------------------------------------------- 1 | /* globals deleteEmojiCustom */ 2 | Meteor.startup(() => 3 | RocketChat.Notifications.onLogged('deleteEmojiCustom', data => deleteEmojiCustom(data.emojiData)) 4 | ); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/client/notifications/updateEmojiCustom.js: -------------------------------------------------------------------------------- 1 | /* globals updateEmojiCustom */ 2 | Meteor.startup(() => 3 | RocketChat.Notifications.onLogged('updateEmojiCustom', data => updateEmojiCustom(data.emojiData)) 4 | ); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-file-upload/ufs/AmazonS3/client.js: -------------------------------------------------------------------------------- 1 | import {UploadFS} from 'meteor/jalik:ufs'; 2 | 3 | export class AmazonS3Store extends UploadFS.Store {} 4 | 5 | // Add store to UFS namespace 6 | UploadFS.store.AmazonS3 = AmazonS3Store; 7 | -------------------------------------------------------------------------------- /packages/rocketchat-integrations/client/views/integrationsNew.js: -------------------------------------------------------------------------------- 1 | Template.integrationsNew.helpers({ 2 | hasPermission() { 3 | return RocketChat.authz.hasAtLeastOnePermission(['manage-integrations', 'manage-own-integrations']); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/server/startup.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return RocketChat.models.Permissions.upsert('access-mailer', { 3 | $setOnInsert: { 4 | _id: 'access-mailer', 5 | roles: ['admin'] 6 | } 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-archiveroom/messages.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Messages.createRoomArchivedByRoomIdAndUser = function(roomId, user) { 2 | return this.createWithTypeRoomIdMessageAndUser('room-archived', roomId, '', user); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/client/loading.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/home.js: -------------------------------------------------------------------------------- 1 | Template.home.helpers({ 2 | title() { 3 | return RocketChat.settings.get('Layout_Home_Title'); 4 | }, 5 | body() { 6 | return RocketChat.settings.get('Layout_Home_Body'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/server/functions/hasRole.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz.hasRole = function(userId, roleNames, scope) { 2 | roleNames = [].concat(roleNames); 3 | return RocketChat.models.Roles.isUserInRoles(userId, roleNames, scope); 4 | }; 5 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/server/models/RawImports.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | Importer.RawImports = new (Importer.RawImports = class RawImports extends RocketChat.models._Base { 3 | constructor() { 4 | super('raw_imports'); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/components/modal.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/lib/parentCall.js: -------------------------------------------------------------------------------- 1 | this.parentCall = (method, args = []) => { 2 | const data = { 3 | src: 'rocketchat', 4 | fn: method, 5 | args 6 | }; 7 | 8 | window.parent.postMessage(data, '*'); 9 | }; 10 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-unarchiveroom/messages.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Messages.createRoomUnarchivedByRoomIdAndUser = function(roomId, user) { 2 | return this.createWithTypeRoomIdMessageAndUser('room-unarchived', roomId, '', user); 3 | }; 4 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/roomSearch.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | -------------------------------------------------------------------------------- /private/node_scripts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "async": "^2.0.0-rc.3", 4 | "fs": "0.0.2", 5 | "google-translate": "^1.0.6", 6 | "recursive-readdir": "^2.0.0", 7 | "underscore": "^1.8.3" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/functions/checkEmailAvailability.js: -------------------------------------------------------------------------------- 1 | RocketChat.checkEmailAvailability = function(email) { 2 | return !Meteor.users.findOne({ 'emails.address': { $regex : new RegExp(`^${ s.trim(s.escapeRegExp(email)) }$`, 'i') } }); 3 | }; 4 | -------------------------------------------------------------------------------- /server/startup/migrations/v078.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 78, 3 | up() { 4 | RocketChat.models.Permissions.update({ _id: { $in: ['create-c', 'create-d', 'create-p'] }}, { $addToSet: { roles: 'bot' }}, { multi: true }); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/admin/startup.js: -------------------------------------------------------------------------------- 1 | RocketChat.AdminBox.addOption({ 2 | href: 'custom-sounds', 3 | i18nLabel: 'Custom_Sounds', 4 | permissionGranted() { 5 | return RocketChat.authz.hasAtLeastOnePermission(['manage-sounds']); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/admin/startup.js: -------------------------------------------------------------------------------- 1 | RocketChat.AdminBox.addOption({ 2 | href: 'emoji-custom', 3 | i18nLabel: 'Custom_Emoji', 4 | permissionGranted() { 5 | return RocketChat.authz.hasAtLeastOnePermission(['manage-emoji']); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-slackbridge/logger.js: -------------------------------------------------------------------------------- 1 | /* globals logger:true */ 2 | /* exported logger */ 3 | 4 | logger = new Logger('SlackBridge', { 5 | sections: { 6 | connection: 'Connection', 7 | events: 'Events', 8 | class: 'Class' 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v013.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 13, 3 | up() { 4 | // Set all current users as active 5 | RocketChat.models.Users.setAllUsersActive(true); 6 | return console.log('Set all users as active'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /.travis/namefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz"; 7 | 8 | ln -s /tmp/build/Rocket.Chat.tar.gz "$FILENAME" 9 | gpg --armor --detach-sign "$FILENAME" 10 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Issues 2 | 3 | Please report any security issues you discovered to security[at]rocket[dot]chat 4 | 5 | We will assess the risk, plus make a fix available before we create a GitHub issue. 6 | 7 | Thank you for your contribution. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/client/models/EmojiCustom.js: -------------------------------------------------------------------------------- 1 | class EmojiCustom extends RocketChat.models._Base { 2 | constructor() { 3 | super(); 4 | this._initModel('custom_emoji'); 5 | } 6 | } 7 | 8 | RocketChat.models.EmojiCustom = new EmojiCustom(); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-favico/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:favico', 3 | version: '0.0.1', 4 | summary: 'Favico.js for Rocket.Chat' 5 | }); 6 | 7 | Package.onUse(function(api) { 8 | api.addFiles('favico.js', 'client'); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-file-upload/ufs/GoogleStorage/client.js: -------------------------------------------------------------------------------- 1 | import {UploadFS} from 'meteor/jalik:ufs'; 2 | 3 | export class GoogleStorageStore extends UploadFS.Store {} 4 | 5 | // Add store to UFS namespace 6 | UploadFS.store.GoogleStorage = GoogleStorageStore; 7 | -------------------------------------------------------------------------------- /packages/rocketchat-integrations/server/logger.js: -------------------------------------------------------------------------------- 1 | /* globals logger:true */ 2 | /* exported logger */ 3 | 4 | logger = new Logger('Integrations', { 5 | sections: { 6 | incoming: 'Incoming WebHook', 7 | outgoing: 'Outgoing WebHook' 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/checkRegistrationSecretURL.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | checkRegistrationSecretURL(hash) { 3 | 4 | check(hash, String); 5 | 6 | return hash === RocketChat.settings.get('Accounts_RegistrationForm_SecretURL'); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/footer.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /.travis/setupsig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | cp .travis/sign.key.gpg /tmp 7 | gpg --yes --batch --passphrase=$mypass /tmp/sign.key.gpg 8 | gpg --allow-secret-key-import --import /tmp/sign.key 9 | rm /tmp/sign.key 10 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/client/models/CustomSounds.js: -------------------------------------------------------------------------------- 1 | class CustomSounds extends RocketChat.models._Base { 2 | constructor() { 3 | super(); 4 | this._initModel('custom_sounds'); 5 | } 6 | } 7 | 8 | RocketChat.models.CustomSounds = new CustomSounds(); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/admin/client/startup.js: -------------------------------------------------------------------------------- 1 | RocketChat.AdminBox.addOption({ 2 | href: 'admin-oauth-apps', 3 | i18nLabel: 'OAuth Apps', 4 | permissionGranted() { 5 | return RocketChat.authz.hasAllPermission('manage-oauth-apps'); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/username/layout.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupSlashCommand.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/burger.js: -------------------------------------------------------------------------------- 1 | Template.burger.helpers({ 2 | unread() { 3 | return Session.get('unread'); 4 | }, 5 | isMenuOpen() { 6 | if (Session.equals('isMenuOpen', true)) { 7 | return 'menu-opened'; 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v050.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 50, 3 | up() { 4 | RocketChat.models.Subscriptions.tryDropIndex('u._id_1_name_1_t_1'); 5 | RocketChat.models.Subscriptions.tryEnsureIndex({ 'u._id': 1, 'name': 1, 't': 1 }); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-chatops/client/views/stylesheets/chatops.css: -------------------------------------------------------------------------------- 1 | 2 | .map-container { 3 | width: 670px; 4 | max-width: 100%; 5 | height: 500px; 6 | padding: 5px; 7 | } 8 | 9 | .red { 10 | color: red; 11 | } 12 | 13 | .green { 14 | color: green; 15 | } 16 | -------------------------------------------------------------------------------- /packages/rocketchat-message-pin/server/startup/indexes.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return Meteor.defer(function() { 3 | return RocketChat.models.Messages.tryEnsureIndex({ 4 | 'pinnedBy._id': 1 5 | }, { 6 | sparse: 1 7 | }); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/server/startup/indexes.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return Meteor.defer(function() { 3 | return RocketChat.models.Messages.tryEnsureIndex({ 4 | 'starred._id': 1 5 | }, { 6 | sparse: 1 7 | }); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-statistics/server/functions/save.js: -------------------------------------------------------------------------------- 1 | RocketChat.statistics.save = function() { 2 | const statistics = RocketChat.statistics.get(); 3 | statistics.createdAt = new Date; 4 | RocketChat.models.Statistics.insert(statistics); 5 | return statistics; 6 | }; 7 | -------------------------------------------------------------------------------- /client/routes/roomRoute.js: -------------------------------------------------------------------------------- 1 | FlowRouter.goToRoomById = (roomId) => { 2 | const subscription = ChatSubscription.findOne({rid: roomId}); 3 | if (subscription) { 4 | RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams); 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/default/metrics.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.default.addRoute('metrics', { authRequired: false }, { 2 | get() { 3 | return { 4 | headers: { 'Content-Type': 'text/plain' }, 5 | body: RocketChat.promclient.register.metrics() 6 | }; 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-integrations/client/startup.js: -------------------------------------------------------------------------------- 1 | RocketChat.AdminBox.addOption({ 2 | href: 'admin-integrations', 3 | i18nLabel: 'Integrations', 4 | permissionGranted: () => RocketChat.authz.hasAtLeastOnePermission(['manage-integrations', 'manage-own-integrations']) 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/server/functions/unsubscribe.js: -------------------------------------------------------------------------------- 1 | /* globals Mailer */ 2 | Mailer.unsubscribe = function(_id, createdAt) { 3 | if (_id && createdAt) { 4 | return RocketChat.models.Users.rocketMailUnsubscribe(_id, createdAt) === 1; 5 | } 6 | return false; 7 | }; 8 | -------------------------------------------------------------------------------- /server/startup/migrations/v061.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 61, 3 | up() { 4 | RocketChat.models.Users.find({ active: false }).forEach(function(user) { 5 | RocketChat.models.Subscriptions.setArchivedByUsername(user.username, true); 6 | }); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/views/loading.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/main.css: -------------------------------------------------------------------------------- 1 | @import 'imports/reset.css'; 2 | @import 'imports/variables.css'; 3 | @import 'imports/properties.css'; 4 | @import 'imports/keyframes.css'; 5 | @import 'imports/forms.css'; 6 | @import 'imports/base.css'; 7 | @import 'imports/rtl.css'; 8 | 9 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-vrecord/server/settings.js: -------------------------------------------------------------------------------- 1 | RocketChat.settings.addGroup('Message', function() { 2 | this.add('Message_VideoRecorderEnabled', true, { 3 | type: 'boolean', 4 | public: true, 5 | i18nDescription: 'Message_VideoRecorderEnabledDescription' 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/404/invalidSecretURL.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/rocketchat-wordpress/client/wordpress-login-button.css: -------------------------------------------------------------------------------- 1 | #login-buttons-image-wordpress { 2 | background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiP…A3LDI3LjUsMjUuOTQsMjMuMjE1LDI4LjQzNHoiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==); 3 | } 4 | -------------------------------------------------------------------------------- /server/startup/migrations/v026.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 26, 3 | up() { 4 | return RocketChat.models.Messages.update({ 5 | t: 'rm' 6 | }, { 7 | $set: { 8 | mentions: [] 9 | } 10 | }, { 11 | multi: true 12 | }); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /.snapcraft/resources/rcbackup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf $SNAP_DATA/dump 3 | rm $SNAP_DATA/backup.tgz 4 | mkdir $SNAP_DATA/dump 5 | mongodump -d parties -o $SNAP_DATA/dump 6 | tar zcvf $SNAP_DATA/backup.tgz $SNAP_DATA/dump 7 | echo "A backup of your data can be found at $SNAP_DATA/backup.tgz" 8 | -------------------------------------------------------------------------------- /packages/rocketchat-autotranslate/README.md: -------------------------------------------------------------------------------- 1 | # Rocket.Chat Auto Translate 2 | 3 | Rocket.Chat supports auto translate through Google Cloud Translation API 4 | Through this you will be able to read messages in your native languages 5 | regardless of language the message was written on. 6 | -------------------------------------------------------------------------------- /packages/rocketchat-katex/client/style.css: -------------------------------------------------------------------------------- 1 | .katex-inline-error { 2 | display: inline-block; 3 | margin: 0 5px; 4 | } 5 | 6 | .katex-error { 7 | border: 1px solid red; 8 | padding: 2px 8px; 9 | text-align: center; 10 | font-style: italic; 11 | font-weight: bold; 12 | } 13 | -------------------------------------------------------------------------------- /server/methods/loadLocale.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | loadLocale(locale) { 3 | check(locale, String); 4 | 5 | try { 6 | return Assets.getText(`moment-locales/${ locale.toLowerCase() }.js`); 7 | } catch (error) { 8 | return console.log(error); 9 | } 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/views/poweredBy.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-csv/.npm/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "csv-parse": { 4 | "version": "1.1.7", 5 | "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-1.1.7.tgz", 6 | "from": "csv-parse@1.1.7" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/models/indexes.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.models.Rooms.tryEnsureIndex({ code: 1 }); 3 | RocketChat.models.Rooms.tryEnsureIndex({ open: 1 }, { sparse: 1 }); 4 | RocketChat.models.Users.tryEnsureIndex({ 'visitorEmails.address': 1 }); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/userSearch.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/cmsPage.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v043.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 43, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Permissions) { 5 | RocketChat.models.Permissions.update({ _id: 'pin-message' }, { $addToSet: { roles: 'admin' } }); 6 | } 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v096.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 96, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Settings) { 5 | RocketChat.models.Settings.update({ _id: 'InternalHubot_ScriptsToLoad' }, { $set: { value: '' } }); 6 | } 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /client/methods/openRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | openRoom(rid) { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | 7 | ChatSubscription.update({ 8 | rid, 9 | 'u._id': Meteor.userId() 10 | }, { 11 | $set: { 12 | open: true 13 | } 14 | }); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/client/startup.js: -------------------------------------------------------------------------------- 1 | Meteor.subscribe('roles'); 2 | 3 | RocketChat.AdminBox.addOption({ 4 | href: 'admin-permissions', 5 | i18nLabel: 'Permissions', 6 | permissionGranted() { 7 | return RocketChat.authz.hasAllPermission('access-permissions'); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-autolinker/.npm/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "autolinker": { 4 | "version": "1.4.0", 5 | "resolved": "https://registry.npmjs.org/autolinker/-/autolinker-1.4.0.tgz", 6 | "from": "autolinker@1.4.0" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /server/startup/migrations/v023.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 23, 3 | up() { 4 | RocketChat.models.Settings.remove({ 5 | _id: 'Accounts_denyUnverifiedEmails' 6 | }); 7 | 8 | return console.log('Deleting not used setting Accounts_denyUnverifiedEmails'); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v046.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 46, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Users) { 5 | RocketChat.models.Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true }); 6 | } 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v098.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 98, 3 | up() { 4 | RocketChat.models.OAuthApps.update({ _id: 'zapier' }, { 5 | $set: { 6 | redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/RocketChatDevAPI/' 7 | } 8 | }); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /.sandstorm/description.md: -------------------------------------------------------------------------------- 1 | The Complete Open Source Chat Solution. Rocket.Chat is a Web Chat Server, developed in JavaScript. It is a great solution for communities and companies wanting to privately host their own chat service or for developers looking forward to build and evolve their own chat platforms. 2 | -------------------------------------------------------------------------------- /client/methods/toggleFavorite.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | toggleFavorite(rid, f) { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | 7 | ChatSubscription.update({ 8 | rid, 9 | 'u._id': Meteor.userId() 10 | }, { 11 | $set: { 12 | f 13 | } 14 | }); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/admin/emojiPreview.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /packages/rocketchat-mentions-flextab/client/views/stylesheets/mentionsFlexTab.less: -------------------------------------------------------------------------------- 1 | .mentioned-messages-list { 2 | .message-cog-container { 3 | .message-action { 4 | display: none !important; 5 | 6 | &.jump-to-message { 7 | display: block !important; 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/rocketchat-otr/server/methods/updateOTRAck.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | updateOTRAck(_id, ack) { 3 | if (!Meteor.userId()) { 4 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'updateOTRAck' }); 5 | } 6 | RocketChat.models.Messages.updateOTRAck(_id, ack); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v032.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 32, 3 | up() { 4 | return RocketChat.models.Settings.update({ 5 | _id: /Accounts_OAuth_Custom_/ 6 | }, { 7 | $set: { 8 | group: 'OAuth' 9 | } 10 | }, { 11 | multi: true 12 | }); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings-mail-messages/server/lib/startup.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | const permission = { 3 | _id: 'mail-messages', 4 | roles: ['admin'] 5 | }; 6 | return RocketChat.models.Permissions.upsert(permission._id, { 7 | $setOnInsert: permission 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/client/lib/Layout.js: -------------------------------------------------------------------------------- 1 | RocketChat.Layout = new (class RocketChatLayout { 2 | constructor() { 3 | Tracker.autorun(() => { 4 | this.layout = FlowRouter.getQueryParam('layout'); 5 | }); 6 | } 7 | 8 | isEmbedded() { 9 | return this.layout === 'embedded'; 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/routes/router.js: -------------------------------------------------------------------------------- 1 | BlazeLayout.setRoot('body'); 2 | 3 | FlowRouter.route('/livechat', { 4 | name: 'index', 5 | triggersEnter: [ 6 | () => visitor.register() 7 | ], 8 | action() { 9 | BlazeLayout.render('main', { center: 'livechatWindow' }); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-mentions-flextab/client/tabBar.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return RocketChat.TabBar.addButton({ 3 | groups: ['channel', 'group'], 4 | id: 'mentions', 5 | i18nTitle: 'Mentions', 6 | icon: 'icon-at', 7 | template: 'mentionsFlexTab', 8 | order: 3 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /server/publications/activeUsers.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('activeUsers', function() { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | return RocketChat.models.Users.findUsersNotOffline({ 7 | fields: { 8 | username: 1, 9 | status: 1, 10 | utcOffset: 1 11 | } 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-crowd/.npm/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "atlassian-crowd": { 4 | "version": "0.5.0", 5 | "resolved": "https://registry.npmjs.org/atlassian-crowd/-/atlassian-crowd-0.5.0.tgz", 6 | "from": "atlassian-crowd@0.5.0" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/rocketchat-videobridge/client/stylesheets/video.less: -------------------------------------------------------------------------------- 1 | .flex-tab { 2 | .video-chat { 3 | ul { 4 | li { 5 | margin-bottom: 20px; 6 | } 7 | } 8 | } 9 | } 10 | 11 | .video-chat { 12 | .main-video { 13 | iframe { 14 | width: 100%; 15 | min-height: 299px; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /server/startup/migrations/v075.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 71.1, 3 | up() { 4 | ServiceConfiguration.configurations.remove({}); 5 | } 6 | }); 7 | 8 | RocketChat.Migrations.add({ 9 | version: 75, 10 | up() { 11 | ServiceConfiguration.configurations.remove({}); 12 | } 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /server/startup/migrations/v081.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 81, 3 | up() { 4 | RocketChat.models.OAuthApps.update({ _id: 'zapier' }, { 5 | $set: { 6 | active: true, 7 | redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/App32270API/' 8 | } 9 | }); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /client/methods/hideRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | hideRoom(rid) { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | 7 | ChatSubscription.update({ 8 | rid, 9 | 'u._id': Meteor.userId() 10 | }, { 11 | $set: { 12 | alert: false, 13 | open: false 14 | } 15 | }); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/functions/archiveRoom.js: -------------------------------------------------------------------------------- 1 | RocketChat.archiveRoom = function(rid) { 2 | RocketChat.models.Rooms.archiveById(rid); 3 | RocketChat.models.Subscriptions.archiveByRoomId(rid); 4 | 5 | RocketChat.callbacks.run('afterRoomArchived', RocketChat.models.Rooms.findOneById(rid), Meteor.user()); 6 | }; 7 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/layout.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/secretURL.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /server/startup/migrations/xrun.js: -------------------------------------------------------------------------------- 1 | if (RocketChat.Migrations.getVersion() !== 0) { 2 | RocketChat.Migrations.migrateTo('latest'); 3 | } else { 4 | const control = RocketChat.Migrations._getControl(); 5 | control.version = _.last(RocketChat.Migrations._list).version; 6 | RocketChat.Migrations._setControl(control); 7 | } 8 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-csv/main.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | 3 | Importer.addImporter('csv', Importer.CSV, { 4 | name: 'CSV', 5 | warnings: [{ 6 | text: 'Importer_CSV_Information', 7 | href: 'https://rocket.chat/docs/administrator-guides/import/csv/' 8 | }], 9 | mimeType: 'application/zip' 10 | }); 11 | -------------------------------------------------------------------------------- /server/restapi/README.md: -------------------------------------------------------------------------------- 1 | # Important Information 2 | 3 | The REST API has moved to `/api/v1/${endpoint}`, please see the [Rocket.Chat Documentation](https://rocket.chat/docs/developer-guides/rest-api) for details on the current REST API. If a feature is currently missing, feel free to open a new pull request to add it. :heart: 4 | -------------------------------------------------------------------------------- /example-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "galaxy.meteor.com": { 3 | "env": { 4 | "MONGO_URL": "mongodb://:@:/", 5 | "MONGO_OPLOG_URL": "mongodb://:@:/?authSource=admin" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/rocketchat-autotranslate/server/permissions.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => { 2 | if (RocketChat.models && RocketChat.models.Permissions) { 3 | if (!RocketChat.models.Permissions.findOne({ _id: 'auto-translate' })) { 4 | RocketChat.models.Permissions.insert({ _id: 'auto-translate', roles: ['admin'] }); 5 | } 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/lib/metrics.js: -------------------------------------------------------------------------------- 1 | const client = require('prom-client'); 2 | 3 | RocketChat.promclient = client; 4 | 5 | RocketChat.metrics = {}; 6 | 7 | // one sample metrics only - a counter 8 | 9 | RocketChat.metrics.messagesSent = new client.Counter('messages_sent', 'cumulated number of messages sent'); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/getFullUserData.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | getFullUserData({ filter = '', limit }) { 3 | const result = RocketChat.getFullUserData({ userId: Meteor.userId(), filter, limit }); 4 | 5 | if (!result) { 6 | return result; 7 | } 8 | 9 | return result.fetch(); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /server/startup/migrations/v022.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 22, 3 | up() { 4 | /* 5 | * Update message edit field 6 | */ 7 | RocketChat.models.Messages.upgradeEtsToEditAt(); 8 | 9 | return console.log('Updated old messages\' ets edited timestamp to new editedAt timestamp.'); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /server/startup/migrations/v082.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 82, 3 | up() { 4 | const admins = RocketChat.authz.getUsersInRole('admin').fetch(); 5 | if (admins.length === 1 && admins[0]._id === 'rocket.cat') { 6 | RocketChat.authz.removeUserFromRoles('rocket.cat', 'admin'); 7 | } 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /example-ecosystem.json: -------------------------------------------------------------------------------- 1 | { 2 | "deploy": { 3 | "production": { 4 | "user": "root", 5 | "host": ["rocket.chat"], 6 | "ref": "origin/master", 7 | "repo": "https://github.com/RocketChat/Rocket.Chat.git", 8 | "path": "/var/www/rocket.chat", 9 | "post-deploy": "source build.sh production" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/client/tabBar.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | return RocketChat.TabBar.addButton({ 3 | groups: ['channel', 'group', 'direct'], 4 | id: 'starred-messages', 5 | i18nTitle: 'Starred_Messages', 6 | icon: 'icon-star', 7 | template: 'starredMessages', 8 | order: 3 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-kick/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('kick', function(command, params) { 2 | const username = params.trim(); 3 | if (username === '') { 4 | return; 5 | } 6 | return username.replace('@', ''); 7 | }, { 8 | description: 'Remove_someone_from_room', 9 | params: '@username' 10 | }); 11 | -------------------------------------------------------------------------------- /.sandstorm/README.md: -------------------------------------------------------------------------------- 1 | # Publish commands 2 | 3 | ``` 4 | cd Rocket.Chat 5 | vagrant-spk vm up && vagrant-spk dev 6 | ^C 7 | vagrant-spk pack ../rocketchat.spk && vagrant-spk publish ../rocketchat.spk && vagrant-spk vm halt 8 | ``` 9 | 10 | # Reset commands 11 | 12 | ``` 13 | vagrant-spk vm halt && vagrant-spk vm destroy 14 | ``` 15 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/client/lib/ChatPermissions.js: -------------------------------------------------------------------------------- 1 | RocketChat.authz.cachedCollection = new RocketChat.CachedCollection({ 2 | name: 'permissions', 3 | eventType: 'onLogged', 4 | userRelated: false 5 | }); 6 | RocketChat.authz.cachedCollection.init(); 7 | 8 | this.ChatPermissions = RocketChat.authz.cachedCollection.collection; 9 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji/rocketchat.js: -------------------------------------------------------------------------------- 1 | RocketChat.emoji = { 2 | packages: { 3 | base: { 4 | emojiCategories: { recent: TAPi18n.__('Frequently_Used') }, 5 | emojisByCategory: { 6 | recent: [] 7 | }, 8 | toneList: {}, 9 | render(html) { 10 | return html; 11 | } 12 | } 13 | }, 14 | list: {} 15 | }; 16 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/client/imports/variables.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --header-min-height: 60px; 3 | --toolbar-height: 55px; 4 | --footer-min-height: 70px; 5 | --rooms-box-width: 260px; 6 | --flex-tab-width: 400px; 7 | --flex-tab-webrtc-width: 400px; 8 | --flex-tab-webrtc-2-width: 850px; 9 | --user-image-square: 20px; 10 | } 11 | -------------------------------------------------------------------------------- /packages/rocketchat-emoji-custom/admin/route.js: -------------------------------------------------------------------------------- 1 | FlowRouter.route('/admin/emoji-custom', { 2 | name: 'emoji-custom', 3 | subscriptions(/*params, queryParams*/) { 4 | this.register('EmojiCustom', Meteor.subscribe('EmojiCustom')); 5 | }, 6 | action(/*params*/) { 7 | BlazeLayout.render('main', {center: 'adminEmoji'}); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-push-notifications/client/tabBar.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.TabBar.addButton({ 3 | groups: ['channel', 'group', 'direct'], 4 | id: 'push-notifications', 5 | i18nTitle: 'Notifications', 6 | icon: 'icon-bell-alt', 7 | template: 'pushNotificationsFlexTab', 8 | order: 2 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-inviteall/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('invite-all-to', undefined, { 2 | description: 'Invite_user_to_join_channel_all_to', 3 | params: '#room' 4 | }); 5 | RocketChat.slashCommands.add('invite-all-from', undefined, { 6 | description: 'Invite_user_to_join_channel_all_from', 7 | params: '#room' 8 | }); 9 | -------------------------------------------------------------------------------- /server/startup/migrations/v058.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 58, 3 | up() { 4 | RocketChat.models.Settings.update({ _id: 'Push_gateway', value: 'https://rocket.chat' }, { 5 | $set: { 6 | value: 'https://gateway.rocket.chat', 7 | packageValue: 'https://gateway.rocket.chat' 8 | } 9 | }); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /tests/pageobjects/Page.js: -------------------------------------------------------------------------------- 1 | class Page { 2 | get body() { return browser.element('body'); } 3 | 4 | open(path) { 5 | browser.windowHandleSize({ 6 | width: 1280, 7 | height: 800 8 | }); 9 | 10 | browser.url(`http://localhost:3000/${ path }`); 11 | 12 | this.body.waitForExist(); 13 | } 14 | } 15 | module.exports = Page; 16 | -------------------------------------------------------------------------------- /packages/rocketchat-chatops/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.addGroup('Chatops'); 3 | RocketChat.settings.add('Chatops_Enabled', false, { type: 'boolean', group: 'Chatops', public: true }); 4 | return RocketChat.settings.add('Chatops_Username', false, { type: 'string', group: 'Chatops', public: true }); 5 | }); 6 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-sounds/admin/route.js: -------------------------------------------------------------------------------- 1 | FlowRouter.route('/admin/custom-sounds', { 2 | name: 'custom-sounds', 3 | subscriptions(/*params, queryParams*/) { 4 | this.register('customSounds', Meteor.subscribe('customSounds')); 5 | }, 6 | action(/*params*/) { 7 | BlazeLayout.render('main', {center: 'adminSounds'}); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/lib/accounts.js: -------------------------------------------------------------------------------- 1 | import toastr from 'toastr'; 2 | Accounts.onEmailVerificationLink(function(token, done) { 3 | Accounts.verifyEmail(token, function(error) { 4 | if (error == null) { 5 | toastr.success(t('Email_verified')); 6 | Meteor.call('afterVerifyEmail'); 7 | } 8 | return done(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/burger.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /tests/data/user.js: -------------------------------------------------------------------------------- 1 | export const username = `user.test.${ Date.now() }`; 2 | export const email = `${ username }@rocket.chat`; 3 | export const password = 'rocket.chat'; 4 | 5 | export const adminUsername = 'rocketchat.internal.admin.test'; 6 | export const adminEmail = `${ adminUsername }@rocket.chat`; 7 | export const adminPassword = adminUsername; 8 | -------------------------------------------------------------------------------- /.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1d10m9yd7fq1hsv663c 8 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/client/requiresPermission.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /packages/rocketchat-cors/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:cors', 3 | version: '0.0.1', 4 | summary: 'Enable CORS', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'webapp' 12 | ]); 13 | 14 | api.addFiles('cors.js', 'server'); 15 | api.addFiles('common.js'); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-login/client/login/header.js: -------------------------------------------------------------------------------- 1 | Template.loginHeader.helpers({ 2 | logoUrl() { 3 | const asset = RocketChat.settings.get('Assets_logo'); 4 | const prefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || ''; 5 | if (asset != null) { 6 | return `${ prefix }/${ asset.url || asset.defaultUrl }`; 7 | } 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /server/startup/migrations/v025.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 25, 3 | up() { 4 | return RocketChat.models.Settings.update({ 5 | _id: /Accounts_OAuth_Custom/ 6 | }, { 7 | $set: { 8 | persistent: true 9 | }, 10 | $unset: { 11 | hidden: true 12 | } 13 | }, { 14 | multi: true 15 | }); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /.snapcraft/resources/initreplset.js: -------------------------------------------------------------------------------- 1 | var ism = db.isMaster(); 2 | if (!ism.ismaster) { 3 | rs.initiate( 4 | { 5 | _id: 'rs0', 6 | members: [ 7 | { 8 | _id: 0, 9 | host: 'localhost:27017' 10 | } 11 | ] 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /client/methods/leaveRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | leaveRoom(rid) { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | 7 | ChatSubscription.remove({ 8 | rid, 9 | 'u._id': Meteor.userId() 10 | }); 11 | 12 | ChatRoom.update(rid, { 13 | $pull: { 14 | usernames: Meteor.user().username 15 | } 16 | }); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/client/startup/tabBar.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => { 2 | RocketChat.TabBar.addButton({ 3 | groups: ['channel', 'group', 'direct'], 4 | id: 'channel-settings', 5 | anonymous: true, 6 | i18nTitle: 'Room_Info', 7 | icon: 'icon-info-circled', 8 | template: 'channelSettings', 9 | order: 0 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-reactions/server/models/Messages.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Messages.setReactions = function(messageId, reactions) { 2 | return this.update({ _id: messageId }, { $set: { reactions }}); 3 | }; 4 | 5 | RocketChat.models.Messages.unsetReactions = function(messageId) { 6 | return this.update({ _id: messageId }, { $unset: { reactions: 1 }}); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-account/client/account.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v067.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 67, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.LivechatDepartment) { 5 | RocketChat.models.LivechatDepartment.model.update({}, { 6 | $set: { 7 | showOnRegistration: true 8 | } 9 | }, { multi: true }); 10 | } 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /.scripts/version.js: -------------------------------------------------------------------------------- 1 | /* eslint object-shorthand: 0, prefer-template: 0 */ 2 | 3 | const path = require('path'); 4 | var pkgJson = {}; 5 | 6 | try { 7 | pkgJson = require(path.resolve( 8 | process.cwd(), 9 | './package.json' 10 | )); 11 | } catch (err) { 12 | console.error('no root package.json found'); 13 | } 14 | 15 | console.log(pkgJson.version); 16 | -------------------------------------------------------------------------------- /client/startup/roomObserve.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | ChatRoom.find().observe({ 3 | added(data) { 4 | Session.set(`roomData${ data._id }`, data); 5 | }, 6 | changed(data) { 7 | Session.set(`roomData${ data._id }`, data); 8 | }, 9 | removed(data) { 10 | Session.set(`roomData${ data._id }`, undefined); 11 | } 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /server/methods/getTotalChannels.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | getTotalChannels() { 3 | if (!Meteor.userId()) { 4 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { 5 | method: 'getTotalChannels' 6 | }); 7 | } 8 | 9 | const query = { 10 | t: 'c' 11 | }; 12 | return RocketChat.models.Rooms.find(query).count(); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /server/methods/hideRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | hideRoom(rid) { 3 | check(rid, String); 4 | 5 | if (!Meteor.userId()) { 6 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { 7 | method: 'hideRoom' 8 | }); 9 | } 10 | 11 | return RocketChat.models.Subscriptions.hideByRoomIdAndUserId(rid, Meteor.userId()); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /server/methods/openRoom.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | openRoom(rid) { 3 | check(rid, String); 4 | 5 | if (!Meteor.userId()) { 6 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { 7 | method: 'openRoom' 8 | }); 9 | } 10 | 11 | return RocketChat.models.Subscriptions.openByRoomIdAndUserId(rid, Meteor.userId()); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /server/startup/migrations/v076.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 76, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Settings) { 5 | RocketChat.models.Settings.find({section: 'Colors (alphas)'}).forEach((setting) => { 6 | RocketChat.models.Settings.remove({ _id: setting._id }); 7 | }); 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/server/functions/saveRoomReadOnly.js: -------------------------------------------------------------------------------- 1 | RocketChat.saveRoomReadOnly = function(rid, readOnly) { 2 | if (!Match.test(rid, String)) { 3 | throw new Meteor.Error('invalid-room', 'Invalid room', { 4 | 'function': 'RocketChat.saveRoomReadOnly' 5 | }); 6 | } 7 | return RocketChat.models.Rooms.setReadOnlyById(rid, readOnly); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/server/methods/unsubscribe.js: -------------------------------------------------------------------------------- 1 | /*globals Mailer */ 2 | Meteor.methods({ 3 | 'Mailer:unsubscribe'(_id, createdAt) { 4 | return Mailer.unsubscribe(_id, createdAt); 5 | } 6 | }); 7 | 8 | DDPRateLimiter.addRule({ 9 | type: 'method', 10 | name: 'Mailer:unsubscribe', 11 | connectionId() { 12 | return true; 13 | } 14 | }, 1, 60000); 15 | -------------------------------------------------------------------------------- /.github/templates/template.hbs: -------------------------------------------------------------------------------- 1 | {{> header}} 2 | 3 | {{#each commitGroups}} 4 | 5 | {{#if collapse}} 6 |
7 | {{title}} 8 | {{else}} 9 | ### {{title}} 10 | {{/if}} 11 | 12 | {{#each commits}} 13 | {{> commit root=@root}} 14 | {{/each}} 15 | {{#if collapse}} 16 |
17 | {{/if}} 18 | 19 | {{/each}} 20 | {{> footer}} 21 | 22 | 23 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/client/oembedAudioWidget.js: -------------------------------------------------------------------------------- 1 | Template.oembedAudioWidget.helpers({ 2 | collapsed() { 3 | if (this.collapsed) { 4 | return this.collapsed; 5 | } else { 6 | const user = Meteor.user(); 7 | return user && user.settings && user.settings.preferences && user.settings.preferences.collapseMediaByDefault === true; 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/client/oembedFrameWidget.js: -------------------------------------------------------------------------------- 1 | Template.oembedFrameWidget.helpers({ 2 | collapsed() { 3 | if (this.collapsed) { 4 | return this.collapsed; 5 | } else { 6 | const user = Meteor.user(); 7 | return user && user.settings && user.settings.preferences && user.settings.preferences.collapseMediaByDefault === true; 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-admin/client/users/adminUserInfo.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /server/publications/fullUserData.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('fullUserData', function(filter, limit) { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | const result = RocketChat.getFullUserData({ 7 | userId: this.userId, 8 | filter, 9 | limit 10 | }); 11 | 12 | if (!result) { 13 | return this.ready(); 14 | } 15 | 16 | return result; 17 | }); 18 | -------------------------------------------------------------------------------- /server/startup/migrations/v011.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 11, 3 | up() { 4 | /* 5 | * Set GENERAL room to be default 6 | */ 7 | RocketChat.models.Rooms.update({ 8 | _id: 'GENERAL' 9 | }, { 10 | $set: { 11 | 'default': true 12 | } 13 | }); 14 | 15 | return console.log('Set GENERAL room to be default'); 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /server/startup/migrations/v064.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 64, 3 | up() { 4 | RocketChat.models.Messages.find({ 't': 'room_changed_topic', 'msg': / 2 |
3 | 6 | 9 |
10 | 11 | -------------------------------------------------------------------------------- /server/methods/readMessages.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | readMessages(rid) { 3 | check(rid, String); 4 | 5 | if (!Meteor.userId()) { 6 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { 7 | method: 'readMessages' 8 | }); 9 | } 10 | 11 | return RocketChat.models.Subscriptions.setAsReadByRoomIdAndUserId(rid, Meteor.userId()); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-colors/style.css: -------------------------------------------------------------------------------- 1 | .message-color { 2 | display: inline-block; 3 | font-weight: 100; 4 | } 5 | 6 | .message-color-sample { 7 | width: 14px; 8 | height: 14px; 9 | display: inline-block; 10 | border-radius: 3px; 11 | margin-right: 3px; 12 | margin-left: 2px; 13 | border: 1px solid rgba(0, 0, 0, 0.2); 14 | position: relative; 15 | top: 2px; 16 | } 17 | -------------------------------------------------------------------------------- /packages/rocketchat-custom-oauth/README.md: -------------------------------------------------------------------------------- 1 | # Custom OAuth 2 | 3 | An implementation of the OAuth2 flow. It works with your own private OAuth2 server instance. 4 | 5 | This software is supplied courtesy of the [Rocket.Chat](https://rocket.chat/) open source communications platform. 6 | 7 | See the [project page](https://www.meteor.com/accounts) on Meteor Accounts for more details. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/insertOrUpdateUser.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | insertOrUpdateUser(userData) { 3 | 4 | check(userData, Object); 5 | 6 | if (!Meteor.userId()) { 7 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'insertOrUpdateUser' }); 8 | } 9 | 10 | return RocketChat.saveUser(Meteor.userId(), userData); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/publications/livechatOfficeHours.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('livechat:officeHour', function() { 2 | if (!RocketChat.authz.hasPermission(this.userId, 'view-l-room')) { 3 | return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:agents' })); 4 | } 5 | 6 | return RocketChat.models.LivechatOfficeHour.find(); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/rocketchat-message-pin/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.add('Message_AllowPinning', true, { 3 | type: 'boolean', 4 | group: 'Message', 5 | 'public': true 6 | }); 7 | return RocketChat.models.Permissions.upsert('pin-message', { 8 | $setOnInsert: { 9 | roles: ['owner', 'moderator', 'admin'] 10 | } 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/server/models/OAuthApps.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.OAuthApps = new class extends RocketChat.models._Base { 2 | constructor() { 3 | super('oauth_apps'); 4 | } 5 | }; 6 | 7 | 8 | 9 | 10 | // FIND 11 | // findByRole: (role, options) -> 12 | // query = 13 | // roles: role 14 | 15 | // return @find query, options 16 | 17 | // CREATE 18 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings-mail-messages/client/stylesheets/mail-messages.less: -------------------------------------------------------------------------------- 1 | .flex-tab { 2 | .mail-message { 3 | form { 4 | margin-top: 20px; 5 | 6 | .input-line.double-col { 7 | margin-bottom: 20px; 8 | 9 | label { 10 | line-height: 15px; 11 | } 12 | 13 | div { 14 | line-height: 15px; 15 | } 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 90q00kzhqkdn1l0ptwl 8 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-leave/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-leave', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will translate /leave commands', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib' 12 | ]); 13 | api.addFiles('leave.js'); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-admin/client/users/adminUserChannels.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/client/error.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /packages/rocketchat-authorization/server/models/Users.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Users.roleBaseQuery = function(userId) { 2 | return { _id: userId }; 3 | }; 4 | 5 | RocketChat.models.Users.findUsersInRoles = function(roles, scope, options) { 6 | roles = [].concat(roles); 7 | 8 | const query = { 9 | roles: { $in: roles } 10 | }; 11 | 12 | return this.find(query, options); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/rocketchat-autotranslate/server/methods/translateMessage.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'autoTranslate.translateMessage'(message, targetLanguage) { 3 | const room = RocketChat.models.Rooms.findOneById(message && message.rid); 4 | if (message && room && RocketChat.AutoTranslate) { 5 | return RocketChat.AutoTranslate.translateMessage(message, room, targetLanguage); 6 | } 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/server/functions/saveReactWhenReadOnly.js: -------------------------------------------------------------------------------- 1 | RocketChat.saveReactWhenReadOnly = function(rid, allowReact) { 2 | if (!Match.test(rid, String)) { 3 | throw new Meteor.Error('invalid-room', 'Invalid room', { function: 'RocketChat.saveReactWhenReadOnly' }); 4 | } 5 | 6 | return RocketChat.models.Rooms.setAllowReactingWhenReadOnlyById(rid, allowReact); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/roomSearch.js: -------------------------------------------------------------------------------- 1 | Template.roomSearch.helpers({ 2 | roomIcon() { 3 | if (this.type === 'u') { 4 | return 'icon-at'; 5 | } 6 | if (this.type === 'r') { 7 | return RocketChat.roomTypes.getIcon(this.t); 8 | } 9 | }, 10 | userStatus() { 11 | if (this.type === 'u') { 12 | return `status-${ this.status }`; 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /server/methods/deleteFileMessage.js: -------------------------------------------------------------------------------- 1 | /* global FileUpload */ 2 | Meteor.methods({ 3 | deleteFileMessage(fileID) { 4 | check(fileID, String); 5 | 6 | const msg = RocketChat.models.Messages.getMessageByFileId(fileID); 7 | 8 | if (msg) { 9 | return Meteor.call('deleteMessage', msg); 10 | } 11 | 12 | return FileUpload.getStore('Uploads').deleteById(fileID); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings-mail-messages/client/views/channelSettingsMailMessages.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/lib/importTool.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | Importer.Importers = {}; 3 | 4 | Importer.addImporter = function(name, importer, options) { 5 | if (Importer.Importers[name] == null) { 6 | return Importer.Importers[name] = { 7 | name: options.name, 8 | importer, 9 | mimeType: options.mimeType, 10 | warnings: options.warnings 11 | }; 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /packages/rocketchat-slackbridge/slashcommand/slackbridge_import.client.js: -------------------------------------------------------------------------------- 1 | RocketChat.settings.onload('SlackBridge_Enabled', (key, value) => { 2 | if (value) { 3 | RocketChat.slashCommands.add('slackbridge-import', null, { 4 | description: 'Import_old_messages_from_slackbridge' 5 | }); 6 | } else { 7 | delete RocketChat.slashCommands.commands['slackbridge-import']; 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/client/logoLayout.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupConfig.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /public/images/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #04436a 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/server/functions/saveRoomSystemMessages.js: -------------------------------------------------------------------------------- 1 | RocketChat.saveRoomSystemMessages = function(rid, systemMessages) { 2 | if (!Match.test(rid, String)) { 3 | throw new Meteor.Error('invalid-room', 'Invalid room', { 4 | 'function': 'RocketChat.saveRoomSystemMessages' 5 | }); 6 | } 7 | return RocketChat.models.Rooms.setSystemMessagesById(rid, systemMessages); 8 | }; 9 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/addAgent.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:addAgent'(username) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:addAgent' }); 5 | } 6 | 7 | return RocketChat.Livechat.addAgent(username); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-message-snippet/server/startup/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.add('Message_AllowSnippeting', false, { 3 | type: 'boolean', 4 | public: true, 5 | group: 'Message' 6 | }); 7 | RocketChat.models.Permissions.upsert('snippet-message', { 8 | $setOnInsert: { 9 | roles: ['owner', 'moderator', 'admin'] 10 | } 11 | }); 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-me/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-me', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will translate /me commands', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib' 12 | ]); 13 | 14 | api.addFiles('me.js', ['server', 'client']); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-message/client/popup/messagePopupUser.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /public/images/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rocket.Chat", 3 | "icons": [ 4 | { 5 | "src": "assets\/favicon_192.png", 6 | "sizes": "192x192", 7 | "type": "image\/png" 8 | }, 9 | { 10 | "src": "assets\/favicon_512.png", 11 | "sizes": "512x512", 12 | "type": "image\/png" 13 | } 14 | ], 15 | "start_url": "https:\/\/rocket.chat\/home", 16 | "display": "standalone" 17 | } 18 | -------------------------------------------------------------------------------- /server/publications/privateHistory.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('privateHistory', function() { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | return RocketChat.models.Rooms.findByContainingUsername(RocketChat.models.Users.findOneById(this.userId).username, { 7 | fields: { 8 | t: 1, 9 | name: 1, 10 | msgs: 1, 11 | ts: 1, 12 | lm: 1, 13 | cl: 1 14 | } 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /server/startup/migrations/v034.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 34, 3 | up() { 4 | return RocketChat.models.Settings.update({ 5 | _id: 'Layout_Login_Header', 6 | value: '' 7 | }, { 8 | $set: { 9 | value: '' 10 | } 11 | }); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.{js,coffee,html,less,css,json}] 12 | indent_style = tab 13 | 14 | [*.i18n.json] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.md] 19 | trim_trailing_whitespace = false 20 | -------------------------------------------------------------------------------- /client/startup/userSetUtcOffset.js: -------------------------------------------------------------------------------- 1 | import moment from 'moment'; 2 | 3 | Meteor.startup(function() { 4 | Tracker.autorun(function() { 5 | const user = Meteor.user(); 6 | if (user && user.statusConnection === 'online') { 7 | const utcOffset = moment().utcOffset() / 60; 8 | if (user.utcOffset !== utcOffset) { 9 | Meteor.call('userSetUtcOffset', utcOffset); 10 | } 11 | } 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-autotranslate/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.add('AutoTranslate_Enabled', false, { type: 'boolean', group: 'Message', section: 'AutoTranslate', public: true }); 3 | RocketChat.settings.add('AutoTranslate_GoogleAPIKey', '', { type: 'string', group: 'Message', section: 'AutoTranslate', enableQuery: { _id: 'AutoTranslate_Enabled', value: true } }); 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-bot-helpers/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.addGroup('Bots', function() { 3 | this.add('BotHelpers_userFields', '_id, name, username, emails, language, utcOffset', { 4 | type: 'string', 5 | section: 'Helpers', 6 | i18nLabel: 'BotHelpers_userFields', 7 | i18nDescription: 'BotHelpers_userFields_Description' 8 | }); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/addManager.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:addManager'(username) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:addManager' }); 5 | } 6 | 7 | return RocketChat.Livechat.addManager(username); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/removeAgent.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:removeAgent'(username) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:removeAgent' }); 5 | } 6 | 7 | return RocketChat.Livechat.removeAgent(username); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /server/startup/migrations/v092.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 92, 3 | up() { 4 | const outgoingIntegrations = RocketChat.models.Integrations.find({ type: 'webhook-outgoing', 'event': 'sendMessage' }, { fields: { name: 1 }}).fetch(); 5 | 6 | outgoingIntegrations.forEach((i) => { 7 | RocketChat.models.Integrations.update(i._id, { $set: { runOnEdits: true }}); 8 | }); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/client/views/stylesheets/messagestar.less: -------------------------------------------------------------------------------- 1 | .starred-messages-list { 2 | li.empty { 3 | color: #7f7f7f; 4 | text-align: center; 5 | margin-top: 60px; 6 | } 7 | 8 | .load-more { 9 | text-transform: lowercase; 10 | text-align: center; 11 | line-height: 40px; 12 | font-style: italic; 13 | 14 | .load-more-loading { 15 | color: #aaaaaa; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/admin/server/publications/oauthApps.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('oauthApps', function() { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | if (!RocketChat.authz.hasPermission(this.userId, 'manage-oauth-apps')) { 6 | this.error(Meteor.Error('error-not-allowed', 'Not allowed', { publish: 'oauthApps' })); 7 | } 8 | return RocketChat.models.OAuthApps.find(); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-version/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:version', 3 | summary: '', 4 | version: '1.0.0' 5 | }); 6 | 7 | Package.registerBuildPlugin({ 8 | name: 'compileVersion', 9 | use: ['ecmascript'], 10 | sources: ['plugin/compile-version.js'] 11 | }); 12 | 13 | Package.onUse(function(api) { 14 | api.use('ecmascript'); 15 | api.use('isobuild:compiler-plugin@1.0.0'); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/removeDepartment.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:removeDepartment'(_id) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:removeDepartment' }); 5 | } 6 | 7 | return RocketChat.Livechat.removeDepartment(_id); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/removeManager.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:removeManager'(username) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:removeManager' }); 5 | } 6 | 7 | return RocketChat.Livechat.removeManager(username); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-otr/server/models/Messages.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Messages.deleteOldOTRMessages = function(roomId, ts) { 2 | const query = { rid: roomId, t: 'otr', ts: { $lte: ts } }; 3 | return this.remove(query); 4 | }; 5 | 6 | RocketChat.models.Messages.updateOTRAck = function(_id, otrAck) { 7 | const query = { _id }; 8 | const update = { $set: { otrAck } }; 9 | return this.update(query, update); 10 | }; 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v056.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 56, 3 | up() { 4 | RocketChat.models.Messages.find({ _id: /\./ }).forEach(function(message) { 5 | const oldId = message._id; 6 | message._id = message._id.replace(/(.*)\.S?(.*)/, 'slack-$1-$2'); 7 | RocketChat.models.Messages.insert(message); 8 | RocketChat.models.Messages.remove({ _id: oldId }); 9 | }); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/methods/changeLivechatStatus.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:changeLivechatStatus'() { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | 7 | const user = Meteor.user(); 8 | 9 | const newStatus = user.statusLivechat === 'available' ? 'not-available' : 'available'; 10 | 11 | Meteor.users.update(user._id, { $set: { statusLivechat: newStatus }}); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-message-snippet/client/messageType.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.MessageTypes.registerType({ 3 | id: 'message_snippeted', 4 | system: true, 5 | message: 'Snippeted_a_message', 6 | data(message) { 7 | const snippetLink = `${ message.snippetName }`; 8 | return { snippetLink }; 9 | } 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/server/startup.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.models.Permissions.upsert('post-readonly', {$setOnInsert: { roles: ['admin', 'owner', 'moderator'] } }); 3 | RocketChat.models.Permissions.upsert('set-readonly', {$setOnInsert: { roles: ['admin', 'owner'] } }); 4 | RocketChat.models.Permissions.upsert('set-react-when-readonly', {$setOnInsert: { roles: ['admin', 'owner'] }}); 5 | }); 6 | -------------------------------------------------------------------------------- /server/methods/toogleFavorite.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | toggleFavorite(rid, f) { 3 | check(rid, String); 4 | 5 | check(f, Match.Optional(Boolean)); 6 | if (!Meteor.userId()) { 7 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { 8 | method: 'toggleFavorite' 9 | }); 10 | } 11 | 12 | return RocketChat.models.Subscriptions.setFavoriteByRoomIdAndUserId(rid, Meteor.userId(), f); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /server/startup/migrations/v071.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 71, 3 | up() { 4 | //Removes the reactions on messages which are the system type "rm" ;) 5 | RocketChat.models.Messages.find({ 't': 'rm', 'reactions': { $exists: true, $not: {$size: 0} } }, { t: 1 }).forEach(function(message) { 6 | RocketChat.models.Messages.update({ _id: message._id }, { $set: { reactions: [] }}); 7 | }); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/joinDefaultChannels.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | joinDefaultChannels(silenced) { 3 | check(silenced, Match.Optional(Boolean)); 4 | 5 | if (!Meteor.userId()) { 6 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'joinDefaultChannels' }); 7 | } 8 | 9 | this.unblock(); 10 | return RocketChat.addUserToDefaultChannels(Meteor.user(), silenced); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/setDepartmentForVisitor.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:setDepartmentForVisitor'({ token, department } = {}) { 3 | RocketChat.Livechat.setDepartmentForGuest.call(this, { 4 | token, 5 | department 6 | }); 7 | 8 | // update visited page history to not expire 9 | RocketChat.models.LivechatPageVisited.keepHistoryForToken(token); 10 | 11 | return true; 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-migrations/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:migrations', 3 | version: '0.0.1', 4 | summary: '', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use('rocketchat:lib'); 10 | api.use('rocketchat:version'); 11 | api.use('ecmascript'); 12 | api.use('underscore'); 13 | api.use('check'); 14 | api.use('mongo'); 15 | 16 | api.addFiles('migrations.js', 'server'); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings-mail-messages/client/resetSelection.js: -------------------------------------------------------------------------------- 1 | export default function resetSelection(reset) { 2 | const [el] = $('.messages-box'); 3 | if (!el) { 4 | return; 5 | } 6 | const view = Blaze.getView(el); 7 | if (view && typeof view.templateInstance === 'function') { 8 | const {resetSelection} = view.templateInstance(); 9 | typeof resetSelection === 'function' && resetSelection(reset); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/rocketchat-katex/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rocketchat-katex", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "package.js", 7 | "directories": { 8 | "test": "tests" 9 | }, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": { 16 | "katex": "^0.7.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/client/oembedSandstormGrain.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/sendMessageLivechat.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | sendMessageLivechat(message) { 3 | check(message.rid, String); 4 | check(message.token, String); 5 | 6 | const guest = Meteor.users.findOne(Meteor.userId(), { 7 | fields: { 8 | name: 1, 9 | username: 1, 10 | department: 1 11 | } 12 | }); 13 | 14 | return RocketChat.Livechat.sendMessage({ guest, message }); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-join/client.js: -------------------------------------------------------------------------------- 1 | RocketChat.slashCommands.add('join', undefined, { 2 | description: 'Join_the_given_channel', 3 | params: '#channel' 4 | }, function(err, result, params) { 5 | if (err.error === 'error-user-already-in-room') { 6 | params.cmd = 'open'; 7 | params.msg.msg = params.msg.msg.replace('join', 'open'); 8 | return RocketChat.slashCommands.run('open', params.params, params.msg); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v072.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 72, 3 | up() { 4 | RocketChat.models.Users.find({ type: 'visitor', 'emails.address': { $exists: true } }, { emails: 1 }).forEach(function(visitor) { 5 | RocketChat.models.Users.update({ _id: visitor._id }, { 6 | $set: { 7 | visitorEmails: visitor.emails 8 | }, 9 | $unset: { 10 | emails: 1 11 | } 12 | }); 13 | }); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/default/info.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.default.addRoute('info', { authRequired: false }, { 2 | get() { 3 | const user = this.getLoggedInUser(); 4 | 5 | if (user && RocketChat.authz.hasRole(user._id, 'admin')) { 6 | return RocketChat.API.v1.success({ 7 | info: RocketChat.Info 8 | }); 9 | } 10 | 11 | return RocketChat.API.v1.success({ 12 | version: RocketChat.Info.version 13 | }); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/v1/helpers/isUserFromParams.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.v1.helperMethods.set('isUserFromParams', function _isUserFromParams() { 2 | const params = this.requestParams(); 3 | 4 | return (!params.userId && !params.username && !params.user) || 5 | (params.userId && this.userId === params.userId) || 6 | (params.username && this.user.username === params.username) || 7 | (params.user && this.user.username === params.user); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/rocketchat-colors/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:colors', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will process colors', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use('rocketchat:lib'); 10 | api.use('ecmascript'); 11 | 12 | api.addFiles('client.js', ['client']); 13 | api.addFiles('style.css', ['client']); 14 | api.addFiles('settings.js', ['server']); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/views/app/home.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /packages/rocketchat-message-snippet/client/router.js: -------------------------------------------------------------------------------- 1 | /* global FlowRouter, BlazeLayout */ 2 | FlowRouter.route('/snippet/:snippetId/:snippetName', { 3 | name: 'snippetView', 4 | action() { 5 | BlazeLayout.render('main', {center: 'snippetPage', flexTabBar: null }); 6 | }, 7 | triggersEnter: [ function() { 8 | RocketChat.TabBar.hide(); 9 | }], 10 | triggersExit: [ 11 | function() { 12 | RocketChat.TabBar.show(); 13 | } 14 | ] 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-sandstorm/client/setPath.js: -------------------------------------------------------------------------------- 1 | function updateSandstormMetaData(msg) { 2 | return window.parent.postMessage(msg, '*'); 3 | } 4 | 5 | if (Meteor.settings.public.sandstorm) { 6 | // Set the path of the parent frame when the grain's path changes. 7 | // See https://docs.sandstorm.io/en/latest/developing/path/ 8 | 9 | FlowRouter.triggers.enter([({ path }) => { 10 | updateSandstormMetaData({ setPath: path }); 11 | }]); 12 | } 13 | -------------------------------------------------------------------------------- /packages/rocketchat-videobridge/server/models/Rooms.js: -------------------------------------------------------------------------------- 1 | /** 2 | * sets jitsiTimeout to indicate a call is in progress 3 | * @param {string} _id - Room id 4 | * @parm {number} time - time to set 5 | */ 6 | RocketChat.models.Rooms.setJitsiTimeout = function(_id, time) { 7 | const query = { 8 | _id 9 | }; 10 | 11 | const update = { 12 | $set: { 13 | jitsiTimeout: time 14 | } 15 | }; 16 | 17 | return this.update(query, update); 18 | }; 19 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/app/client/views/options.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/lib/OfficeClock.js: -------------------------------------------------------------------------------- 1 | // Every minute check if office closed 2 | Meteor.setInterval(function() { 3 | if (RocketChat.settings.get('Livechat_enable_office_hours')) { 4 | if (RocketChat.models.LivechatOfficeHour.isOpeningTime()) { 5 | RocketChat.models.Users.openOffice(); 6 | } else if (RocketChat.models.LivechatOfficeHour.isClosingTime()) { 7 | RocketChat.models.Users.closeOffice(); 8 | } 9 | } 10 | }, 60000); 11 | -------------------------------------------------------------------------------- /server/methods/userSetUtcOffset.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | userSetUtcOffset(utcOffset) { 3 | check(utcOffset, Number); 4 | 5 | if (this.userId == null) { 6 | return; 7 | } 8 | 9 | this.unblock(); 10 | 11 | return RocketChat.models.Users.setUtcOffset(this.userId, utcOffset); 12 | } 13 | }); 14 | 15 | DDPRateLimiter.addRule({ 16 | type: 'method', 17 | name: 'userSetUtcOffset', 18 | userId() { 19 | return true; 20 | } 21 | }, 1, 60000); 22 | -------------------------------------------------------------------------------- /packages/rocketchat-mapview/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:mapview', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will replace geolocation in messages with a Google Static Map' 5 | }); 6 | 7 | Package.onUse(function(api) { 8 | api.use([ 9 | 'ecmascript', 10 | 'rocketchat:lib' 11 | ]); 12 | 13 | api.addFiles('server/settings.js', 'server'); 14 | 15 | api.addFiles('client/mapview.js', 'client'); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-error-handler/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:error-handler', 3 | version: '1.0.0', 4 | summary: 'Rocket.Chat Error Handler', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib', 12 | 'templating' 13 | ]); 14 | 15 | api.addFiles('server/lib/RocketChat.ErrorHandler.js', 'server'); 16 | api.addFiles('server/startup/settings.js', 'server'); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/removeTrigger.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:removeTrigger'(triggerId) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:removeTrigger' }); 5 | } 6 | 7 | check(triggerId, String); 8 | 9 | return RocketChat.models.LivechatTrigger.removeById(triggerId); 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /server/startup/migrations/v055.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 55, 3 | up() { 4 | RocketChat.models.Rooms.find({ 'topic': { $exists: 1, $ne: '' } }, { topic: 1 }).forEach(function(room) { 5 | const topic = s.escapeHTML(room.topic); 6 | RocketChat.models.Rooms.update({ _id: room._id }, { $set: { topic }}); 7 | RocketChat.models.Messages.update({ t: 'room_changed_topic', rid: room._id }, { $set: { msg: topic }}); 8 | }); 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-slack/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:importer-slack', 3 | version: '0.0.1', 4 | summary: 'Importer for Slack', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib', 12 | 'rocketchat:importer' 13 | ]); 14 | api.use('rocketchat:logger', 'server'); 15 | api.addFiles('server.js', 'server'); 16 | api.addFiles('main.js', ['client', 'server']); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/oauth/proxy.js: -------------------------------------------------------------------------------- 1 | /* globals OAuth */ 2 | 3 | OAuth._redirectUri = _.wrap(OAuth._redirectUri, function(func, serviceName, ...args) { 4 | const proxy = RocketChat.settings.get('Accounts_OAuth_Proxy_services').replace(/\s/g, '').split(','); 5 | if (proxy.includes(serviceName)) { 6 | return `${ RocketChat.settings.get('Accounts_OAuth_Proxy_host') }/oauth_redirect`; 7 | } else { 8 | return func(serviceName, ...args); 9 | } 10 | 11 | }); 12 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/client/router.js: -------------------------------------------------------------------------------- 1 | FlowRouter.route('/mailer', { 2 | name: 'mailer', 3 | action() { 4 | return BlazeLayout.render('main', { 5 | center: 'mailer' 6 | }); 7 | } 8 | }); 9 | 10 | FlowRouter.route('/mailer/unsubscribe/:_id/:createdAt', { 11 | name: 'mailer-unsubscribe', 12 | action(params) { 13 | Meteor.call('Mailer:unsubscribe', params._id, params.createdAt); 14 | return BlazeLayout.render('mailerUnsubscribe'); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-mentions/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:mentions', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will process mentions', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib', 12 | 'underscore' 13 | ]); 14 | 15 | api.addFiles('server.js', 'server'); 16 | api.addFiles('client.js', 'client'); 17 | // api.('mentions.js', 'client'); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-open/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-open', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /open command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib', 14 | 'kadira:flow-router' 15 | ]); 16 | 17 | api.use('templating', 'client'); 18 | 19 | api.addFiles('client.js', 'client'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-topic/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-topic', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /topic command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'rocketchat:lib', 12 | 'ecmascript' 13 | ]); 14 | 15 | api.use(['rocketchat:authorization'], ['client', 'server']); 16 | 17 | api.addFiles('topic.js', ['client', 'server']); 18 | }); 19 | -------------------------------------------------------------------------------- /server/startup/migrations/v073.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 73, 3 | up() { 4 | RocketChat.models.Users.find({ 'oauth.athorizedClients': { $exists: true } }, { oauth: 1 }).forEach(function(user) { 5 | RocketChat.models.Users.update({ _id: user._id }, { 6 | $set: { 7 | 'oauth.authorizedClients': user.oauth.athorizedClients 8 | }, 9 | $unset: { 10 | 'oauth.athorizedClients': 1 11 | } 12 | }); 13 | }); 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-assets/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:assets', 3 | version: '0.0.1', 4 | summary: '', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'underscore', 12 | 'webapp', 13 | 'rocketchat:file', 14 | 'rocketchat:lib', 15 | 'webapp-hashing' 16 | ]); 17 | 18 | api.addFiles('server/assets.js', 'server'); 19 | }); 20 | 21 | Npm.depends({ 22 | 'image-size': '0.4.0' 23 | }); 24 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/server/classes/ImporterProgress.js: -------------------------------------------------------------------------------- 1 | /* globals Importer */ 2 | // Class for all the progress of the importers to use. 3 | Importer.Progress = (Importer.Progress = class Progress { 4 | // Constructs a new progress object. 5 | // 6 | // @param [String] name the name of the Importer 7 | // 8 | constructor(name) { 9 | this.name = name; 10 | this.step = Importer.ProgressStep.NEW; 11 | this.count = { completed: 0, total: 0 }; 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/saveDepartment.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:saveDepartment'(_id, departmentData, departmentAgents) { 3 | if (!Meteor.userId() || !RocketChat.authz.hasPermission(Meteor.userId(), 'view-livechat-manager')) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:saveDepartment' }); 5 | } 6 | 7 | return RocketChat.Livechat.saveDepartment(_id, departmentData, departmentAgents); 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /.travis/docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/" 7 | 8 | if [[ $TRAVIS_TAG ]] 9 | then 10 | CURL_DATA='{"source_type":"Tag","source_name":"'"$TRAVIS_TAG"'"}'; 11 | else 12 | CURL_DATA='{"source_type":"Branch","source_name":"'"$TRAVIS_BRANCH"'"}'; 13 | fi 14 | 15 | curl -H "Content-Type: application/json" --data "$CURL_DATA" -X POST "$CURL_URL" 16 | -------------------------------------------------------------------------------- /lib/underscore.string.js: -------------------------------------------------------------------------------- 1 | /* globals mixin */ 2 | 3 | // This will add underscore.string methods to Underscore.js 4 | // except for include, contains, reverse and join that are 5 | // dropped because they collide with the functions already 6 | // defined by Underscore.js. 7 | 8 | mixin = function(obj) { 9 | _.each(_.functions(obj), function(name) { 10 | if (!_[name] && !_.prototype[name]) { 11 | _[name] = obj[name]; 12 | } 13 | }); 14 | }; 15 | 16 | mixin(s.exports()); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-hipchat/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:importer-hipchat', 3 | version: '0.0.1', 4 | summary: 'Importer for HipChat', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib', 12 | 'rocketchat:importer' 13 | ]); 14 | api.use('rocketchat:logger', 'server'); 15 | api.addFiles('server.js', 'server'); 16 | api.addFiles('main.js', ['client', 'server']); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-irc/.npm/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "coffee-script": { 4 | "version": "1.9.3", 5 | "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.9.3.tgz", 6 | "from": "coffee-script@1.9.3" 7 | }, 8 | "lru-cache": { 9 | "version": "2.6.5", 10 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.6.5.tgz", 11 | "from": "lru-cache@2.6.5" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/models/Reports.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Reports = new class extends RocketChat.models._Base { 2 | constructor() { 3 | super('reports'); 4 | } 5 | createWithMessageDescriptionAndUserId(message, description, userId, extraData) { 6 | const record = { 7 | message, 8 | description, 9 | ts: new Date(), 10 | userId 11 | }; 12 | _.extend(record, extraData); 13 | record._id = this.insert(record); 14 | return record; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/views/app/tabbar/externalSearch.html: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/client/views/mailerUnsubscribe.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /example-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | # Build 7 | export NODE_ENV=production 8 | meteor add rocketchat:internal-hubot 9 | meteor build --server https://demo.rocket.chat --directory /var/www/rocket.chat 10 | 11 | # Run 12 | export METEOR_SETTINGS=$(cat settings.json) 13 | cd /var/www/rocket.chat/bundle/programs/server 14 | npm install 15 | cd /var/www/rocket.chat/current 16 | pm2 startOrRestart /var/www/rocket.chat/current/pm2.json 17 | -------------------------------------------------------------------------------- /packages/rocketchat-autolinker/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:autolinker', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will translate links on messages', 5 | git: '' 6 | }); 7 | 8 | Npm.depends({ 9 | autolinker: '1.4.0' 10 | }); 11 | 12 | Package.onUse(function(api) { 13 | api.use('ecmascript'); 14 | api.use('rocketchat:lib'); 15 | 16 | api.addFiles('client.js', 'client'); 17 | 18 | api.addFiles('settings.js', 'server'); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-join/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-join', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /join command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-kick/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-kick', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /kick command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-msg/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-msg', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /msg command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-sms/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:sms', 3 | version: '0.0.1', 4 | summary: '', 5 | git: '', 6 | documentation: 'README.md' 7 | }); 8 | 9 | Package.onUse(function(api) { 10 | api.use('ecmascript'); 11 | api.use('rocketchat:lib'); 12 | 13 | api.addFiles('settings.js', 'server'); 14 | api.addFiles('SMS.js', 'server'); 15 | api.addFiles('services/twilio.js', 'server'); 16 | }); 17 | 18 | Npm.depends({ 19 | 'twilio': '2.9.1' 20 | }); 21 | -------------------------------------------------------------------------------- /server/startup/migrations/v035.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 35, 3 | up() { 4 | return RocketChat.models.Messages.update({ 5 | 'file._id': { 6 | $exists: true 7 | }, 8 | 'attachments.title_link': { 9 | $exists: true 10 | }, 11 | 'attachments.title_link_download': { 12 | $exists: false 13 | } 14 | }, { 15 | $set: { 16 | 'attachments.$.title_link_download': true 17 | } 18 | }, { 19 | multi: true 20 | }); 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /packages/rocketchat-2fa/server/methods/checkCodesRemaining.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | '2fa:checkCodesRemaining'() { 3 | if (!Meteor.userId()) { 4 | throw new Meteor.Error('not-authorized'); 5 | } 6 | 7 | const user = Meteor.user(); 8 | 9 | if (!user.services || !user.services.totp || !user.services.totp.enabled) { 10 | throw new Meteor.Error('invalid-totp'); 11 | } 12 | 13 | return { 14 | remaining: user.services.totp.hashedBackup.length 15 | }; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-mailer/server/models/Users.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Users.rocketMailUnsubscribe = function(_id, createdAt) { 2 | const query = { 3 | _id, 4 | createdAt: new Date(parseInt(createdAt)) 5 | }; 6 | const update = { 7 | $set: { 8 | 'mailer.unsubscribed': true 9 | } 10 | }; 11 | const affectedRows = this.update(query, update); 12 | console.log('[Mailer:Unsubscribe]', _id, createdAt, new Date(parseInt(createdAt)), affectedRows); 13 | return affectedRows; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-create/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-create', 3 | version: '0.0.1', 4 | summary: 'Command handler for the /create command', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /private/node_scripts/unsubscribe_csv/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unsubscribe_csv", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node unsubscribe.js" 7 | }, 8 | "dependencies": { 9 | "commander": "^2.9.0", 10 | "ddp": "^0.11.0", 11 | "line-by-line": "^0.1.3", 12 | "line-reader": "^0.2.4", 13 | "moment": "^2.10.2", 14 | "mongodb": "^2.1.0", 15 | "underscore": "^1.6.0", 16 | "wait.for": "^0.6.6" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/rocketchat-2fa/server/methods/enable.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | '2fa:enable'() { 3 | if (!Meteor.userId()) { 4 | throw new Meteor.Error('not-authorized'); 5 | } 6 | 7 | const user = Meteor.user(); 8 | 9 | const secret = RocketChat.TOTP.generateSecret(); 10 | 11 | RocketChat.models.Users.disable2FAAndSetTempSecretByUserId(Meteor.userId(), secret.base32); 12 | 13 | return { 14 | url: RocketChat.TOTP.generateOtpauthURL(secret, user.username) 15 | }; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-google-natural-language/client/index.js: -------------------------------------------------------------------------------- 1 | Template.room.helpers({ 2 | sentimentSmile() { 3 | if (!RocketChat.settings.get('GoogleNaturalLanguage_Enabled')) { 4 | return; 5 | } 6 | 7 | const room = ChatRoom.findOne(this._id, { fields: { sentiment: 1 } }); 8 | 9 | if (room.sentiment >= 0.3) { 10 | return ':)'; 11 | } else if (room.sentiment >= -0.3) { 12 | return ':|'; 13 | } else if (room.sentiment < -0.3) { 14 | return ':('; 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-markdown/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(() => { 2 | RocketChat.settings.add('Markdown_Headers', false, { 3 | type: 'boolean', 4 | group: 'Message', 5 | section: 'Markdown', 6 | public: true 7 | }); 8 | 9 | return RocketChat.settings.add('Markdown_SupportSchemesForLink', 'http,https', { 10 | type: 'string', 11 | group: 'Message', 12 | section: 'Markdown', 13 | public: true, 14 | i18nDescription: 'Markdown_SupportSchemesForLink_Description' 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-token-login/server/login_token_server.js: -------------------------------------------------------------------------------- 1 | /* globals Accounts */ 2 | 3 | Accounts.registerLoginHandler('login-token', function(result) { 4 | if (!result.loginToken) { 5 | return; 6 | } 7 | 8 | const user = Meteor.users.findOne({ 9 | 'services.loginToken.token': result.loginToken 10 | }); 11 | 12 | if (user) { 13 | Meteor.users.update({_id: user._id}, {$unset: {'services.loginToken': 1}}); 14 | 15 | return { 16 | userId: user._id 17 | }; 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /packages/rocketchat-ui/client/lib/customEventPolyfill.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function CustomEvent ( event, params ) { 3 | params = params || { bubbles: false, cancelable: false, detail: undefined }; 4 | var evt = document.createEvent( 'CustomEvent' ); 5 | evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); 6 | return evt; 7 | } 8 | 9 | CustomEvent.prototype = window.Event.prototype; 10 | 11 | window.CustomEvent = CustomEvent; 12 | })(); -------------------------------------------------------------------------------- /packages/rocketchat-2fa/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-api/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-assets/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-cas/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-crowd/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-file/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-irc/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-oembed/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-sms/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-theme/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-tutum/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /server/startup/presence.js: -------------------------------------------------------------------------------- 1 | /* globals InstanceStatus, UserPresence, UserPresenceMonitor */ 2 | 3 | Meteor.startup(function() { 4 | const instance = { 5 | host: 'localhost', 6 | port: String(process.env.PORT).trim() 7 | }; 8 | 9 | if (process.env.INSTANCE_IP) { 10 | instance.host = String(process.env.INSTANCE_IP).trim(); 11 | } 12 | 13 | InstanceStatus.registerInstance('rocket.chat', instance); 14 | 15 | UserPresence.start(); 16 | 17 | return UserPresenceMonitor.start(); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/meteor-accounts-saml/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-autolinker/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-file-upload/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-csv/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-importer/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-mapview/server/settings.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function() { 2 | RocketChat.settings.add('MapView_Enabled', false, {type: 'boolean', group: 'Message', section: 'Google Maps', public: true, i18nLabel: 'MapView_Enabled', i18nDescription: 'MapView_Enabled_Description'}); 3 | return RocketChat.settings.add('MapView_GMapsAPIKey', '', {type: 'string', group: 'Message', section: 'Google Maps', public: true, i18nLabel: 'MapView_GMapsAPIKey', i18nDescription: 'MapView_GMapsAPIKey_Description'}); 4 | }); 5 | -------------------------------------------------------------------------------- /packages/rocketchat-slackbridge/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-invite/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-invite', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will translate /me commands', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-tutum/.npm/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "double-ended-queue": { 4 | "version": "2.1.0-0", 5 | "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", 6 | "from": "double-ended-queue@>=2.1.0-0 <3.0.0" 7 | }, 8 | "redis": { 9 | "version": "2.2.5", 10 | "resolved": "https://registry.npmjs.org/redis/-/redis-2.2.5.tgz", 11 | "from": "redis@2.2.5" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-master/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /public/manifest.webapp: -------------------------------------------------------------------------------- 1 | { 2 | "name": "RocketChat", 3 | "description": "The Ultimate Open Source WebChat Platform", 4 | "launch_path": "/", 5 | "icons": { 6 | "192": "/images/logo/android-chrome-192x192.png", 7 | "512": "/images/logo/512x512.png" 8 | }, 9 | "developer": { 10 | "name": "Rocket.Chat", 11 | "url": "https://rocket.chat/" 12 | }, 13 | "fullscreen": "true", 14 | "chrome": { 15 | "navigation": false 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /server/publications/userChannels.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('userChannels', function(userId) { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | if (RocketChat.authz.hasPermission(this.userId, 'view-other-user-channels') !== true) { 7 | return this.ready(); 8 | } 9 | 10 | return RocketChat.models.Subscriptions.findByUserId(userId, { 11 | fields: { 12 | rid: 1, 13 | name: 1, 14 | t: 1, 15 | u: 1 16 | }, 17 | sort: { 18 | t: 1, 19 | name: 1 20 | } 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/v1/helpers/getLoggedInUser.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.v1.helperMethods.set('getLoggedInUser', function _getLoggedInUser() { 2 | let user; 3 | 4 | if (this.request.headers['x-auth-token'] && this.request.headers['x-user-id']) { 5 | user = RocketChat.models.Users.findOne({ 6 | '_id': this.request.headers['x-user-id'], 7 | 'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(this.request.headers['x-auth-token']) 8 | }); 9 | } 10 | 11 | return user; 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings/server/models/Messages.js: -------------------------------------------------------------------------------- 1 | RocketChat.models.Messages.createRoomSettingsChangedWithTypeRoomIdMessageAndUser = function(type, roomId, message, user, extraData) { 2 | return this.createWithTypeRoomIdMessageAndUser(type, roomId, message, user, extraData); 3 | }; 4 | 5 | RocketChat.models.Messages.createRoomRenamedWithRoomIdRoomNameAndUser = function(roomId, roomName, user, extraData) { 6 | return this.createWithTypeRoomIdMessageAndUser('r', roomId, roomName, user, extraData); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/rocketchat-file/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:file', 3 | version: '0.0.1', 4 | summary: '', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use('rocketchat:lib'); 10 | api.use('rocketchat:version'); 11 | api.use('ecmascript'); 12 | 13 | api.addFiles('file.server.js', 'server'); 14 | 15 | api.export('RocketChatFile', 'server'); 16 | }); 17 | 18 | Npm.depends({ 19 | 'mkdirp': '0.5.1', 20 | 'gridfs-stream': '1.1.1', 21 | 'gm': '1.23.0' 22 | }); 23 | -------------------------------------------------------------------------------- /packages/rocketchat-gitlab/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:gitlab', 3 | version: '0.0.1', 4 | summary: 'RocketChat settings for GitLab Oauth Flow' 5 | }); 6 | 7 | Package.onUse(function(api) { 8 | api.use('ecmascript'); 9 | api.use('rocketchat:lib'); 10 | api.use('rocketchat:custom-oauth'); 11 | 12 | api.use('templating', 'client'); 13 | 14 | api.addFiles('common.js'); 15 | api.addFiles('gitlab-login-button.css', 'client'); 16 | api.addFiles('startup.js', 'server'); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/rocketchat-internal-hubot/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/server/methods/changeLivechatStatus.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | 'livechat:changeLivechatStatus'() { 3 | if (!Meteor.userId()) { 4 | throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:changeLivechatStatus' }); 5 | } 6 | 7 | const user = Meteor.user(); 8 | 9 | const newStatus = user.statusLivechat === 'available' ? 'not-available' : 'available'; 10 | 11 | return RocketChat.models.Users.setLivechatStatus(user._id, newStatus); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-sandstorm/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:sandstorm', 3 | version: '0.0.1', 4 | summary: 'Sandstorm integeration for Rocket.Chat', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 'ecmascript', 'rocketchat:lib', 'jalik:ufs', 'kadira:flow-router']); 10 | 11 | api.addFiles([ 'server/lib.js', 'server/events.js', 'server/powerbox.js' ], 'server'); 12 | api.addFiles([ 'client/powerboxListener.js', 'client/setPath.js' ], 'client'); 13 | }); 14 | -------------------------------------------------------------------------------- /server/startup/migrations/v041.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 41, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Users) { 5 | RocketChat.models.Users.update({ bot: true }, { $set: { type: 'bot' } }, { multi: true }); 6 | RocketChat.models.Users.update({ 'profile.guest': true }, { $set: { type: 'visitor' } }, { multi: true }); 7 | RocketChat.models.Users.update({ type: { $exists: false } }, { $set: { type: 'user' } }, { multi: true }); 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /server/startup/migrations/v080.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 80, 3 | up() { 4 | const query = { 5 | type: 'webhook-outgoing', 6 | $or: [{ 7 | channel: [] 8 | }, { 9 | channel: '' 10 | }, { 11 | channel: { 12 | $exists: false 13 | } 14 | }] 15 | }; 16 | 17 | const update = { 18 | $set: { 19 | channel: ['all_public_channels'] 20 | } 21 | }; 22 | 23 | RocketChat.models.Integrations.update(query, update, {multi: true}); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /packages/rocketchat-ui-account/client/avatar/avatar.js: -------------------------------------------------------------------------------- 1 | Template.avatar.helpers({ 2 | imageUrl() { 3 | let username = this.username; 4 | if (username == null && this.userId != null) { 5 | const user = Meteor.users.findOne(this.userId); 6 | username = user && user.username; 7 | } 8 | if (username == null) { 9 | return; 10 | } 11 | Session.get(`avatar_random_${ username }`); 12 | const url = getAvatarUrlFromUsername(username); 13 | return `background-image:url(${ url });`; 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/rocketchat-api/server/default/helpers/getLoggedInUser.js: -------------------------------------------------------------------------------- 1 | RocketChat.API.default.helperMethods.set('getLoggedInUser', function _getLoggedInUser() { 2 | let user; 3 | 4 | if (this.request.headers['x-auth-token'] && this.request.headers['x-user-id']) { 5 | user = RocketChat.models.Users.findOne({ 6 | '_id': this.request.headers['x-user-id'], 7 | 'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(this.request.headers['x-auth-token']) 8 | }); 9 | } 10 | 11 | return user; 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-google-natural-language/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-hipchat-enterprise/.npm/package/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/createToken.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | createToken(userId) { 3 | if (Meteor.userId() !== userId && !RocketChat.authz.hasPermission(Meteor.userId(), 'user-generate-access-token')) { 4 | throw new Meteor.Error('error-not-authorized', 'Not authorized', { method: 'createToken' }); 5 | } 6 | const token = Accounts._generateStampedLoginToken(); 7 | Accounts._insertLoginToken(userId, token); 8 | return { 9 | userId, 10 | authToken: token.token 11 | }; 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/admin/client/views/oauthApps.js: -------------------------------------------------------------------------------- 1 | /* globals ChatOAuthApps */ 2 | import moment from 'moment'; 3 | 4 | Template.oauthApps.onCreated(function() { 5 | this.subscribe('oauthApps'); 6 | }); 7 | 8 | Template.oauthApps.helpers({ 9 | hasPermission() { 10 | return RocketChat.authz.hasAllPermission('manage-oauth-apps'); 11 | }, 12 | applications() { 13 | return ChatOAuthApps.find(); 14 | }, 15 | dateFormated(date) { 16 | return moment(date).format('L LT'); 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/rocketchat-postcss/.npm/plugin/minifier-postcss/README: -------------------------------------------------------------------------------- 1 | This directory and the files immediately inside it are automatically generated 2 | when you change this package's NPM dependencies. Commit the files in this 3 | directory (npm-shrinkwrap.json, .gitignore, and this README) to source control 4 | so that others run the same versions of sub-dependencies. 5 | 6 | You should NOT check in the node_modules directory that Meteor automatically 7 | creates; if you are using git, the .gitignore file tells git to ignore it. 8 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-inviteall/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:slashcommands-invite-all', 3 | version: '0.0.1', 4 | summary: 'Message pre-processor that will translate /invite-all commands', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | 10 | api.use([ 11 | 'ecmascript', 12 | 'check', 13 | 'rocketchat:lib' 14 | ]); 15 | 16 | api.use('templating', 'client'); 17 | 18 | api.addFiles('client.js', 'client'); 19 | api.addFiles('server.js', 'server'); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommands-me/me.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Me is a named function that will replace /me commands 4 | * @param {Object} message - The message object 5 | */ 6 | RocketChat.slashCommands.add('me', function Me(command, params, item) { 7 | if (command !== 'me') { 8 | return; 9 | } 10 | if (_.trim(params)) { 11 | const msg = item; 12 | msg.msg = `_${ params }_`; 13 | Meteor.call('sendMessage', msg); 14 | } 15 | }, { 16 | description: 'Displays_action_text', 17 | params: 'your_message' 18 | }); 19 | -------------------------------------------------------------------------------- /server/startup/migrations/v090.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 90, 3 | up() { 4 | RocketChat.models.Settings.remove({ _id: 'Piwik', type: 'group' }); 5 | 6 | const settings = RocketChat.models.Settings.find({$or: [{_id: 'PiwikAnalytics_url', value: {$ne: null}}, {_id: 'PiwikAnalytics_siteId', value: {$ne: null}}]}).fetch(); 7 | 8 | if (settings && settings.length === 2) { 9 | RocketChat.models.Settings.upsert({_id: 'PiwikAnalytics_enabled'}, {$set: {value: true}}); 10 | } 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/rocketchat-message-star/client/starMessage.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | starMessage(message) { 3 | if (!Meteor.userId()) { 4 | return false; 5 | } 6 | if (RocketChat.models.Subscriptions.findOne({ rid: message.rid }) == null) { 7 | return false; 8 | } 9 | if (!RocketChat.settings.get('Message_AllowStarring')) { 10 | return false; 11 | } 12 | return ChatMessage.update({ 13 | _id: message._id 14 | }, { 15 | $set: { 16 | starred: !!message.starred 17 | } 18 | }); 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /packages/rocketchat-token-login/client/login_token_client.js: -------------------------------------------------------------------------------- 1 | Meteor.loginWithLoginToken = function(token) { 2 | Accounts.callLoginMethod({ 3 | methodArguments: [{ 4 | loginToken: token 5 | }], 6 | userCallback(error) { 7 | if (!error) { 8 | FlowRouter.go('/'); 9 | } 10 | } 11 | }); 12 | }; 13 | 14 | FlowRouter.route('/login-token/:token', { 15 | name: 'tokenLogin', 16 | action() { 17 | BlazeLayout.render('loginLayout'); 18 | Meteor.loginWithLoginToken(this.getParam('token')); 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /server/startup/migrations/v066.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 66, 3 | up() { 4 | if (RocketChat && RocketChat.models && RocketChat.models.Settings) { 5 | 6 | // New color settings - start with old settings as defaults 7 | const replace1 = RocketChat.models.Settings.findOne({ _id: 'theme-color-tertiary-background-color' }); 8 | if (replace1) { 9 | RocketChat.models.Settings.upsert({ _id: 'theme-color-component-color' }, { $set: { value: replace1.value } }); 10 | } 11 | } 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /client/startup/emailVerification.js: -------------------------------------------------------------------------------- 1 | import toastr from 'toastr'; 2 | Meteor.startup(function() { 3 | Tracker.autorun(function() { 4 | const user = Meteor.user(); 5 | if (user && user.emails && user.emails[0] && user.emails[0].verified !== true && RocketChat.settings.get('Accounts_EmailVerification') === true && !Session.get('Accounts_EmailVerification_Warning')) { 6 | toastr.warning(TAPi18n.__('You_have_not_verified_your_email')); 7 | Session.set('Accounts_EmailVerification_Warning', true); 8 | } 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | set -euvo pipefail 4 | IFS=$'\n\t' 5 | 6 | ROOTPATH=/var/www/rocket.chat 7 | PM2FILE=pm2.json 8 | if [ "$1" == "development" ]; then 9 | ROOTPATH=/var/www/rocket.chat.dev 10 | PM2FILE=pm2.dev.json 11 | fi 12 | 13 | cd $ROOTPATH 14 | curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.tgz" -o rocket.chat.tgz 15 | tar zxf rocket.chat.tgz && rm rocket.chat.tgz 16 | cd $ROOTPATH/bundle/programs/server 17 | npm install 18 | pm2 startOrRestart $ROOTPATH/current/$PM2FILE 19 | -------------------------------------------------------------------------------- /packages/rocketchat-lib/server/methods/getSingleMessage.js: -------------------------------------------------------------------------------- 1 | Meteor.methods({ 2 | getSingleMessage(msgId) { 3 | check(msgId, String); 4 | 5 | if (!Meteor.userId()) { 6 | throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'getSingleMessage' }); 7 | } 8 | 9 | const msg = RocketChat.models.Messages.findOneById(msgId); 10 | 11 | if (!msg && !msg.rid) { 12 | return undefined; 13 | } 14 | 15 | Meteor.call('canAccessRoom', msg.rid, Meteor.userId()); 16 | 17 | return msg; 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /packages/rocketchat-livechat/client/views/sideNav/livechatFlex.js: -------------------------------------------------------------------------------- 1 | Template.livechatFlex.helpers({ 2 | active(...routes) { 3 | FlowRouter.watchPathChange(); 4 | if (routes.indexOf(FlowRouter.current().route.name) !== -1) { 5 | return 'active'; 6 | } 7 | } 8 | }); 9 | 10 | Template.livechatFlex.events({ 11 | 'mouseenter header'() { 12 | SideNav.overArrow(); 13 | }, 14 | 15 | 'mouseleave header'() { 16 | SideNav.leaveArrow(); 17 | }, 18 | 19 | 'click header'() { 20 | SideNav.closeFlex(); 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /packages/rocketchat-videobridge/client/views/videoFlexTab.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /packages/rocketchat-wordpress/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:wordpress', 3 | version: '0.0.1', 4 | summary: 'RocketChat settings for WordPress Oauth Flow' 5 | }); 6 | 7 | Package.onUse(function(api) { 8 | api.use('ecmascript'); 9 | api.use('rocketchat:lib'); 10 | api.use('rocketchat:custom-oauth'); 11 | 12 | api.use('templating', 'client'); 13 | 14 | api.addFiles('common.js'); 15 | api.addFiles('client/wordpress-login-button.css', 'client'); 16 | api.addFiles('startup.js', 'server'); 17 | }); 18 | -------------------------------------------------------------------------------- /server/startup/migrations/v079.js: -------------------------------------------------------------------------------- 1 | RocketChat.Migrations.add({ 2 | version: 79, 3 | up() { 4 | const integrations = RocketChat.models.Integrations.find({type: 'webhook-incoming'}).fetch(); 5 | 6 | for (const integration of integrations) { 7 | if (typeof integration.channel === 'string') { 8 | RocketChat.models.Integrations.update({_id: integration._id}, { 9 | $set: { 10 | channel: integration.channel.split(',').map(channel => channel.trim()) 11 | } 12 | }); 13 | } 14 | } 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /packages/rocketchat-importer-csv/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'rocketchat:importer-csv', 3 | version: '1.0.0', 4 | summary: 'Importer for CSV Files', 5 | git: '' 6 | }); 7 | 8 | Package.onUse(function(api) { 9 | api.use([ 10 | 'ecmascript', 11 | 'rocketchat:lib', 12 | 'rocketchat:importer' 13 | ]); 14 | api.use('rocketchat:logger', 'server'); 15 | api.addFiles('server.js', 'server'); 16 | api.addFiles('main.js', ['client', 'server']); 17 | }); 18 | 19 | Npm.depends({ 20 | 'csv-parse': '1.1.7' 21 | }); 22 | -------------------------------------------------------------------------------- /packages/rocketchat-oauth2-server-config/oauth/server/default-services.js: -------------------------------------------------------------------------------- 1 | if (!RocketChat.models.OAuthApps.findOne('zapier')) { 2 | RocketChat.models.OAuthApps.insert({ 3 | _id: 'zapier', 4 | name: 'Zapier', 5 | active: true, 6 | clientId: 'zapier', 7 | clientSecret: 'RTK6TlndaCIolhQhZ7_KHIGOKj41RnlaOq_o-7JKwLr', 8 | redirectUri: 'https://zapier.com/dashboard/auth/oauth/return/RocketChatDevAPI/', 9 | _createdAt: new Date, 10 | _createdBy: { 11 | _id: 'system', 12 | username: 'system' 13 | } 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommand-asciiarts/gimme.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Gimme is a named function that will replace /gimme commands 3 | * @param {Object} message - The message object 4 | */ 5 | 6 | 7 | function Gimme(command, params, item) { 8 | if (command === 'gimme') { 9 | const msg = item; 10 | msg.msg = `༼ つ ◕_◕ ༽つ ${ params }`; 11 | Meteor.call('sendMessage', msg); 12 | } 13 | } 14 | 15 | RocketChat.slashCommands.add('gimme', Gimme, { 16 | description: 'Slash_Gimme_Description', 17 | params: 'your_message_optional' 18 | }); 19 | -------------------------------------------------------------------------------- /packages/rocketchat-slashcommand-asciiarts/shrug.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Shrug is a named function that will replace /shrug commands 3 | * @param {Object} message - The message object 4 | */ 5 | 6 | 7 | function Shrug(command, params, item) { 8 | if (command === 'shrug') { 9 | const msg = item; 10 | msg.msg = `${ params } ¯\\_(ツ)_/¯`; 11 | Meteor.call('sendMessage', msg); 12 | } 13 | } 14 | 15 | RocketChat.slashCommands.add('shrug', Shrug, { 16 | description: 'Slash_Shrug_Description', 17 | params: 'your_message_optional' 18 | }); 19 | -------------------------------------------------------------------------------- /server/publications/roomSubscriptionsByRole.js: -------------------------------------------------------------------------------- 1 | Meteor.publish('roomSubscriptionsByRole', function(rid, role) { 2 | if (!this.userId) { 3 | return this.ready(); 4 | } 5 | 6 | if (RocketChat.authz.hasPermission(this.userId, 'view-other-user-channels') !== true) { 7 | return this.ready(); 8 | } 9 | 10 | return RocketChat.models.Subscriptions.findByRoomIdAndRoles(rid, role, { 11 | fields: { 12 | rid: 1, 13 | name: 1, 14 | roles: 1, 15 | u: 1 16 | }, 17 | sort: { 18 | name: 1 19 | } 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/rocketchat-channel-settings-mail-messages/client/lib/startup.js: -------------------------------------------------------------------------------- 1 | import resetSelection from '../resetSelection'; 2 | Meteor.startup(() => { 3 | RocketChat.ChannelSettings.addOption({ 4 | group: ['room'], 5 | id: 'mail-messages', 6 | template: 'channelSettingsMailMessages', 7 | validation() { 8 | return RocketChat.authz.hasAllPermission('mail-messages'); 9 | } 10 | }); 11 | RocketChat.callbacks.add('roomExit', () => resetSelection(false), RocketChat.callbacks.priority.MEDIUM, 'room-exit-mail-messages'); 12 | }); 13 | --------------------------------------------------------------------------------