mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
send direct message
This commit is contained in:
@@ -46,6 +46,9 @@ import { UserTypingLocalRepository } from 'src/app/module/chat/data/repository/u
|
||||
import { UserTypingRemoteRepositoryService } from 'src/app/module/chat/data/repository/user-typing-live-data-source.service';
|
||||
import { MessageLocalDataSourceService } from 'src/app/module/chat/data/repository/message/message-local-data-source.service';
|
||||
import { MessageEnum } from 'src/app/module/chat/domain/use-case/message-create-use-case.service';
|
||||
import { RoomType } from "src/app/module/chat/domain/entity/group";
|
||||
import { RoomTable } from 'src/app/module/chat/infra/database/dexie/schema/room';
|
||||
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -108,7 +111,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
audioPermissionStatus: 'granted' | 'denied' | 'prompt' | null = null
|
||||
sessionStore = SessionStore
|
||||
|
||||
roomData$: DexieObservable<RoomListItemOutPutDTO | undefined>
|
||||
roomData$: DexieObservable<RoomTable | undefined>
|
||||
roomStatus$: DexieObservable<Boolean >
|
||||
roomMessage$: DexieObservable<MessageTable[]>
|
||||
roomMembers$: DexieObservable<MemberTable[] | undefined>
|
||||
@@ -119,7 +122,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
selectedMessage: any = null;
|
||||
emojis: string[] = ['😊', '😂', '❤️', '👍', '😢']; // Add more emojis as needed
|
||||
textField = ''
|
||||
|
||||
roomType!: RoomType
|
||||
|
||||
messageReceiveSubject: Subscription
|
||||
messageDeleteSubject: Subscription
|
||||
@@ -159,6 +162,14 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
|
||||
this.roomData$ = this.RoomLocalRepository.getRoomByIdLive(this.roomId)
|
||||
|
||||
this.roomData$.subscribe(e => {
|
||||
console.log(e)
|
||||
if(e) {
|
||||
this.roomType = e.roomType
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
this.getMessages();
|
||||
this.listenToIncomingMessage();
|
||||
@@ -526,7 +537,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
wxUserId: SessionStore.user.UserId
|
||||
}
|
||||
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
this.messages1[this.roomId].push(message)
|
||||
|
||||
this.textField = ''
|
||||
@@ -569,7 +580,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
@@ -750,7 +761,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
|
||||
}
|
||||
|
||||
@@ -800,7 +811,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
this.textField = ''
|
||||
|
||||
}
|
||||
@@ -846,7 +857,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,7 +908,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
|
||||
return
|
||||
}
|
||||
@@ -941,7 +952,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.chatServiceService.sendMessage(message, this.roomType)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user