diff --git a/frontend/src/app/pages/altitude/chat/components/channel-list/channel-list.component.ts b/frontend/src/app/pages/altitude/chat/components/channel-list/channel-list.component.ts index 8b965c8..c54d693 100644 --- a/frontend/src/app/pages/altitude/chat/components/channel-list/channel-list.component.ts +++ b/frontend/src/app/pages/altitude/chat/components/channel-list/channel-list.component.ts @@ -37,7 +37,7 @@ export class ChannelListComponent { protected readonly groupedChannels = computed(() => { const channels = this.channels(); const groups: { type: ChatChannel['type'], channels: ChatChannel[] }[] = []; - const types: ChatChannel['type'][] = ['SERVER', 'DM', 'PARTY', 'GAC']; + const types: ChatChannel['type'][] = ['SERVER', 'DM', 'PARTY', 'GAC', 'SPY']; for (const type of types) { const typeChannels = channels.filter(c => c.type === type); @@ -62,7 +62,7 @@ export class ChannelListComponent { if (channel.type === 'PARTY') { return this.chatService.partieMap().get(channel.name) ?? channel.name; } - if (channel.type === 'DM') { + if (channel.type === 'DM' || channel.type === 'SPY') { return this.chatService.userNameMap().get(channel.name) ?? channel.name; } return channel.name; diff --git a/frontend/src/app/pages/altitude/chat/objects/chat-channel.object.ts b/frontend/src/app/pages/altitude/chat/objects/chat-channel.object.ts index 8670caf..aabfc32 100644 --- a/frontend/src/app/pages/altitude/chat/objects/chat-channel.object.ts +++ b/frontend/src/app/pages/altitude/chat/objects/chat-channel.object.ts @@ -1,5 +1,5 @@ export interface ChatChannel { name: string; - type: 'SERVER' | 'DM' | 'PARTY' | 'GAC'; + type: 'SERVER' | 'DM' | 'PARTY' | 'GAC' | 'SPY'; unreadMessages: number; } diff --git a/frontend/src/app/pages/altitude/chat/objects/chat-message.object.ts b/frontend/src/app/pages/altitude/chat/objects/chat-message.object.ts index b661785..adeaa46 100644 --- a/frontend/src/app/pages/altitude/chat/objects/chat-message.object.ts +++ b/frontend/src/app/pages/altitude/chat/objects/chat-message.object.ts @@ -10,5 +10,5 @@ export interface ChatMessage { messageJson: MiniMessageComponent; notBlocked: boolean; channelName?: string; - channelType?: 'SERVER' | 'DM' | 'PARTY' | 'GAC'; + channelType?: 'SERVER' | 'DM' | 'PARTY' | 'GAC' | 'SPY'; } diff --git a/frontend/src/app/pages/altitude/chat/service/chat.service.ts b/frontend/src/app/pages/altitude/chat/service/chat.service.ts index 41d5e41..0508940 100644 --- a/frontend/src/app/pages/altitude/chat/service/chat.service.ts +++ b/frontend/src/app/pages/altitude/chat/service/chat.service.ts @@ -126,11 +126,12 @@ export class ChatService implements OnDestroy { } if (message.type === 'MSG') { const uuid = this.authService.getUuid(); - if (message.uuid === uuid) { - return null; + if (message.receiver === uuid) { + this.updateUserNameMap(message.uuid) + return {name: message.uuid, type: 'DM'}; } this.updateUserNameMap(message.receiver) - return {name: message.receiver, type: 'DM'}; + return {name: message.receiver, type: 'SPY'}; } return {name: message.server, type: 'SERVER'}; }