family connect
This commit is contained in:
@@ -24,15 +24,35 @@ export class SocketToolsService {
|
||||
this.socket.connect();
|
||||
}
|
||||
|
||||
public familyInvite(item){
|
||||
public familyInviteConnect(item){
|
||||
console.log(item);
|
||||
const msgPart = {
|
||||
type: 'FAMILY_INVITE',
|
||||
type: 'FAMILY_INVITE_CONNECT',
|
||||
target_room: this.sessionDataProviderService.session+'-'+item.uid,
|
||||
from: item
|
||||
};
|
||||
let Vv = this.sessionDataProviderService.getFamilyRoom()+"-"+item.uid;
|
||||
this.emmitSocketEvent("send_message",msgPart, Vv);
|
||||
this.emmitSocketEvent("send_message",msgPart, Vv);
|
||||
}
|
||||
|
||||
|
||||
public familyInvite(item, activitySelect:string){
|
||||
// console.log(item);
|
||||
const msgPart = {
|
||||
type: 'FAMILY_INVITE',
|
||||
activity: activitySelect,
|
||||
target_room: this.sessionDataProviderService.session+'-'+item.uid,
|
||||
from: item
|
||||
};
|
||||
let targetPrivateRoom = this.sessionDataProviderService.getFamilyRoom()+"-"+item.uid;
|
||||
this.emmitSocketEvent("send_message",msgPart, targetPrivateRoom);
|
||||
// note that target room is where we will chat or connect to talk
|
||||
// after sending the message for invite , wait in the room
|
||||
setTimeout(()=>{
|
||||
this.joinSocketRoom( msgPart.target_room); // this is the room where we will talk or connect
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
public joinSocketRoom(socketRoom){
|
||||
this.socket.emit("join_room", socketRoom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user