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

feat: show displayname instead of username in video #50

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ private VideoCallResponseDTO startGroupVideoCall(

messageService.createAndSendVideoCallStartedMessage(
chatById.getGroupId(),
authenticatedUser.getUsername(),
groupVideoRoom,
videoCallUrls.getUserVideoUrl(),
createVideoCallRequest.getInitiatorDisplayName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ public MessageControllerApi getMessageControllerApi() {

public void createAndSendVideoCallStartedMessage(
String groupId,
String username,
VideoRoomEntity videoRoomEntity,
String guestVideoUrl,
String initiatorDisplayName,
String initiatorRcUserId) {
AliasMessageDTO message =
createVideoChatMessage(
username,
initiatorDisplayName,
videoRoomEntity,
guestVideoUrl,
"Videochat has started. Initiating moderator has joined the call.",
Expand All @@ -80,10 +79,13 @@ public void createAndSendVideoCallStartedMessage(
}

public void createAndSendVideoCallEndedMessage(
String groupId, String username, VideoRoomEntity videoRoomEntity, String guestVideoUrl) {
String groupId,
String userDisplayName,
VideoRoomEntity videoRoomEntity,
String guestVideoUrl) {
AliasMessageDTO message =
createVideoChatMessage(
username,
userDisplayName,
videoRoomEntity,
guestVideoUrl,
"Videochat has ended. All moderators have left the call.",
Expand All @@ -94,12 +96,12 @@ public void createAndSendVideoCallEndedMessage(
}

public void createAndSendVideoCallEndedMessage(
String groupId, String username, VideoRoomEntity videoRoomEntity) {
createAndSendVideoCallEndedMessage(groupId, username, videoRoomEntity, "");
String groupId, String userDisplayName, VideoRoomEntity videoRoomEntity) {
createAndSendVideoCallEndedMessage(groupId, userDisplayName, videoRoomEntity, "");
}

private AliasMessageDTO createVideoChatMessage(
String username,
String userDisplayName,
VideoRoomEntity videoRoomEntity,
String guestVideoUrl,
String messageTitle,
Expand All @@ -108,14 +110,14 @@ private AliasMessageDTO createVideoChatMessage(

message.setContent(
getMessageContent(
username, videoRoomEntity, guestVideoUrl, messageTitle, message, eventType)
userDisplayName, videoRoomEntity, guestVideoUrl, messageTitle, message, eventType)
.toString());
message.setVideoCallMessageDTO(new VideoCallMessageDTO().eventType(eventType));
return message;
}

JSONObject getMessageContent(
String username,
String userDisplayName,
VideoRoomEntity videoRoomEntity,
String guestVideoUrl,
String messageTitle,
Expand All @@ -125,7 +127,7 @@ JSONObject getMessageContent(
messageContent.put("title", messageTitle);
message.setMessageType(MessageType.VIDEOCALL);
messageContent.put("date", videoRoomEntity.getCreateDate());
messageContent.put("moderator_user", username);
messageContent.put("moderator_user", userDisplayName);
messageContent.put("note", guestVideoUrl);
long calculateDurationInSecods = calculateDurationInSeconds(videoRoomEntity);
messageContent.put("durationSeconds", calculateDurationInSecods);
Expand Down
Loading