Skip to content
Snippets Groups Projects
Commit e85f4623 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Change urls of messages from Array of String to Array of Objects

parent 545698f6
No related merge requests found
......@@ -15,7 +15,7 @@ Meteor.methods
message.u = Meteor.users.findOne Meteor.userId(), fields: username: 1
if urls = message.msg.match /([A-Za-z]{3,9}):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+=!:~%\/\.@\,\w]+)?\??([-\+=&!:;%@\/\.\,\w]+)?#?([\w]+)?)?/g
message.urls = urls
message.urls = urls.map (url) -> url: url
message = RocketChat.callbacks.run 'beforeSaveMessage', message
......
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