Skip to content

Commit

Permalink
Merge pull request RocketChat#1 from RocketChat/develop
Browse files Browse the repository at this point in the history
merge with upstream
  • Loading branch information
JamesHGreen authored Jul 28, 2016
2 parents db7e294 + 0040e5a commit 5407a26
Show file tree
Hide file tree
Showing 247 changed files with 7,697 additions and 11,733 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ packages/rocketchat-livechat/public/external.js
packages/rocketchat-autolinker/lib/Autolinker.min.js
packages/rocketchat-livechat/lib/ua-parser.js
packages/rocketchat-videobridge/client/public/external_api.js
packages/rocketchat-lib/client/lib/localforage.min.js
packages/rocketchat-livechat/app/client/lib/Autolinker.min.js
4 changes: 3 additions & 1 deletion .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ rocketchat:markdown
rocketchat:mentions
rocketchat:mentions-flextab
rocketchat:message-attachments
rocketchat:message-mark-as-unread
rocketchat:message-pin
rocketchat:message-star
rocketchat:migrations
Expand Down Expand Up @@ -103,6 +104,7 @@ rocketchat:ui-login
rocketchat:ui-master
rocketchat:ui-message
rocketchat:ui-sidenav
rocketchat:ui-vrecord
rocketchat:version
rocketchat:webrtc
rocketchat:wordpress
Expand All @@ -118,7 +120,6 @@ konecty:multiple-instances-status
konecty:nrr
konecty:user-presence

arunoda:streams
chrismbeckett:toastr
dispatch:run-as-user
francocatena:status
Expand Down Expand Up @@ -150,3 +151,4 @@ todda00:friendly-slugs
underscorestring:underscore.string
yasaricli:slugify
yasinuslu:blaze-meta
rocketchat:slashcommands-open
10 changes: 6 additions & 4 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ accounts-oauth@1.1.8
accounts-password@1.1.4
accounts-twitter@1.0.6
aldeed:simple-schema@1.5.3
arunoda:streams@0.1.17
autoupdate@1.2.4
babel-compiler@5.8.24_1
babel-runtime@0.1.4
Expand Down Expand Up @@ -40,7 +39,7 @@ ecmascript-runtime@0.2.6
edgee:slingshot@0.7.1
ejson@1.0.7
email@1.0.8
emojione:emojione@2.1.4
emojione:emojione@2.2.5
facebook@1.2.2
fastclick@1.0.7
francocatena:status@1.5.1
Expand All @@ -62,7 +61,7 @@ jparker:gravatar@0.4.1
jquery@1.11.4
kadira:blaze-layout@2.3.0
kadira:flow-router@2.10.1
kenton:accounts-sandstorm@0.4.0
kenton:accounts-sandstorm@0.4.1
konecty:change-case@2.3.0
konecty:delayed-task@1.0.0
konecty:mongo-counter@0.0.3
Expand Down Expand Up @@ -163,6 +162,7 @@ rocketchat:markdown@0.0.1
rocketchat:mentions@0.0.1
rocketchat:mentions-flextab@0.0.1
rocketchat:message-attachments@0.0.1
rocketchat:message-mark-as-unread@0.0.1
rocketchat:message-pin@0.0.1
rocketchat:message-star@0.0.1
rocketchat:migrations@0.0.1
Expand All @@ -183,12 +183,13 @@ rocketchat:slashcommands-kick@0.0.1
rocketchat:slashcommands-leave@0.0.1
rocketchat:slashcommands-me@0.0.1
rocketchat:slashcommands-mute@0.0.1
rocketchat:slashcommands-open@0.0.1
rocketchat:slashcommands-topic@0.0.1
rocketchat:slashcommands-unarchive@0.0.1
rocketchat:sms@0.0.1
rocketchat:spotify@0.0.1
rocketchat:statistics@0.0.1
rocketchat:streamer@0.4.0
rocketchat:streamer@0.5.0
rocketchat:theme@0.0.1
rocketchat:tooltip@0.0.1
rocketchat:tutum@0.0.1
Expand All @@ -200,6 +201,7 @@ rocketchat:ui-login@0.1.0
rocketchat:ui-master@0.1.0
rocketchat:ui-message@0.1.0
rocketchat:ui-sidenav@0.1.0
rocketchat:ui-vrecord@0.0.1
rocketchat:version@1.0.0
rocketchat:videobridge@0.2.0
rocketchat:webrtc@0.0.1
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ install:
- export PATH="$HOME/.meteor:$PATH"
before_script:
- mkdir /tmp/build
- nvm install 4.4
- npm install
- npm run lint
script:
- nvm use 0.12
- meteor build /tmp/build
before_deploy:
- source ".travis/setartname.sh"
Expand Down
65 changes: 65 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
- Self Host
- Docker
- Multiple Deployment Options (Heroku, Digital Ocean, Sandstorm, etc.)
- Authentication Options
- OAuth
- SAML
- LDAP
- CAS
- Facebook, Github, Google, etc.
- I18N: More than 30 languages so far
- File Uploading
- Drag-and-drop
- Upload to file system
- AWS + CDN
- Live chat
- SMS Integration
- Rich Media
- Audio Calls
- Video Conferencing
- Screensharing
- Notifications
- Desktop and Mobile
- Use your own gateway
- Use @all to notify everyone in the room (configurable to max. users)
- Receive missed messages in your e-mail
- Apps
- Mobile
- Native
- Integrations
- Hubot
- Incoming / Outgoing Webhooks
- Data Importer
- Import from Slack
- Import from Hipchat
- Slack Bridge
- Profiles
- Custom avatars
- Text Decorations
- Mentions
- Link Preview
- Embedded videos
- Markdown
- Code, single or multi-line
- TexMath
- Emojis
- Reactions
- Message editing
- Editing is as simple as using your arrow keys for picking the right message to edit
- Setup to keep history of edits or discard the previous text
- Show or hide edited/deleted status
- History
- Search
- Full-text search
- Regex search
- Add stars to rooms and mark them as favorites
- Add stars and pins to messages
- Star messages that are important to you. Only you have access to your stars.
- Pin messages that are important to everyone.
- Access your starred/pinned and messages you were mentioned on quickly through side bar buttons
- REST Api
- Roles and Permissions
- Public and Private multi-user rooms
- One-on-one conversations
- Off-the-record messaging (messages are encrypted and transiently saved on database)
- Slashcommands
8 changes: 4 additions & 4 deletions client/routes/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ BlazeLayout.setRoot 'body'

FlowRouter.subscriptions = ->
Tracker.autorun =>
RoomManager.init()
@register 'userData', Meteor.subscribe('userData')
@register 'activeUsers', Meteor.subscribe('activeUsers')
@register 'admin-settings', Meteor.subscribe('admin-settings')
if Meteor.userId()
RoomManager.init()
@register 'userData', Meteor.subscribe('userData')
@register 'activeUsers', Meteor.subscribe('activeUsers')


FlowRouter.route '/',
Expand Down
3 changes: 2 additions & 1 deletion client/startup/unread.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Meteor.startup ->
if subscription.alert is true
unreadAlert = ''

readMessage.refreshUnreadMark(subscription.rid)
if RoomManager.openedRooms[subscription.t + subscription.name]
readMessage.refreshUnreadMark(subscription.rid)

menu.updateUnreadBars()

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rocketchat:

# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
image: rocketchat/hubot-rocketchat
image: rocketchat/hubot-rocketchat:v0.1.4
environment:
- ROCKETCHAT_URL=rocketchat:3000
- ROCKETCHAT_ROOM=GENERAL
Expand Down
4 changes: 2 additions & 2 deletions lib/fileUpload.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if UploadFS?
cookie = new Cookies()
if Meteor.isClient
document.cookie = 'rc_uid=' + escape(Meteor.userId()) + '; path=/'
document.cookie = 'rc_token=' + escape(Meteor._localStorage.getItem('Meteor.loginToken')) + '; path=/'
document.cookie = 'rc_token=' + escape(Accounts._storedLoginToken()) + '; path=/'

Meteor.fileStore = new UploadFS.store.GridFS
collection: RocketChat.models.Uploads.model
Expand Down Expand Up @@ -64,6 +64,6 @@ if UploadFS?
initFileStore()
else
Tracker.autorun (c) ->
if Meteor.userId() and RocketChat.settings.subscription.ready()
if Meteor.userId() and RocketChat.settings.cachedCollection.ready.get()
initFileStore()
c.stop()
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Rocket.Chat",
"scripts": {
"start": "meteor run",
"lint": "eslint .",
"deploy": "npm run build && pm2 startOrRestart pm2.json"
},
"devDependencies": {
"eslint": "^3.1.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hasPermission = (permissions, scope, strategy) ->
unless userId
return false

unless RocketChat.authz.subscription.ready()
unless RocketChat.authz.cachedCollection.ready.get()
return false

permissions = [].concat permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
@ChatPermissions = new Meteor.Collection 'rocketchat_permissions'
RocketChat.authz.cachedCollection = new RocketChat.CachedCollection({ name: 'permissions', eventType: 'onAll' })
@ChatPermissions = RocketChat.authz.cachedCollection.collection

RocketChat.authz.cachedCollection.init()
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Meteor.subscribe('scopedRoles', 'Subscriptions');

if (_.isUndefined(RocketChat.models.Subscriptions)) {
RocketChat.models.Subscriptions = {};
}
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-authorization/client/lib/models/Users.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Meteor.subscribe('scopedRoles', 'Users');

if (_.isUndefined(RocketChat.models.Users)) {
RocketChat.models.Users = {};
}
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-authorization/client/startup.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Meteor.subscribe 'roles'

RocketChat.authz.subscription = Meteor.subscribe 'permissions'

RocketChat.AdminBox.addOption
href: 'admin-permissions'
i18nLabel: 'Permissions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Template.permissionsRole.helpers
filter:
exceptions: Template.instance().usersInRole.get()?.fetch()
selector: (match) ->
return { username: match }
return { term: match }
sort: 'username'
}
]
Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-authorization/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Package.onUse(function(api) {
// publications
api.addFiles('server/publications/permissions.js', 'server');
api.addFiles('server/publications/roles.coffee', 'server');
api.addFiles('server/publications/scopedRoles.js', 'server');
api.addFiles('server/publications/usersInRole.coffee', 'server');

// methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
Meteor.publish('permissions', function() {
return RocketChat.models.Permissions.find({});
Meteor.methods({
'permissions/get'() {
this.unblock();

return RocketChat.models.Permissions.find().fetch();
},

'permissions/sync'(updatedAt) {
this.unblock();

return RocketChat.models.Permissions.dinamicFindChangesAfter('find', updatedAt);
}
});


RocketChat.models.Permissions.on('change', (type, ...args) => {
const records = RocketChat.models.Permissions.getChangedRecords(type, args[0]);

for (const record of records) {
RocketChat.Notifications.notifyAll('permissions-changed', type, record);
}
});

This file was deleted.

1 change: 1 addition & 0 deletions packages/rocketchat-authorization/server/startup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Meteor.startup ->
{ _id: 'manage-integrations', roles : ['admin'] }
{ _id: 'manage-own-integrations', roles : ['bot'] }
{ _id: 'manage-oauth-apps', roles : ['admin'] }
{ _id: 'mention-all', roles : ['admin', 'moderator', 'owner', 'user'] }
{ _id: 'mute-user', roles : ['admin', 'moderator', 'owner'] }
{ _id: 'remove-user', roles : ['admin', 'moderator', 'owner'] }
{ _id: 'run-import', roles : ['admin'] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Template.mailMessagesInstructions.helpers
filter:
exceptions: Template.instance().selectedUsers.get()
selector: (match) ->
return { username: match }
return { term: match }
sort: 'username'
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ Meteor.startup ->
user_by: message.u?.username
room_topic: message.msg
}

RocketChat.MessageTypes.registerType
id: 'room_changed_description'
system: true
message: 'room_changed_description'
data: (message) ->
user_by: message.u?.username
room_description: message.msg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Template.channelSettings.helpers
return ChatRoom.findOne(@rid, { fields: { topic: 1 }})?.topic
roomTopicUnescaped: ->
return s.unescapeHTML ChatRoom.findOne(@rid, { fields: { topic: 1 }})?.topic
roomDescription: ->
return ChatRoom.findOne(@rid, { fields: { description: 1 }})?.description
archivationState: ->
return ChatRoom.findOne(@rid, { fields: { archived: 1 }})?.archived
archivationStateDescription: ->
Expand Down Expand Up @@ -109,6 +111,11 @@ Template.channelSettings.onCreated ->
Meteor.call 'saveRoomSettings', room._id, 'roomType', @$('input[name=roomType]:checked').val(), (err, result) ->
return handleError err if err
toastr.success TAPi18n.__ 'Room_type_changed_successfully'
when 'roomDescription'
if @validateRoomTopic()
Meteor.call 'saveRoomSettings', room._id, 'roomDescription', @$('input[name=roomDescription]').val(), (err, result) ->
return handleError err if err
toastr.success TAPi18n.__ 'Room_description_changed_successfully'
when 'archivationState'
if @$('input[name=archivationState]:checked').val() is 'true'
if room.archived isnt true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ <h2>{{_ "Room_Info"}}</h2>
{{/if}}
</div>
</li>
{{#if notDirect}}
<li>
<label>{{_ "Description"}}</label>
<div>
{{#if editing 'roomDescription'}}
<input type="text" name="roomDescription" value="{{roomDescription}}" class="editing" /> <button type="button" class="button secondary cancel">{{_ "Cancel"}}</button><button type="button" class="button primary save">{{_ "Save"}}</button>
{{else}}
<span>{{roomDescription}}{{#if canEdit}} <i class="icon-pencil" data-edit="roomDescription"></i>{{/if}}</span>
{{/if}}
</div>
</li>
{{/if}}
{{#if notDirect}}
<li>
<label>{{_ "Type"}}</label>
Expand Down
Loading

0 comments on commit 5407a26

Please sign in to comment.