mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
add typing
This commit is contained in:
@@ -67,7 +67,8 @@
|
|||||||
<div class="item-date" [class.item-date-active]="room.value.id == idSelected">{{room.value.duration}}</div>
|
<div class="item-date" [class.item-date-active]="room.value.id == idSelected">{{room.value.duration}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="room.value.lastMessage" class="item-description" [class.item-description-active]="room.value.id == idSelected">
|
<div *ngIf="room.value.lastMessage" class="item-description" [class.item-description-active]="room.value.id == idSelected">
|
||||||
<ion-label *ngIf="room.value.lastMessage">{{room.value.lastMessage.msg}}</ion-label>
|
<ion-label *ngIf="room.value.lastMessage && room.value.otherUserType == false">{{room.value.lastMessage.msg}}</ion-label>
|
||||||
|
<ion-label *ngIf="room.value.otherUserType == true">A escrever ...</ion-label>
|
||||||
<ion-label *ngIf="room.value.lastMessage.file">
|
<ion-label *ngIf="room.value.lastMessage.file">
|
||||||
<fa-icon *ngIf="room.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
|
<fa-icon *ngIf="room.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
|
||||||
<fa-icon *ngIf="room.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
|
<fa-icon *ngIf="room.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="room.value.id == idSelected"></fa-icon>
|
||||||
@@ -121,7 +122,11 @@
|
|||||||
<div class="item-date" [class.item-date-active]="group.value.id ==idSelected" *ngIf="group.value.customFields.countDownDate">{{countDownDate(group.value.customFields.countDownDate, group.value.id)}}</div>
|
<div class="item-date" [class.item-date-active]="group.value.id ==idSelected" *ngIf="group.value.customFields.countDownDate">{{countDownDate(group.value.customFields.countDownDate, group.value.id)}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="group.value.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.value.id ==idSelected">
|
<div *ngIf="group.value.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.value.id ==idSelected">
|
||||||
<div class="item-message">{{group.value.lastMessage.u.name}}: {{group.value.lastMessage.msg}} </div>
|
<div class="item-message" *ngIf="group.value.otherUserType == false">{{group.value.lastMessage.u.name}}: {{group.value.lastMessage.msg}} </div>
|
||||||
|
|
||||||
|
<div class="item-message" *ngIf="group.value.otherUserType == false">{{group.value.lastMessage.u.name}}: {{group.value.lastMessage.msg}} </div>
|
||||||
|
<div *ngIf="group.value.otherUserType == true">{{group.value.userThatIsTyping}} A escrever ...</div>
|
||||||
|
|
||||||
<div class="item-files add-ellipsis" *ngIf="group.value.file">
|
<div class="item-files add-ellipsis" *ngIf="group.value.file">
|
||||||
<fa-icon *ngIf="group.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
|
<fa-icon *ngIf="group.value.lastMessage.file.type != 'application/meeting'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
|
||||||
<fa-icon *ngIf="group.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
|
<fa-icon *ngIf="group.value.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group.value.id == idSelected"></fa-icon>
|
||||||
|
|||||||
@@ -220,18 +220,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="message-box width-80">
|
<div class="message-box width-80">
|
||||||
<ion-item class="ion-no-padding type-message" lines="none">
|
<ion-item class="ion-no-padding type-message" lines="none">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getGroupRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
|
||||||
<button hidden class="btn-no-color">
|
<button hidden class="btn-no-color">
|
||||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button *ngIf="message" class="btn-no-color" (click)="sendMessage()">
|
<button *ngIf="wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!message" class="btn-no-color">
|
<button *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
showLoader: boolean;
|
showLoader: boolean;
|
||||||
isGroupCreated:boolean;
|
isGroupCreated:boolean;
|
||||||
loggedUser: any;
|
loggedUser: any;
|
||||||
message:any;
|
|
||||||
messages:any;
|
messages:any;
|
||||||
|
|
||||||
room:any;
|
room:any;
|
||||||
@@ -184,6 +183,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeInput() {
|
||||||
|
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
|
||||||
|
}
|
||||||
|
|
||||||
async goToEvent(eventId: any) {
|
async goToEvent(eventId: any) {
|
||||||
let classs;
|
let classs;
|
||||||
if (window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
@@ -323,8 +327,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send(this.message)
|
this.wsChatMethodsService.getGroupRoom(this.roomId).send()
|
||||||
this.message = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openOptions() {
|
async openOptions() {
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="width-70">
|
<div class="width-70">
|
||||||
<ion-item class="ion-no-padding ion-no-margin type-message" lines="none">
|
<ion-item class="ion-no-padding ion-no-margin type-message" lines="none">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" *ngIf="!recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" *ngIf="!recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
|
||||||
<ion-textarea autocomplete="on" spellcheck="true" *ngIf="recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="durationDisplay"></ion-textarea>
|
<ion-textarea autocomplete="on" spellcheck="true" *ngIf="recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="durationDisplay"></ion-textarea>
|
||||||
<button hidden #recordbtn class="btn-no-color" (click)="notImplemented()">
|
<button hidden #recordbtn class="btn-no-color" (click)="notImplemented()">
|
||||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||||
@@ -220,11 +220,11 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button *ngIf="message" class="btn-no-color" (click)="sendMessage()">
|
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!message" class="btn-no-color">
|
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -343,6 +343,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeInput() {
|
||||||
|
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
|
||||||
|
}
|
||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
let body = {
|
let body = {
|
||||||
"message":
|
"message":
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { NativeNotificationService } from 'src/app/services/native-notification.service';
|
import { NativeNotificationService } from 'src/app/services/native-notification.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { capitalizeTxt } from 'src/plugin/text'
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@@ -27,6 +28,12 @@ export class RoomService {
|
|||||||
_updatedAt = {}
|
_updatedAt = {}
|
||||||
private hasLoadHistory = false
|
private hasLoadHistory = false
|
||||||
duration = ''
|
duration = ''
|
||||||
|
isTyping = false
|
||||||
|
otherUserType = false
|
||||||
|
lastTimeType = null
|
||||||
|
message = ''
|
||||||
|
lastMessageTxt = ''
|
||||||
|
userThatIsTyping = ''
|
||||||
|
|
||||||
private ToastService = ToastsService
|
private ToastService = ToastsService
|
||||||
mgsArray = [];
|
mgsArray = [];
|
||||||
@@ -95,10 +102,67 @@ export class RoomService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
this.WsChatService.receiveStreamNotifyRoom((message) => {
|
||||||
|
|
||||||
|
console.log(message.fields)
|
||||||
|
|
||||||
|
if(message.fields.eventName == this.id+'/'+'typing') {
|
||||||
|
|
||||||
|
this.userThatIsTyping = this.usernameToDisplayName(message.fields.args[0])
|
||||||
|
this.isTyping = message.fields.args[1]
|
||||||
|
this.otherUserType = message.fields.args[1]
|
||||||
|
|
||||||
|
} else if (message.fields.eventName == this.id+'/'+'deleteMessage') {}
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
send(msg) {
|
send() {
|
||||||
this.WsChatService.send(this.id, msg)
|
this.WsChatService.send(this.id, this.message)
|
||||||
|
this.message= ''
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
typing(text:string = this.message) {
|
||||||
|
|
||||||
|
if(this.lastMessageTxt == text) { return false }
|
||||||
|
this.lastTimeType = new Date().getTime()
|
||||||
|
|
||||||
|
const lastIsTyping = this.isTyping
|
||||||
|
if(text.length >= 1) {
|
||||||
|
this.isTyping = true
|
||||||
|
} else {
|
||||||
|
this.isTyping = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lastIsTyping != this.isTyping) {
|
||||||
|
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.lastMessageTxt = this.message
|
||||||
|
this.typingWatch()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private typingWatch() {
|
||||||
|
setTimeout(()=>{
|
||||||
|
const now = new Date().getTime()
|
||||||
|
|
||||||
|
if((now - this.lastTimeType) >= 2888) {
|
||||||
|
|
||||||
|
if(this.isTyping == true) {
|
||||||
|
this.isTyping = false
|
||||||
|
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log(now - this.lastTimeType)
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 3000)
|
||||||
}
|
}
|
||||||
|
|
||||||
leave(rid?) {
|
leave(rid?) {
|
||||||
@@ -324,7 +388,11 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// to add
|
usernameToDisplayName(username) {
|
||||||
countDownDate() { }
|
|
||||||
|
const firstName = capitalizeTxt(username.split('.')[0])
|
||||||
|
const lastName = capitalizeTxt(username.split('.')[1])
|
||||||
|
return firstName + ' ' + lastName
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,12 +81,16 @@ export class WsChatMethodsService {
|
|||||||
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
|
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
|
||||||
console.log('streamRoomMessages', subscription)
|
console.log('streamRoomMessages', subscription)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const id in this.group) {
|
for (const id in this.group) {
|
||||||
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
|
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
|
||||||
console.log('streamRoomMessages', subscription)
|
console.log('streamRoomMessages', subscription)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.WsChatService.streamNotifyLogged().then((subscription=>{
|
this.WsChatService.streamNotifyLogged().then((subscription=>{
|
||||||
|
|||||||
@@ -231,7 +231,73 @@ export class WsChatService {
|
|||||||
deleteMessage() {}
|
deleteMessage() {}
|
||||||
createRoom() {}
|
createRoom() {}
|
||||||
|
|
||||||
|
sendStreamNotifyRoom(roomId : string, username, event: 'typing', param: any) {
|
||||||
|
|
||||||
|
const requestId = uuidv4()
|
||||||
|
|
||||||
|
let message = {
|
||||||
|
msg: "method",
|
||||||
|
method: "stream-notify-room",
|
||||||
|
id: requestId,
|
||||||
|
params: [
|
||||||
|
`${roomId}/${event}`,
|
||||||
|
username,
|
||||||
|
param
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
this.ws.send({message, requestId})
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||||
|
if(message.id == requestId || deepFind(message,'result.id') == requestId) { // same request send
|
||||||
|
resolve('')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
subStreamNotifyRoom(roomId : string , event: 'typing' | 'deleteMessage', param: any) {
|
||||||
|
|
||||||
|
const requestId = uuidv4()
|
||||||
|
|
||||||
|
let message = {
|
||||||
|
msg: "sub",
|
||||||
|
id: requestId,
|
||||||
|
name: "stream-notify-room",
|
||||||
|
params:[
|
||||||
|
`${roomId}/${event}`,
|
||||||
|
param
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.ws.send({message, requestId})
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||||
|
if(message.id == requestId ) { // same request send
|
||||||
|
resolve('')
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
receiveStreamNotifyRoom(funx: Function) {
|
||||||
|
|
||||||
|
this.ws.registerCallback({
|
||||||
|
type:'Onmessage',
|
||||||
|
funx:(message)=> {
|
||||||
|
if(message.collection == "stream-notify-room" && message.msg == 'changed') {
|
||||||
|
funx(message)
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
}
|
||||||
|
|
||||||
loadHistory(roomId, limit: number = 50) {
|
loadHistory(roomId, limit: number = 50) {
|
||||||
|
|
||||||
|
|||||||
@@ -260,18 +260,18 @@
|
|||||||
|
|
||||||
<div class="width-100">
|
<div class="width-100">
|
||||||
<ion-item class="ion-no-padding type-message" lines="none">
|
<ion-item class="ion-no-padding type-message" lines="none">
|
||||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getGroupRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
|
||||||
<button hidden class="btn-no-color">
|
<button hidden class="btn-no-color">
|
||||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-send">
|
<div class="btn-send">
|
||||||
<button *ngIf="message" class="btn-no-color" (click)="sendMessage()">
|
<button *ngIf="wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button title="Enviar Mensagem" *ngIf="!message" class="btn-no-color">
|
<button title="Enviar Mensagem" *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -216,6 +216,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeInput() {
|
||||||
|
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
|
||||||
|
}
|
||||||
|
|
||||||
async getChatMembers() {
|
async getChatMembers() {
|
||||||
//return await this.chatService.getMembers(roomId).toPromise();
|
//return await this.chatService.getMembers(roomId).toPromise();
|
||||||
this.chatService.getAllUsers().subscribe(res => {
|
this.chatService.getAllUsers().subscribe(res => {
|
||||||
@@ -314,8 +319,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send(this.message)
|
this.wsChatMethodsService.getGroupRoom(this.roomId).send()
|
||||||
this.message = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMessage(msgId: string) {
|
deleteMessage(msgId: string) {
|
||||||
|
|||||||
@@ -206,20 +206,20 @@
|
|||||||
<div class="width-100">
|
<div class="width-100">
|
||||||
<ion-item class="ion-no-padding type-message" lines="none">
|
<ion-item class="ion-no-padding type-message" lines="none">
|
||||||
<ion-textarea (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem"
|
<ion-textarea (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem"
|
||||||
class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
|
class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="changeInput()"></ion-textarea>
|
||||||
<button hidden class="btn-no-color" (click)="notImplemented()">
|
<button hidden class="btn-no-color" (click)="notImplemented()">
|
||||||
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button *ngIf="message" class="btn-no-color" (click)="sendMessage()">
|
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="!message" class="btn-no-color">
|
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
loggedUser: any;
|
loggedUser: any;
|
||||||
|
|
||||||
message = '';
|
|
||||||
messages: any;
|
messages: any;
|
||||||
dm: any;
|
dm: any;
|
||||||
userPresence = '';
|
userPresence = '';
|
||||||
@@ -250,8 +249,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendMessage() {
|
sendMessage() {
|
||||||
this.wsChatMethodsService.getDmRoom(this.roomId).send(this.message)
|
this.wsChatMethodsService.getDmRoom(this.roomId).send()
|
||||||
this.message = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMessage(msgId: string) {
|
deleteMessage(msgId: string) {
|
||||||
@@ -290,6 +288,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeInput() {
|
||||||
|
this.wsChatMethodsService.getDmRoom(this.roomId).typing()
|
||||||
|
}
|
||||||
|
|
||||||
async openViewDocumentModal(file: any) {
|
async openViewDocumentModal(file: any) {
|
||||||
let task = {
|
let task = {
|
||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user