Skip to content
Snippets Groups Projects
Commit cca26bac authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files
parents 6e83832b 7d576acc
No related branches found
No related tags found
No related merge requests found
@UserFullName = {}
@UserAndRoom = new Meteor.Collection null
@ChatMessageHistory = new Meteor.Collection null
@ChatRoom = new Meteor.Collection 'data.ChatRoom'
@ChatSubscription = new Meteor.Collection 'data.ChatSubscription'
@ChatMessage = new Meteor.Collection 'data.ChatMessage'
# ,
# transform: (room) ->
# if room.t is 'd' and Meteor.userId()?
# if not UserFullName[Meteor.userId()]?
# user = Meteor.users.findOne Meteor.userId()
# UserFullName[Meteor.userId()] = user.name
# regex = new RegExp('\\|?' + UserFullName[Meteor.userId()] + '\\|?')
# room.name = room.name.replace(regex, '')
# return room
@ChatMessage = new Meteor.Collection 'data.ChatMessage',
transform: (message) ->
message.html = message.msg
message = RocketChat.callbacks.run 'renderMessage', message
# console.log 'transform'
return message
Meteor.startup ->
ChatMessage.find().observe
......
......@@ -18,7 +18,7 @@ Template.chatMessageDashboard.helpers
if _.trim(this.msg) isnt ''
msg = this.msg
msg = this.html
# Separate text in code blocks and non code blocks
msgParts = msg.split(/(```.*\n[\s\S]*?\n```)/)
......
......@@ -42,7 +42,7 @@
</span>
{{/if}}
<div>
{{#emojione}}{{preProcessingMessage msg}}{{/emojione}}
{{#emojione}}{{preProcessingMessage}}{{/emojione}}
</div>
{{/if}}
{{/if}}
......
......@@ -7,7 +7,7 @@ class Me
constructor: (message) ->
# If message starts with /me, replace it for text formatting
if message.msg.indexOf('/me ') is 0
message.msg = '_' + message.msg.substr(4) + '_'
message.html = '_' + message.html.replace('/me ','') + '_'
return message
RocketChat.callbacks.add 'beforeSaveMessage', Me
RocketChat.callbacks.add 'renderMessage', Me
@UserFullName = {}
@ChatMessage = new Meteor.Collection 'data.ChatMessage'
@ChatRoom = new Meteor.Collection 'data.ChatRoom'
# ,
# transform: (room) ->
# if room.t is 'd' and Meteor.userId()?
# if not UserFullName[Meteor.userId()]?
# user = Meteor.users.findOne Meteor.userId()
# UserFullName[Meteor.userId()] = user.name
# regex = new RegExp('\\|?' + UserFullName[Meteor.userId()] + '\\|?')
# room.name = room.name.replace(regex, '')
# return room
@ChatSubscription = new Meteor.Collection 'data.ChatSubscription'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment