diff options
-rw-r--r-- | src/App.vue | 22 | ||||
-rw-r--r-- | src/utils/signaling.js | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/App.vue b/src/App.vue index 9cda146f9..f4bc4b001 100644 --- a/src/App.vue +++ b/src/App.vue @@ -171,6 +171,14 @@ export default { */ EventBus.$once('conversationsReceived', () => { if (this.$route.name === 'conversation') { + if (!getCurrentUser()) { + EventBus.$once('joinedConversation', () => { + // FIXME Refresh the data now that the user joined the conversation + // The join request returns this data already, but it's lost in the signaling code + this.fetchSingleConversation(this.token) + }) + } + // Adjust the page title once the conversation list is loaded this.setPageTitle(this.getConversationName(this.token), false) // Update current token in the token store @@ -298,7 +306,19 @@ export default { */ const response = await fetchConversation(token) // this.$store.dispatch('purgeConversationsStore') - this.$store.dispatch('addConversation', response.data.ocs.data) + const conversationData = response.data.ocs.data + this.$store.dispatch('addConversation', conversationData) + this.$store.dispatch('addParticipant', { + token, + participant: { + userId: getCurrentUser() ? getCurrentUser().uid : '', // TODO Does this work for public shares while being logged in, etc? + displayName: getCurrentUser() ? getCurrentUser().displayName : '', // TODO guest name from localstore? + inCall: conversationData.participantFlags, + lastPing: conversationData.lastPing, + sessionId: conversationData.sessionId, + participantType: conversationData.participantType, + }, + }) /** * Emits a global event that is used in App.vue to update the page title once the diff --git a/src/utils/signaling.js b/src/utils/signaling.js index a4f70a10d..1b39e1760 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -856,7 +856,9 @@ Signaling.Standalone.prototype.joinRoom = function(token /*, password */) { // callback, leading to two entries for anonymous participants. console.log('Not connected to signaling server yet, defer joining room', token) this.currentRoomToken = token - return + return new Promise((resolve, reject) => { + // FIXME ? + }) } return Signaling.Base.prototype.joinRoom.apply(this, arguments) |