Skip to content

added roomName in createdPeer event#405

Open
csturiale wants to merge 16 commits into
simplewebrtc:masterfrom
Objectway:master
Open

added roomName in createdPeer event#405
csturiale wants to merge 16 commits into
simplewebrtc:masterfrom
Objectway:master

Conversation

@csturiale

Copy link
Copy Markdown

createdPeer is an event called for each joined room then I suppose that is better to have roomName as parameter in the callback to manage presence or autosend message in the room channel better.

@fippo

fippo commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

that looks useful. Can you revert the changes to package.json and the bundle (we do that after merging) and squash your commits into a single one please?

@csturiale

Copy link
Copy Markdown
Author

done

@xdumaine

xdumaine commented Mar 7, 2016

Copy link
Copy Markdown
Contributor

@csturiale it doesn't look like you updated. Maybe you forgot to push?

Squashed commits:
[7ab0253] revert to package.json and bundle (+3 squashed commits)
Squashed commits:
[9532b6f] 2.1.2
[cb97b07] make latest-v2 and bundle
[ceed4e6] 2.1.1
@csturiale

Copy link
Copy Markdown
Author

sorry I think it is ok now

@fippo

fippo commented Mar 19, 2016

Copy link
Copy Markdown
Contributor

looked at it again. Adding it in just one of the three events would be very inconsistent.

And I don't understand the use-case. One of the underlying assumptions is that you're not in more than a single room.

@loureirorg

Copy link
Copy Markdown

Has this been merged to master? To me, the roomName is always "simplewebrtc".

@Zythyr Zythyr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal was so that 'createdPeer' event emits the roomName in addition to the peer info. However the emit on line 350 doesn't include the roomName.

Comment thread simplewebrtc.js
@@ -346,7 +348,7 @@ SimpleWebRTC.prototype.joinRoom = function (name, cb) {
}
});
self.emit('createdPeer', peer);

@Zythyr Zythyr Apr 18, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.emit('createdPeer', peer, roomName);

@Zythyr

Zythyr commented Apr 18, 2018

Copy link
Copy Markdown
Contributor

In this issue (https://github.com/andyet/SimpleWebRTC/issues/692) I reported that createdPeer get emitted when a peer is already connect to the room and tries to connect again. Thus this event gets duplicate emits. Should we also update the code to prevent this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants