|
|
@@ -106,14 +106,21 @@ const view = pid => {
|
|
106
|
106
|
router.push({ path: `/matches/${pid}` })
|
|
107
|
107
|
}
|
|
108
|
108
|
const chat = async pid => {
|
|
|
109
|
+ // create a chatter reference from the current profile
|
|
109
|
110
|
const chatter = currentProfile.chatter
|
|
110
|
|
- console.log('mock sender:', pid)
|
|
111
|
|
- const res = await chatter.publish(chatter.subscriptions[0], {
|
|
112
|
|
- title: 'pong',
|
|
113
|
|
- description: 'This is my first realtime message!',
|
|
|
111
|
+ // console.log('mock sender:', pid)
|
|
|
112
|
+
|
|
|
113
|
+ /** publish a new message to the chatter with the channel and the message
|
|
|
114
|
+ *
|
|
|
115
|
+ * title is optional
|
|
|
116
|
+ */
|
|
|
117
|
+ const res = await chatter.publish(chatter.subscriptions[1], {
|
|
|
118
|
+ title: 'New Message',
|
|
|
119
|
+ description: 'This is the start of a chat conversation!',
|
|
114
|
120
|
})
|
|
|
121
|
+ // PubNub response will be a timecode of when the message was published
|
|
115
|
122
|
console.log('res:', res)
|
|
116
|
|
- console.log('channels:', chatter.subscriptions)
|
|
|
123
|
+
|
|
117
|
124
|
//router.push({ path: `/chat/${pid}` })
|
|
118
|
125
|
}
|
|
119
|
126
|
const pass = () => {
|