mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
create direct message
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<!-- MOBILE -->
|
||||
<ion-label class="title">Nova Conversa</ion-label>
|
||||
<ion-label class="title">Nova Conversa ..</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,8 +38,8 @@
|
||||
<ion-label>{{ userContainer.key }}</ion-label>
|
||||
</div>
|
||||
|
||||
<div *ngFor="let user of userContainer.value; let i = index" class="d-flex px-20 align-center">
|
||||
<ion-label class="flex-grow-1 px-10">{{user.wxFullName}}</ion-label>
|
||||
<div *ngFor="let user of userContainer.value; let i = index" class="d-flex px-20 align-center" (click)="select(user)">
|
||||
<ion-label class="flex-grow-1 px-10 cursor-pointer">{{user.wxFullName}}</ion-label>
|
||||
<div class="icon"><ion-icon name="ellipse"></ion-icon></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,9 @@ import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/
|
||||
import { UserContacts } from 'src/app/services/Repositorys/contacts/data-source/contacts-data-source.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service'
|
||||
import { MessageEntity } from 'src/app/module/chat/domain/entity/message';
|
||||
import { MessageEnum } from 'src/app/module/chat/domain/use-case/message-create-use-case.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -38,6 +41,7 @@ export class ContactsPage implements OnInit {
|
||||
private contactsRepositoryService: ContactRepositoryService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private toastService: ToastService,
|
||||
private chatServiceService: ChatServiceService
|
||||
)
|
||||
{
|
||||
this.loggedUser = SessionStore.user.ChatData['data'];
|
||||
@@ -159,4 +163,23 @@ export class ContactsPage implements OnInit {
|
||||
close() {
|
||||
this.modalController.dismiss({});
|
||||
}
|
||||
|
||||
select(user: UserContacts) {
|
||||
|
||||
const message = new MessageEntity();
|
||||
|
||||
message.sender = {
|
||||
userPhoto: '',
|
||||
wxeMail: SessionStore.user.Email,
|
||||
wxFullName: SessionStore.user.FullName,
|
||||
wxUserId: SessionStore.user.UserId
|
||||
}
|
||||
|
||||
message.receiverId = user.wxUserId
|
||||
|
||||
message.message = 'hello'
|
||||
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.Direct)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ import { RoomLocalRepository } from 'src/app/module/chat/data/repository/room-lo
|
||||
import { MemberListLocalRepository } from 'src/app/module/chat/data/repository/member-list-local-repository.service'
|
||||
import { UserTypingLocalRepository } from 'src/app/module/chat/data/repository/user-typing-local-data-source.service';
|
||||
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-local-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';
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
@@ -525,7 +526,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
wxUserId: SessionStore.user.UserId
|
||||
}
|
||||
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.messages1[this.roomId].push(message)
|
||||
|
||||
this.textField = ''
|
||||
@@ -568,7 +569,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
}, 100)
|
||||
@@ -749,7 +750,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
|
||||
}
|
||||
|
||||
@@ -799,7 +800,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
this.textField = ''
|
||||
|
||||
}
|
||||
@@ -845,7 +846,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,7 +897,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
|
||||
return
|
||||
}
|
||||
@@ -940,7 +941,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}]
|
||||
|
||||
this.messages1[this.roomId].push(message)
|
||||
this.chatServiceService.sendMessage(message)
|
||||
this.chatServiceService.sendMessage(message, MessageEnum.group)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user