Only send initial message once
This commit is contained in:
parent
b830735e08
commit
9a2990fe4a
@ -84,11 +84,13 @@ Template.optionsBar.events
|
||||
'click .private-chat-user-entry': (event) -> # clicked a user's name to begin private chat
|
||||
setInSession 'display_chatPane', true
|
||||
setInSession "inChatWith", @userId
|
||||
me = getInSession("userId")
|
||||
|
||||
if Meteor.Chat.find({'message.chat_type': 'PRIVATE_CHAT', $or: [{'message.from_userid': me, 'message.to_userid': @userId},{'message.from_userid': @userId, 'message.to_userid': me}]}).fetch().length is 0
|
||||
messageForServer =
|
||||
"message": "#{getUsersName()} has joined private chat with #{@user.name}."
|
||||
"chat_type": "PRIVATE_CHAT"
|
||||
"from_userid": getInSession("userId")
|
||||
"from_userid": me
|
||||
"from_username": getUsersName()
|
||||
"from_tz_offset": "240"
|
||||
"to_username": @user.name
|
||||
@ -96,7 +98,6 @@ Template.optionsBar.events
|
||||
"from_lang": "en"
|
||||
"from_time": getTime()
|
||||
"from_color": "0"
|
||||
|
||||
Meteor.call "sendChatMessagetoServer", getInSession("meetingId"), messageForServer
|
||||
|
||||
Template.tabButtons.events
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
<!-- Displays the list of options available -->
|
||||
<template name="optionsBar">
|
||||
<p>Select a person to chat with privately</p>
|
||||
<p> Select a person to chat with privately</p>
|
||||
<div class="private-chat-user-box">
|
||||
{{#Layout template="scrollWindow" id="privateChatUserScrollWindow"}}
|
||||
{{#contentFor region="scrollContents"}}
|
||||
|
Loading…
Reference in New Issue
Block a user