## 방정보.참여자 정보 수정.

1. isJoinRoom 값에 따른 화면별 처리.

## 강퇴기능 씽크 제반 작업.
1.  모바일 씽크작업.
2. 강퇴 메시지 처리.

## 사용자 초대 ::
1. 모바일과 씽크.
2. 초대시 방정보 갱신되지 않는 문제 수정.
This commit is contained in:
leejinho 2019-12-09 16:52:43 +09:00
parent 39aaa78e4e
commit 2dcd0036d0
17 changed files with 210 additions and 59 deletions

View File

@ -84,11 +84,7 @@ import {
FileViewerDialogData,
FileViewerDialogResult
} from '@app/layouts/common/dialogs/file-viewer.dialog.component';
import {
CONST,
FileUtil,
StickerFilesInfo
} from '@ucap-webmessenger/core';
import { CONST, FileUtil, StickerFilesInfo } from '@ucap-webmessenger/core';
import { PerfectScrollbarComponent } from 'ngx-perfect-scrollbar';
import { StatusCode } from '@ucap-webmessenger/api';
import {
@ -311,7 +307,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
case RoomType.Bot:
case RoomType.Allim:
return this.userInfoList
.filter(user => user.seq !== this.loginRes.userSeq)
.filter(user => user.seq !== this.loginRes.userSeq && user.isJoinRoom)
.map(user => user.name);
}
@ -323,7 +319,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
if (this.roomInfo.roomType === RoomType.Single) {
return user.seq !== this.loginRes.userSeq;
} else {
return true;
return user.isJoinRoom;
}
})
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))
@ -959,15 +955,17 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
type: UserSelectDialogType.EditChatMember,
title: 'Edit Chat Member',
curRoomUser: this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
)
}
});
if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = this.userInfoList.map(
userInfo => userInfo.seq
);
const userSeqs: number[] = this.userInfoList.map(userInfo => {
if (userInfo.isJoinRoom) {
return userInfo.seq;
}
});
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0

View File

@ -66,7 +66,9 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
.pipe(
select(AppStore.MessengerSelector.RoomSelector.selectUserinfolist),
tap(userInfoList => {
this.userInfoList = userInfoList;
this.userInfoList = userInfoList
.filter(userInfo => userInfo.isJoinRoom === true)
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
})
)
.subscribe();
@ -104,15 +106,17 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
type: UserSelectDialogType.EditChatMember,
title: 'Edit Chat Member',
curRoomUser: this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
)
}
});
if (!!result && !!result.choice && result.choice) {
const userSeqs: number[] = this.userInfoList.map(
userInfo => userInfo.seq
);
const userSeqs: number[] = this.userInfoList.map(userInfo => {
if (userInfo.isJoinRoom) {
return userInfo.seq;
}
});
if (!!result.selectedUserList && result.selectedUserList.length > 0) {
result.selectedUserList.forEach(user => {
if (userSeqs.indexOf(user.seq) < 0) {

View File

@ -37,7 +37,10 @@ import {
SSVC_TYPE_ROOM_FONT_UPD_NOTI,
InviteNotification,
UpdateNotification as RoomUpdateNotification,
SSVC_TYPE_ROOM_UPD_RES
SSVC_TYPE_ROOM_UPD_RES,
SSVC_TYPE_ROOM_EXIT_FORCING_RES,
SSVC_TYPE_ROOM_EXIT_RES,
SSVC_TYPE_ROOM_INVITE_RES
} from '@ucap-webmessenger/protocol-room';
import {
StatusProtocolService,
@ -342,6 +345,20 @@ export class AppNotificationService {
.pipe(
tap(notiOrRes => {
switch (notiOrRes.SSVC_TYPE) {
case SSVC_TYPE_ROOM_INVITE_RES:
{
const noti = notiOrRes as InviteNotification;
this.logger.debug(
'Notification::roomProtocolService::InviteNotification',
noti
);
this.store.dispatch(
RoomStore.inviteSuccess({
roomSeq: noti.roomSeq
})
);
}
break;
case SSVC_TYPE_ROOM_UPD_RES:
{
const noti = notiOrRes as RoomUpdateNotification;
@ -393,15 +410,31 @@ export class AppNotificationService {
);
}
break;
case SSVC_TYPE_ROOM_EXIT_FORCING_NOTI:
case SSVC_TYPE_ROOM_EXIT_FORCING_RES:
{
// 내가 강퇴 진행.
const noti = notiOrRes as ExitForcingNotification;
this.logger.debug(
'Notification::roomProtocolService::ExitForcingNotification',
noti
);
this.store.dispatch(
RoomStore.exitForcingNotification({
RoomStore.exitForcingNotificationRes({
noti
})
);
}
break;
case SSVC_TYPE_ROOM_EXIT_FORCING_NOTI:
{
// 내가 강퇴 됨.
const noti = notiOrRes as ExitForcingNotification;
this.logger.debug(
'Notification::roomProtocolService::ExitForcingNotification',
noti
);
this.store.dispatch(
RoomStore.exitForcingNotificationNoti({
noti
})
);

View File

@ -52,8 +52,12 @@ export const exitNotification = createAction(
props<{ noti: ExitNotification }>()
);
export const exitForcingNotification = createAction(
'[Messenger::Room] Exit Forcing Notification',
export const exitForcingNotificationRes = createAction(
'[Messenger::Room] Exit Forcing Notification // Do Forcing',
props<{ noti: ExitForcingNotification }>()
);
export const exitForcingNotificationNoti = createAction(
'[Messenger::Room] Exit Forcing Notification // Forcing Me',
props<{ noti: ExitForcingNotification }>()
);

View File

@ -36,7 +36,9 @@ import {
UpdateTimerSetResponse
} from '@ucap-webmessenger/protocol-room';
import * as AppStore from '@app/store';
import * as ChatStore from '@app/store/messenger/chat';
import * as SyncStore from '@app/store/messenger/sync';
import {
info,
@ -44,7 +46,8 @@ import {
infoFailure,
inviteNotification,
exitNotification,
exitForcingNotification,
exitForcingNotificationRes,
exitForcingNotificationNoti,
updateFontNotification,
updateOnlyAlarm,
update,
@ -266,16 +269,29 @@ export class Effects {
inviteSuccess$ = createEffect(() =>
this.actions$.pipe(
ofType(inviteSuccess),
map(action => {
return ChatStore.selectedRoom({ roomSeq: action.roomSeq });
// const loginInfo = this.sessionStorageService.get<LoginInfo>(
// KEY_LOGIN_INFO
// );
// return info({
// roomSeq: action.roomSeq,
// isDetail: true,
// localeCode: loginInfo.localeCode
// });
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select(AppStore.MessengerSelector.SyncSelector.selectRoomSyncDate)
)
),
map(([action, roomInfo, roomSyncDate]) => {
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
SyncStore.room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
return ChatStore.selectedRoom({ roomSeq: action.roomSeq });
}
})
)
);
@ -338,16 +354,67 @@ export class Effects {
},
{ dispatch: false }
);
exitForcingNotification$ = createEffect(
exitForcingNotificationRes$ = createEffect(
() => {
return this.actions$.pipe(
ofType(exitForcingNotification),
map(action => action.noti),
tap(noti => {})
ofType(exitForcingNotificationRes),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select(AppStore.MessengerSelector.SyncSelector.selectRoomSyncDate)
)
),
tap(([action, roomInfo, roomSyncDate]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(
ChatStore.selectedRoom({ roomSeq: action.noti.roomSeq })
);
}
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
SyncStore.room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
})
);
},
{ dispatch: false }
);
exitForcingNotificationNoti$ = createEffect(
() => {
return this.actions$.pipe(
ofType(exitForcingNotificationNoti),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
)
),
tap(([action, roomInfo]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(ChatStore.clearSelectedRoom());
}
this.store.dispatch(
exitSuccess({
res: {
roomSeq: action.noti.roomSeq
}
})
);
})
);
},
{ dispatch: false }
);
updateFontNotification$ = createEffect(
() => {
return this.actions$.pipe(

View File

@ -15,6 +15,8 @@ export interface Info<T = {}> {
sentMessageJson?: T;
// 수신자수
receiverCount: number;
// 강퇴 요청자명
exitForcingRequestUserName?: string;
}
export function isCopyable(eventType: EventType): boolean {

View File

@ -107,7 +107,7 @@ export const decodeEventJson = (
case EventType.Before2MonthsAgo:
return message;
case EventType.ForcedExit:
return message;
return decodeCharacterEventJson(message);
case EventType.ChatbotStart:
return message;
case EventType.ChatbotEnd:

View File

@ -60,6 +60,8 @@ export const decodeInfoData: ProtocolDecoder<InfoData> = (
if (info.length > 5) {
const eventType = info[1] as EventType;
const exitForcingRequestUserName = info.length > 6 ? info[6] : '';
infoList.push({
seq: Number(info[0]),
type: eventType,
@ -67,7 +69,8 @@ export const decodeInfoData: ProtocolDecoder<InfoData> = (
sendDate: info[3],
sentMessage: info[4],
sentMessageJson: decodeEventJson(eventType, info[4]),
receiverCount: Number(info[5])
receiverCount: Number(info[5]),
exitForcingRequestUserName
});
}
}

View File

@ -40,7 +40,7 @@ export interface SendResponse extends ProtocolResponse {
// 알림상태(s) PC 경우에만 관여됨 N: 푸시를 보내지 않은 이벤트 S: 푸시를 보낸 이벤트
pushStatus: PushStatus;
// 강퇴 타입(s)
ForcedExitType: string;
forcedExitType: string;
// 요청자 이름(s)
senderName: string;
/** Decoded Info */
@ -63,7 +63,7 @@ export interface SendNotification extends ProtocolNotification {
/** 알림상태(s) PC 경우에만 관여됨 N: 푸시를 보내지 않은 이벤트 S: 푸시를 보낸 이벤트 */
pushStatus: PushStatus;
/** 강퇴 타입(s) */
ForcedExitType: string;
forcedExitType: string;
/** 요청자 이름(s) */
senderName: string;
/** 사용자아이디(s) */
@ -94,6 +94,8 @@ export const decodeSend: ProtocolDecoder<SendResponse> = (
const sendDate = message.bodyList[3];
const sentMessage = message.bodyList[4];
const receiverCount = message.bodyList[5] || 0;
const forcedExitType = message.bodyList[7];
const senderName = message.bodyList[8];
return decodeProtocolMessage(message, {
roomSeq: message.bodyList[0],
@ -103,8 +105,8 @@ export const decodeSend: ProtocolDecoder<SendResponse> = (
message: sentMessage,
receiverCount,
pushStatus: message.bodyList[6] as PushStatus,
ForcedExitType: message.bodyList[7],
senderName: message.bodyList[8],
forcedExitType,
senderName,
info: {
seq,
type: eventType,
@ -112,7 +114,8 @@ export const decodeSend: ProtocolDecoder<SendResponse> = (
sendDate,
sentMessage,
sentMessageJson: decodeEventJson(eventType, sentMessage),
receiverCount
receiverCount,
exitForcingRequestUserName: senderName
}
} as SendResponse);
};
@ -125,6 +128,8 @@ export const decodeSendNotification: ProtocolDecoder<SendNotification> = (
const sendDate = message.bodyList[3];
const sentMessage = message.bodyList[4];
const receiverCount = message.bodyList[5] || 0;
const forcedExitType = message.bodyList[7];
const senderName = message.bodyList[8];
return decodeProtocolMessage(message, {
roomSeq: message.bodyList[0],
@ -134,8 +139,8 @@ export const decodeSendNotification: ProtocolDecoder<SendNotification> = (
message: sentMessage,
receiverCount,
pushStatus: message.bodyList[6] as PushStatus,
ForcedExitType: message.bodyList[7],
senderName: message.bodyList[8],
forcedExitType,
senderName,
id: message.bodyList[9],
companyCode: message.bodyList[10],
info: {
@ -145,7 +150,8 @@ export const decodeSendNotification: ProtocolDecoder<SendNotification> = (
sendDate,
sentMessage,
sentMessageJson: decodeEventJson(eventType, sentMessage),
receiverCount
receiverCount,
exitForcingRequestUserName: senderName
}
} as SendNotification);
};

View File

@ -115,7 +115,7 @@ export const decodeUserShortData: ProtocolDecoder<UserShortData> = (
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
isJoinRoom: info[3],
isJoinRoom: info[3] === 'Y' ? true : false,
lastReadEventSeq: Number(info[4]),
madn: info[5],
hardSadn: info[6],
@ -192,17 +192,17 @@ export interface UserStatusOfflineResponse extends ProtocolResponse {
// 사용자SEQ(n)...
userSeqs: number[];
}
export const encodeUserStatusOffline: ProtocolEncoder<
UserStatusOfflineRequest
> = (req: UserStatusOfflineRequest) => {
export const encodeUserStatusOffline: ProtocolEncoder<UserStatusOfflineRequest> = (
req: UserStatusOfflineRequest
) => {
const bodyList: PacketBody[] = [];
bodyList.push({ type: PacketBodyValue.String, value: req.roomSeq });
return bodyList;
};
export const decodeUserStatusOffline: ProtocolDecoder<
UserStatusOfflineResponse
> = (message: ProtocolMessage) => {
export const decodeUserStatusOffline: ProtocolDecoder<UserStatusOfflineResponse> = (
message: ProtocolMessage
) => {
let userSeqs: number[] = [];
if (message.bodyList.length > 1) {
userSeqs = message.bodyList.slice(1);

View File

@ -27,7 +27,10 @@ import {
SSVC_TYPE_ROOM_EXIT_NOTI,
SSVC_TYPE_ROOM_EXIT_FORCING_NOTI,
SSVC_TYPE_ROOM_FONT_UPD_NOTI,
SSVC_TYPE_ROOM_UPD_RES
SSVC_TYPE_ROOM_UPD_RES,
SSVC_TYPE_ROOM_EXIT_FORCING_RES,
SSVC_TYPE_ROOM_EXIT_RES,
SSVC_TYPE_ROOM_INVITE_RES
} from '../types/service';
import {
OpenRequest,
@ -131,6 +134,13 @@ export class RoomProtocolService {
filter(message => message.serviceType === SVC_TYPE_ROOM),
tap(message => {
switch (message.subServiceType) {
case SSVC_TYPE_ROOM_INVITE_RES:
{
this.notificationSubject.next(
decodeInviteNotification(message)
);
}
break;
case SSVC_TYPE_ROOM_UPD_RES:
{
this.notificationSubject.next(
@ -151,6 +161,13 @@ export class RoomProtocolService {
this.notificationSubject.next(decodeExitNotification(message));
}
break;
case SSVC_TYPE_ROOM_EXIT_FORCING_RES:
{
this.notificationSubject.next(
decodeExitForcingNotification(message)
);
}
break;
case SSVC_TYPE_ROOM_EXIT_FORCING_NOTI:
{
this.notificationSubject.next(

View File

@ -109,7 +109,7 @@ export const decodeRoomUserData: ProtocolDecoder<RoomUserData> = (
seq: Number(info[0]),
name: info[1],
profileImageFile: info[2],
isJoinRoom: info[3],
isJoinRoom: info[3] === 'Y' ? true : false,
lastReadEventSeq: Number(info[4]),
madn: info[5],
hardSadn: info[6],

View File

@ -47,6 +47,12 @@ export class InformationComponent implements OnInit {
this.contents = `${m.sentMessage}님이 퇴장하셨습니다.`;
}
break;
case EventType.ForcedExit:
{
const m = this.message as Info<JoinEventJson>;
this.contents = `${m.exitForcingRequestUserName} 님이 ${m.sentMessage} 님을 퇴장 시키셨습니다.`;
}
break;
case EventType.RenameRoom:
{
const m = this.message as Info<RenameRoomEventJson>;

View File

@ -40,6 +40,12 @@
class="information-msg"
>
</ucap-chat-message-box-information>
<ucap-chat-message-box-information
*ngSwitchCase="EventType.ForcedExit"
[message]="message"
class="information-msg"
>
</ucap-chat-message-box-information>
<ucap-chat-message-box-information
*ngSwitchCase="EventType.RenameRoom"
[message]="message"

View File

@ -135,6 +135,7 @@ export class MessagesComponent implements OnInit {
if (
info.type === EventType.Join ||
info.type === EventType.Exit ||
info.type === EventType.ForcedExit ||
info.type === EventType.RenameRoom ||
info.type === EventType.NotificationForTimerRoom ||
info.type === EventType.GuideForRoomTimerChanged

View File

@ -97,7 +97,10 @@ export class ListItemComponent implements OnInit {
let roomName = '';
this.roomUserInfo.forEach(
(roomUserInfo: RoomUserInfo | UserInfoShort, index: number) => {
if (this.loginRes.userSeq === roomUserInfo.seq) {
if (
this.loginRes.userSeq === roomUserInfo.seq ||
!roomUserInfo.isJoinRoom
) {
return;
}
if ('' === roomName.trim()) {

View File

@ -2,7 +2,7 @@ import {
EventType,
EventJson,
FileEventJson,
MassTextEventJson,
MassTextEventJson
} from '@ucap-webmessenger/protocol-event';
import { FileType } from '@ucap-webmessenger/protocol-file';
@ -79,7 +79,7 @@ export class StringUtil {
'수요일',
'목요일',
'금요일',
'토요일',
'토요일'
];
const weekKorShortName = ['일', '월', '화', '수', '목', '금', '토'];
@ -91,7 +91,7 @@ export class StringUtil {
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Saturday'
];
const weekEngShortName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
@ -158,6 +158,7 @@ export class StringUtil {
switch (eventType) {
case EventType.Join:
case EventType.Exit:
case EventType.ForcedExit:
case EventType.RenameRoom:
case EventType.NotificationForTimerRoom:
case EventType.GuideForRoomTimerChanged: