anear-js-api 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,6 +104,8 @@ class AnearMessaging {
104
104
  timerStarter = () => timer.start(timeoutMsecs)
105
105
  }
106
106
  }
107
+ logger.debug(`ensureParticipant(timeRemaining: ${timeRemaining})`)
108
+
107
109
  return [timerStarter, timeRemaining]
108
110
  }
109
111
 
@@ -440,7 +442,7 @@ class AnearMessaging {
440
442
  logger.debug(`**** LEAVE PARTICIPANT **** participantLeaveMessagingCallback(participant: ${participantId})`)
441
443
 
442
444
  // pause the participant timer if one was active. The participant may return shortly
443
- // and we can resume this timer
445
+ // and we can resume this timer.
444
446
  this.pauseParticipantTimer(participantId)
445
447
  }
446
448
 
@@ -644,6 +646,8 @@ class AnearMessaging {
644
646
  timeout: { timeoutMsecs, timeRemaining }
645
647
  }
646
648
 
649
+ logger.debug(`publishMessage(timeoutMsecs=${timeoutMsecs}}, timeRemaining=${timeRemaining})`)
650
+
647
651
  await this.publishChannelMessage(
648
652
  channel,
649
653
  messageType,
@@ -163,13 +163,13 @@ class AnearEvent extends JsonApiResource {
163
163
  await this.spectatorRefreshEventCallback()
164
164
  }
165
165
 
166
- async publishEventParticipantsMessage(message, timeoutMilliseconds=0) {
166
+ async publishEventParticipantsMessage(message, timeoutMsecs=0) {
167
167
  await this.messaging.publishEventParticipantsMessage(
168
168
  this,
169
169
  this.participants.active,
170
170
  this.css,
171
171
  message,
172
- timeoutMilliseconds
172
+ timeoutMsecs
173
173
  )
174
174
  }
175
175
 
@@ -177,14 +177,14 @@ class AnearEvent extends JsonApiResource {
177
177
  await this.messaging.publishEventSpectatorsMessage(this, this.css, message)
178
178
  }
179
179
 
180
- async publishEventPrivateMessage(participant, message, timeoutMilliseconds=0) {
180
+ async publishEventPrivateMessage(participant, message, timeoutMsecs=0) {
181
181
  await this.messaging.publishEventPrivateMessage(
182
182
  this,
183
183
  participant,
184
184
  PrivateDisplayMessageType,
185
185
  this.css,
186
186
  message,
187
- timeoutMilliseconds
187
+ timeoutMsecs
188
188
  )
189
189
  }
190
190
 
@@ -131,9 +131,7 @@ class Participants {
131
131
  // the host is not an eligible participant and isn't active nor idle
132
132
  this._host = rec
133
133
  } else {
134
- this._participants[anearParticipant.id] = rec
135
- anearParticipant.timestamp = this.currentTimestamp
136
- anearParticipant.state = ActiveState
134
+ this.markActive(anearParticipant)
137
135
  }
138
136
  return rec
139
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anear-js-api",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Javascript Developer API for Anear Apps",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {