Subdir images (#3695)

* possible fix to images in subdir

* fix to images in subdir

* fix type of key to loginTokenKey

* change to method of getting login token to use _storedLoginToken

* add back escape function
pull/3703/head
Alec 10 years ago committed by Rodrigo Nascimento
parent 07996bba70
commit 80a3c2e27b
  1. 2
      lib/fileUpload.coffee
  2. 2
      packages/rocketchat-message-attachments/client/messageAttachment.coffee

@ -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

@ -8,7 +8,7 @@ Template.messageAttachment.helpers
else
url = url + '&' + query
return url
return Meteor.absoluteUrl().replace(/\/$/, '') + __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + url
parsedText: ->
renderMessageBody { msg: this.text }

Loading…
Cancel
Save