mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
add reaction to chat
This commit is contained in:
@@ -127,6 +127,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
userTyping$: UserTypingList[] | undefined
|
||||
newMessagesStream!: Subscription
|
||||
|
||||
selectedMessage: any = null;
|
||||
emojis: string[] = ['😊', '😂', '❤️', '👍', '😢']; // Add more emojis as needed
|
||||
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
@@ -193,12 +197,36 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
// })
|
||||
}
|
||||
|
||||
|
||||
toggleEmojiPicker(message: any) {
|
||||
if (this.selectedMessage === message) {
|
||||
this.selectedMessage = null; // Close the picker if it's already open
|
||||
} else {
|
||||
this.selectedMessage = message; // Open the picker for the selected message
|
||||
}
|
||||
}
|
||||
|
||||
addReaction(message: any, emoji: string) {
|
||||
// Logic to add reaction to the message
|
||||
console.log(`Reacting to message ${message.id} with emoji ${emoji.codePointAt(0).toString(16)}`);
|
||||
this.selectedMessage = null; // Close the picker after adding reaction
|
||||
|
||||
this.chatServiceService.reactToMessage({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.messageId,
|
||||
roomId: this.roomId,
|
||||
reaction: emoji,
|
||||
requestId: ''
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
sendReadAt() {
|
||||
this.messageRepositoryService.sendReadAt({roomId: this.roomId}).then((e) => {
|
||||
console.log(e)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
sendTyping() {
|
||||
this.userTypingServiceRepository.addUserTyping(this.roomId)
|
||||
}
|
||||
@@ -922,7 +950,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
messageDelete({messageId}) {
|
||||
// this.messageRepositoryService.sendMessageDelete()
|
||||
|
||||
|
||||
this.chatServiceService.messageDelete({
|
||||
messageId: messageId,
|
||||
roomId: this.roomId,
|
||||
|
||||
Reference in New Issue
Block a user