@andyet/simplewebrtc
Advanced tools
Comparing version 1.16.0 to 1.17.0
@@ -8,2 +8,3 @@ import { ThunkAction } from 'redux-thunk'; | ||
peerAddress: string; | ||
userAddress?: string; | ||
affiliation: string; | ||
@@ -58,2 +59,3 @@ role: string; | ||
requestingMedia: 'video' | 'audio' | 'none' | undefined; | ||
userAddress?: string; | ||
} | ||
@@ -111,3 +113,3 @@ /** | ||
*/ | ||
export declare function kickPeer(roomAddress: string, peerAddress: string): KickPeer; | ||
export declare function kickPeer(roomAddress: string, peerAddress: string): ThunkAction<void, State, void, KickPeer>; | ||
/** | ||
@@ -114,0 +116,0 @@ * @description |
@@ -26,3 +26,4 @@ "use strict"; | ||
role: opts.role, | ||
roomAddress | ||
roomAddress, | ||
userAddress: opts.userAddress | ||
}, | ||
@@ -103,8 +104,14 @@ type: Constants_1.PEER_ONLINE | ||
function kickPeer(roomAddress, peerAddress) { | ||
return { | ||
payload: { | ||
peerAddress, | ||
roomAddress | ||
}, | ||
type: Constants_1.KICK_PEER | ||
return (dispatch, getState) => { | ||
dispatch({ | ||
payload: { | ||
peerAddress, | ||
roomAddress | ||
}, | ||
type: Constants_1.KICK_PEER | ||
}); | ||
const client = Selectors_1.getClient(getState()); | ||
if (client) { | ||
client.kickPeerFromRoom(roomAddress, peerAddress); | ||
} | ||
}; | ||
@@ -111,0 +118,0 @@ } |
@@ -46,3 +46,3 @@ "use strict"; | ||
return { | ||
kick: () => dispatch(Actions.kickPeer(props.peer.roomAddress, props.peer.address)), | ||
kick: () => dispatch(Actions.kickPeer(props.peer.roomAddress, props.peer.userAddress)), | ||
mute: () => dispatch(Actions.mutePeer(props.peer.address)), | ||
@@ -49,0 +49,0 @@ setVolumeLimit: (volume) => dispatch(Actions.limitPeerVolume(props.peer.address, volume)), |
@@ -43,4 +43,4 @@ export declare const SET_USER_PREFERENCE = "@andyet/SET_USER_PREFERENCE"; | ||
export declare const SET_VIDEO_RESOLUTION_TIERS = "@andyet/SET_VIDEO_RESOLUTION_TIERS"; | ||
export declare const SDK_VERSION = "1.16.0"; | ||
export declare const SDK_VERSION = "1.17.0"; | ||
export declare const DIRECTION_INCOMING = "incoming"; | ||
export declare const DIRECTION_OUTGOING = "outgoing"; |
@@ -49,4 +49,4 @@ "use strict"; | ||
// ==================================================================== | ||
exports.SDK_VERSION = '1.16.0'; | ||
exports.SDK_VERSION = '1.17.0'; | ||
exports.DIRECTION_INCOMING = 'incoming'; | ||
exports.DIRECTION_OUTGOING = 'outgoing'; |
@@ -69,2 +69,3 @@ import Hark from './lib/Hark'; | ||
readonly roomAddress: string; | ||
readonly userAddress?: string; | ||
readonly address: string; | ||
@@ -71,0 +72,0 @@ readonly displayName: string; |
{ | ||
"name": "@andyet/simplewebrtc", | ||
"version": "1.16.0", | ||
"version": "1.17.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@types/node": "^12.6.8", |
@@ -36,2 +36,3 @@ "use strict"; | ||
speaking: false, | ||
userAddress: action.payload.userAddress, | ||
volume: -Infinity, | ||
@@ -38,0 +39,0 @@ volumeLimit: 0.8 |
@@ -31,2 +31,3 @@ import 'webrtc-adapter'; | ||
destroyRoom(roomAddress: string): Promise<void>; | ||
kickPeerFromRoom(roomAddress: string, peerAddress: string): Promise<void>; | ||
sendRoomPresence(roomAddress: string, opts?: object): void; | ||
@@ -33,0 +34,0 @@ sendAllRoomsPresence(opts?: object): void; |
@@ -114,3 +114,4 @@ "use strict"; | ||
requestingMedia: (pres.mmuc || {}).media, | ||
role: pres.muc.role | ||
role: pres.muc.role, | ||
userAddress: pres.muc.jid | ||
})); | ||
@@ -120,3 +121,3 @@ }); | ||
if (pres.muc.statusCodes && pres.muc.statusCodes.indexOf('110') >= 0) { | ||
this.dispatch(Actions.leaveRoom(pres.from)); | ||
this.dispatch(Actions.leaveRoom(Stanza.JID.toBare(pres.from))); | ||
return; | ||
@@ -198,2 +199,5 @@ } | ||
} | ||
async kickPeerFromRoom(roomAddress, peerAddress) { | ||
await this.xmpp.setRoomAffiliation(roomAddress, peerAddress, 'outcast'); | ||
} | ||
sendRoomPresence(roomAddress, opts = {}) { | ||
@@ -200,0 +204,0 @@ const state = this.getState(); |
Sorry, the diff of this file is too big to display
508297
15135