|
|
|
@ -54,7 +54,7 @@ Template.messageBox.helpers({ |
|
|
|
|
return RocketChat.settings.get('Message_ShowFormattingTips') && (RocketChat.Markdown || RocketChat.MarkdownCode || katexSyntax()); |
|
|
|
|
}, |
|
|
|
|
canJoin() { |
|
|
|
|
return RocketChat.roomTypes.verifyShowJoinLink(this._id); |
|
|
|
|
return Meteor.userId() && RocketChat.roomTypes.verifyShowJoinLink(this._id); |
|
|
|
|
}, |
|
|
|
|
joinCodeRequired() { |
|
|
|
|
const code = Session.get(`roomData${ this._id }`); |
|
|
|
@ -179,6 +179,13 @@ Template.messageBox.helpers({ |
|
|
|
|
}, |
|
|
|
|
showSandstorm() { |
|
|
|
|
return Meteor.settings['public'].sandstorm && !Meteor.isCordova; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
anonymousRead() { |
|
|
|
|
return (Meteor.userId() == null) && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true; |
|
|
|
|
}, |
|
|
|
|
anonymousWrite() { |
|
|
|
|
return (Meteor.userId() == null) && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true && RocketChat.settings.get('Accounts_AllowAnonymousWrite') === true; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -248,6 +255,21 @@ Template.messageBox.events({ |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'click .register'(event) { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
event.preventDefault(); |
|
|
|
|
return Session.set('forceLogin', true); |
|
|
|
|
}, |
|
|
|
|
'click .register-anonymous'(event) { |
|
|
|
|
event.stopPropagation(); |
|
|
|
|
event.preventDefault(); |
|
|
|
|
return Meteor.call('registerUser', {}, function(error, loginData) { |
|
|
|
|
if (loginData && loginData.token) { |
|
|
|
|
return Meteor.loginWithToken(loginData.token); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
'focus .input-message'(event, instance) { |
|
|
|
|
KonchatNotification.removeRoomNotification(this._id); |
|
|
|
|
chatMessages[this._id].input = instance.find('.input-message'); |
|
|
|
|