Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop: (103 commits)
  Tokenize message on message render to prevent re processing
  using branding image from main app
  Remove unecessary logs
  Do not load all settings to process.env
  Fix preview of images in mobile
  re order settings
  code formatting
  Enforce data in body params
  Get integration name from body
  Set user role in integration update too
  Added new color variables to the theme editor
  embarrassing mistake
  make sample data into array
  fix livechat triggers not triggering
  added livechat branding
  Added infinite scroll to files list
  Allow searching for logged in user in userAutocomplete
  Added "Jump to" and infinite scroll to message search results
  Enable triggers in messages to users
  Rename integration api routes, add apis remove, info and sample
  ...
  • Loading branch information
engelgabriel committed Dec 28, 2015
2 parents c6cc615 + 07a2263 commit 6e51f5b
Show file tree
Hide file tree
Showing 150 changed files with 2,622 additions and 780 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ tramp
ecosystem.json
pm2.json
settings.json
build.sh
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ rocketchat:lib
rocketchat:authorization
rocketchat:autolinker
rocketchat:channel-settings
rocketchat:channel-settings-mail-messages
rocketchat:colors
rocketchat:custom-oauth
rocketchat:emojione
Expand Down
9 changes: 5 additions & 4 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ [email protected]
[email protected]
[email protected]
alanning:[email protected]
aldeed:[email protected].1
aldeed:[email protected].2
arunoda:[email protected]
[email protected]
[email protected]_1
Expand All @@ -25,7 +25,7 @@ cfs:[email protected]
[email protected]
chrismbeckett:[email protected]_1
[email protected]
cosmos:[email protected].2
cosmos:[email protected].3
dandv:[email protected]
[email protected]
[email protected]
Expand All @@ -39,7 +39,7 @@ [email protected]
[email protected]
[email protected]
[email protected]
emojione:emojione@1.5.2
emojione:emojione@2.0.0
[email protected]
[email protected]
francocatena:[email protected]
Expand Down Expand Up @@ -75,7 +75,7 @@ [email protected]
[email protected]
[email protected]
matb33:[email protected]
mdg:validation-error@0.1.0
mdg:validation-error@0.2.0
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -125,6 +125,7 @@ rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0E163286C20D07B9787EB

WORKDIR /app

RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/develop.rocket.chat-v.latest.tgz" -o rocket.chat.tgz \
RUN curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.tgz" -o rocket.chat.tgz \
&& tar zxvf ./rocket.chat.tgz \
&& rm ./rocket.chat.tgz \
&& cd /app/bundle/programs/server \
Expand Down
27 changes: 0 additions & 27 deletions client/methods/saveRoomName.coffee

This file was deleted.

26 changes: 13 additions & 13 deletions client/startup/startup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ Meteor.startup ->
window.lastMessageWindow = {}
window.lastMessageWindowHistory = {}

@defaultUserLanguage = ->
@defaultAppLanguage = ->
lng = window.navigator.userLanguage || window.navigator.language || 'en'
# Fix browsers having all-lowercase language settings eg. pt-br, en-us
re = /([a-z]{2}-)([a-z]{2})/
if re.test lng
lng = lng.replace re, (match, parts...) -> return parts[0] + parts[1].toUpperCase()
return lng

@defaultUserLanguage = ->
return RocketChat.settings.get('Language') || defaultAppLanguage()

loadedLaguages = []

setLanguage = (language) ->
Expand All @@ -35,17 +38,14 @@ Meteor.startup ->
Function(localeFn)()
moment.locale(language)

Tracker.autorun (c) ->
if Meteor.user()?.language?
c.stop()

if localStorage.getItem('userLanguage') isnt Meteor.user().language
localStorage.setItem("userLanguage", Meteor.user().language)
setLanguage Meteor.user().language
if isRtl localStorage.getItem "userLanguage"
$('html').addClass "rtl"
Meteor.subscribe("userData", () ->
userLanguage = Meteor.user()?.language
userLanguage ?= defaultUserLanguage()

userLanguage = localStorage.getItem("userLanguage")
userLanguage ?= defaultUserLanguage()
if localStorage.getItem('userLanguage') isnt userLanguage
localStorage.setItem('userLanguage', userLanguage)
if isRtl localStorage.getItem 'userLanguage'
$('html').addClass "rtl"

setLanguage userLanguage
setLanguage userLanguage
)
File renamed without changes.
13 changes: 11 additions & 2 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"API_Embed" : "Embed",
"API_EmbedDisabledFor" : "Disable Embed for Users",
"API_EmbedDisabledFor_Description" : "Comma-separated list of usernames",
"Archive" : "Archive",
"are_also_typing" : "are also typing",
"are_typing" : "are typing",
"Are_you_sure" : "Are you sure?",
Expand Down Expand Up @@ -139,6 +140,8 @@
"Disable_New_Room_Notification" : "Disable New Room Notification",
"Do_you_want_to_change_to_s_question" : "Do you want to change to <strong>%s</strong>?",
"Drop_to_upload_file" : "Drop to upload file",
"Duplicate_archived_channel_name" : "An archived Channel with name '%s' exists",
"Duplicate_archived_private_group_name" : "An archived Private Group with name '%s' exists",
"Duplicate_channel_name" : "A Channel with name '%s' exists",
"Duplicate_private_group_name" : "A Private Group with name '%s' exists",
"E-mail" : "E-mail",
Expand Down Expand Up @@ -200,6 +203,7 @@
"Invalid_name" : "The name must not be empty",
"Invalid_pass" : "The password must not be empty",
"Invalid_room_name" : "<strong>%s</strong> is not a valid room name,<br/> use only letters, numbers and dashes",
"Invalid_room_type" : "<strong>%s</strong> is not a valid room type.",
"Invalid_Secret_URL" : "Invalid Secret URL",
"Invalid_secret_URL_message" : "The URL provided is invalid.",
"invisible" : "invisible",
Expand All @@ -216,8 +220,8 @@
"italics" : "italics",
"join" : "Join",
"Join_the_Community" : "Join the Community",
"Jump_to_recent_messages" : "Jump to recent messages",
"Jump_to_message" : "Jump to message",
"Jump_to_recent_messages" : "Jump to recent messages",
"Language" : "Language",
"Language_Version" : "English Version",
"Last_login" : "Last login",
Expand Down Expand Up @@ -314,6 +318,7 @@
"No_groups_yet" : "You have no private groups yet.",
"No_livechats" : "You have no livechats.",
"No_permission_to_view_room" : "You don't have permission to view this room",
"No_results_found" : "No results found",
"no_tokens_for_this_user" : "There are no tokens for this user",
"No_user_with_username_%s_was_found" : "No user with username <strong>\"%s\"</strong> was found!",
"Not_allowed" : "Not allowed",
Expand Down Expand Up @@ -382,10 +387,12 @@
"Restart" : "Restart",
"Restart_the_server" : "Restart the server",
"Room" : "Room",
"Room_archived" : "Room archived",
"Room_has_been_deleted" : "Room has been deleted",
"Room_name_changed" : "Room name changed to: <em>__room_name__</em> by <em>__user_by__</em>",
"Room_name_changed_successfully" : "Room name changed successfully",
"Room_not_found" : "Room not found",
"Room_unarchived" : "Room unarchived",
"Room_uploaded_file_list" : "Files List",
"Room_uploaded_file_list_empty" : "No files available.",
"room_user_count" : "%s users",
Expand Down Expand Up @@ -425,6 +432,7 @@
"Settings_updated" : "Settings updated",
"Should_be_a_URL_of_an_image" : "Should be a URL of an image.",
"Should_exists_a_user_with_this_username" : "The user must already exist.",
"Showing_archived_results" : "<p>Showing <b>%s</b> archived results</p>",
"Showing_online_users" : "Showing <b>__total_online__</b> of __total__ users",
"Showing_results" : "<p>Showing <b>%s</b> results</p>",
"Silence" : "Silence",
Expand Down Expand Up @@ -476,6 +484,7 @@
"There_is_no_integrations" : "There is no integrations",
"This_is_a_push_test_messsage" : "This is a push test messsage",
"True" : "True",
"Unarchive" : "Unarchive",
"Unmute_user" : "Unmute user",
"Unnamed" : "Unnamed",
"Unread_Rooms" : "Unread Rooms",
Expand Down Expand Up @@ -547,4 +556,4 @@
"Your_entry_has_been_deleted" : "Your entry has been deleted.",
"Your_Open_Source_solution" : "Your own Open Source chat solution",
"Your_push_was_sent_to_s_devices" : "Your push was sent to %s devices"
}
}
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ "$1" == "development" ]; then
fi

cd $ROOTPATH
curl -fSL "https://s3.amazonaws.com/rocketchatbuild/demo.rocket.chat-v.latest.tgz" -o rocket.chat.tgz
curl -fSL "https://s3.amazonaws.com/rocketchatbuild/rocket.chat-develop.tgz" -o rocket.chat.tgz
tar zxf rocket.chat.tgz && rm rocket.chat.tgz
cd $ROOTPATH/bundle/programs/server
npm install
Expand Down
4 changes: 4 additions & 0 deletions lib/fileUpload.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ if UploadFS?
uid = cookie.get('rc_uid', rawCookies) if rawCookies?
token = cookie.get('rc_token', rawCookies) if rawCookies?

if not uid?
uid = req.query.rc_uid
token = req.query.rc_token

unless uid and token and RocketChat.models.Users.findOneByIdAndLoginToken(uid, token)
res.writeHead 403
return false
Expand Down
7 changes: 5 additions & 2 deletions packages/rocketchat-authorization/server/startup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Meteor.startup ->
{ _id: 'edit-other-user-info',
roles : ['admin']}

{ _id: 'edit-other-user-password',
roles : ['admin']}

{ _id: 'assign-admin-role',
roles : ['admin']}

Expand Down Expand Up @@ -100,14 +103,14 @@ Meteor.startup ->
roles : ['admin']}

{ _id: 'manage-integrations',
roles : ['admin']}
roles : ['admin', 'bot']}
]

#alanning:roles
roles = _.pluck(Roles.getAllRoles().fetch(), 'name');

for permission in permissions
RocketChat.models.Permissions.upsert( permission._id, {$setOnInsert : permission })
RocketChat.models.Permissions.upsert( permission._id, {$set: permission })
for role in permission.roles
unless role in roles
Roles.createRole role
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Meteor.startup ->
RocketChat.ChannelSettings.addOption
id: 'mail-messages'
template: 'channelSettingsMailMessages'
validation: ->
return RocketChat.authz.hasAllPermission('mail-messages')

RocketChat.callbacks.add 'roomExit', (mainNode) ->
messagesBox = $('.messages-box')
if messagesBox.get(0)?
instance = Blaze.getView(messagesBox.get(0))?.templateInstance()
instance?.resetSelection(false)
, RocketChat.callbacks.priority.MEDIUM, 'room-exit-mail-messages'
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.flex-tab {
.mail-message {
form {
margin-top: 20px;

.input-line.double-col {
margin-bottom: 20px;

label {
line-height: 15px;
}

div {
line-height: 15px;
i.octicon {
font-size: 13px;
opacity: 0.4;
vertical-align: top;
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Template.channelSettingsMailMessages.events
'click button.mail-messages': (e, t) ->
Session.set 'channelSettingsMailMessages', Session.get('openedRoom')
RocketChat.TabBar.setTemplate('mailMessagesInstructions')
view = Blaze.getView($('.messages-box')[0])
view?.templateInstance?().resetSelection?(true)

Template.channelSettingsMailMessages.onCreated ->
view = Blaze.getView($('.messages-box')[0])
view?.templateInstance?().resetSelection?(false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template name="channelSettingsMailMessages">
<li>
<label>{{_ "Mail_Messages"}}</label>
<div>
<button type="button" class="button primary mail-messages">{{_ "Choose_messages"}}</button>
</div>
</li>
</template>
Loading

0 comments on commit 6e51f5b

Please sign in to comment.