Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish Rooms Socket & start Working on DM #76

Merged
merged 13 commits into from
Nov 5, 2023
Binary file modified .DS_Store
Binary file not shown.
Binary file modified backend/.DS_Store
Binary file not shown.
26 changes: 13 additions & 13 deletions backend/code/src/friends/friends.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,29 @@ export class FriendsService {
},
});

return friends.map((friend: any) => {
return friends.map((friend) => {
if (friend.from.userId === userId) {
friend = friend.to as any;
const avatar: PICTURE = {
thumbnail: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_48,w_48/${friend.avatar}`,
medium: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_72,w_72/${friend.avatar}`,
large: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_128,w_128/${friend.avatar}`,
thumbnail: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_48,w_48/${friend.to.avatar}`,
medium: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_72,w_72/${friend.to.avatar}`,
large: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_128,w_128/${friend.to.avatar}`,
};
delete friend.avatar;
return {
...friend.to,
id: friend.to.userId,
firstname: friend.to.firstName,
lastname: friend.to.lastName,
avatar,
};
} else {
friend = friend.from as any;
const avatar: PICTURE = {
thumbnail: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_48,w_48/${friend.avatar}`,
medium: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_72,w_72/${friend.avatar}`,
large: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_128,w_128/${friend.avatar}`,
thumbnail: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_48,w_48/${friend.from.avatar}`,
medium: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_72,w_72/${friend.from.avatar}`,
large: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_128,w_128/${friend.from.avatar}`,
};
delete friend.avatar;
return {
...friend.from,
id: friend.from.userId,
firstname: friend.from.firstName,
lastname: friend.from.lastName,
avatar,
};
}
Expand Down
1 change: 1 addition & 0 deletions backend/code/src/gateways/gateways.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class Gateways implements OnGatewayConnection {

@OnEvent('sendMessages')
sendMessage(message: MessageFormatDto) {
console.log("recive msg !")
const chanellname: string = `Romm:${message.roomId}`;
this.server.to(chanellname).emit('message', message);
}
Expand Down
6 changes: 5 additions & 1 deletion backend/code/src/rooms/rooms.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,11 @@ export class RoomsService {
},
},
is_banned: true,
is_mueted: true,
},
});
return members.map((member) => {
const filtredmembers = members.filter((member) => !member.is_banned || user.is_admin)
return filtredmembers.map((member) => {
if (!member.is_banned || user.is_admin) {
const avatar: PICTURE = {
thumbnail: `https://res.cloudinary.com/trandandan/image/upload/c_thumb,h_48,w_48/${member.user.avatar}`,
Expand All @@ -421,6 +423,8 @@ export class RoomsService {
firstname: member.user.firstName,
lastname: member.user.lastName,
avatar: avatar,
isBaned: member.is_banned,
isMuted: member.is_mueted,
};
}
});
Expand Down
Binary file modified frontend/.DS_Store
Binary file not shown.
80 changes: 80 additions & 0 deletions frontend/code/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react-hot-toast": "^2.4.1",
"react-icons": "^4.10.1",
"react-konva": "^18.2.10",
"socket.io-client": "^4.7.2",
"react-scripts": "^5.0.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4",
Expand Down
Loading
Loading