mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
send direct message
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { GroupMessagesPage } from '../group-messages/group-messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -32,7 +32,7 @@ export class ContactsPage implements OnInit {
|
||||
@Output() backToChat: EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() closeAllDesktopComponents: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
roomId= ''
|
||||
@Input() roomId: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -122,14 +122,14 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
onChange(event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
clicked() {}
|
||||
|
||||
|
||||
selectOnce = true
|
||||
async select(user: UserContacts) {
|
||||
|
||||
|
||||
const message = new MessageEntity();
|
||||
|
||||
message.sender = {
|
||||
@@ -142,8 +142,10 @@ export class ContactsPage implements OnInit {
|
||||
message.receiverId = user.wxUserId
|
||||
message.message = 'hello'
|
||||
|
||||
const result = await this.chatServiceService.sendMessage(message, RoomType.Group)
|
||||
|
||||
const result = await this.chatServiceService.sendMessage(message, RoomType.Direct)
|
||||
|
||||
console.log('result', result);
|
||||
|
||||
if(result.isOk()) {
|
||||
this.close(result.value.roomId)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user