mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
rename files
This commit is contained in:
@@ -25,7 +25,6 @@ import { CalendarModule, DateAdapter } from 'angular-calendar';
|
||||
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MessagesPage } from './pages/chat/messages/messages.page';
|
||||
import { WebsocketService } from './services/websocket.service'
|
||||
import { ChatService } from './services/chat.service';
|
||||
import {MatDatepickerModule} from '@angular/material/datepicker';
|
||||
// import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
|
||||
@@ -130,7 +129,6 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
FilePath,
|
||||
/* FCM,
|
||||
FirebaseX, */
|
||||
WebsocketService,
|
||||
ChatService,
|
||||
ScreenOrientation,
|
||||
Network,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@@ -26,7 +26,7 @@ export class SetRoomOwnerPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
) {
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
this.members = this.navParams.get('members');
|
||||
@@ -60,7 +60,7 @@ export class SetRoomOwnerPage implements OnInit {
|
||||
|
||||
async setRoomOwner(user:any){
|
||||
|
||||
let res:any = await this.wsChatMethodsService.addRoomOwner(this.roomId, user._id);
|
||||
let res:any = await this.ChatSystemService.addRoomOwner(this.roomId, user._id);
|
||||
|
||||
|
||||
if(res.error){
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<ion-content class="height-100 container-wrapper">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="wsChatMethodsService.loadingWholeList"></ion-progress-bar>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="ChatSystemService.loadingWholeList"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
@@ -48,7 +48,7 @@
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
<ion-item-sliding>
|
||||
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
|
||||
*ngFor="let room of wsChatMethodsService._dm"
|
||||
*ngFor="let room of ChatSystemService._dm"
|
||||
[class.item-active]="room.id == idSelected">
|
||||
<div class="item-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true && wsChatMethodsService._dm.length == 0">
|
||||
<ion-item-sliding *ngIf="ChatSystemService.loadingWholeList == true && ChatSystemService._dm.length == 0">
|
||||
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
|
||||
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-chat-grey.svg"></ion-icon></div>
|
||||
<div class="item-content flex-grow-1 cursor-pointer">
|
||||
@@ -118,7 +118,7 @@
|
||||
</ion-list>
|
||||
<ion-list *ngSwitchCase="'Grupos'">
|
||||
<ion-item-sliding >
|
||||
<div *ngFor="let group of wsChatMethodsService._group"
|
||||
<div *ngFor="let group of ChatSystemService._group"
|
||||
[class.item-active]="group.id ==idSelected"
|
||||
class="item item-hover d-flex">
|
||||
<div class="item-icon">
|
||||
@@ -157,7 +157,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true && wsChatMethodsService._group.length == 0">
|
||||
<ion-item-sliding *ngIf="ChatSystemService.loadingWholeList == true && ChatSystemService._group.length == 0">
|
||||
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
|
||||
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-group-chat-grey.svg"></ion-icon></div>
|
||||
<div class="item-content flex-grow-1 cursor-pointer">
|
||||
@@ -234,7 +234,7 @@
|
||||
</app-group-contacts>
|
||||
|
||||
<app-group-messages
|
||||
*ngIf="showGroupMessages && wsChatMethodsService.deleteRecently(roomId) == false"
|
||||
*ngIf="showGroupMessages && ChatSystemService.deleteRecently(roomId) == false"
|
||||
[style.display]="showEmptyComponent ? 'flex' : 'none'"
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
(showEmptyContainer)="showEmptyContainer()"
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||
import { GroupMessagesPage } from './group-messages/group-messages.page';
|
||||
import { ContactsPage } from './messages/contacts/contacts.page';
|
||||
import { MessagesPage } from './messages/messages.page';
|
||||
@@ -112,7 +112,7 @@ export class ChatPage implements OnInit {
|
||||
private sqlservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private storageservice: StorageService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
) {
|
||||
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
@@ -354,7 +354,7 @@ export class ChatPage implements OnInit {
|
||||
|
||||
console.log(roomId)
|
||||
|
||||
this.wsChatMethodsService._group.forEach((room)=>{
|
||||
this.ChatSystemService._group.forEach((room)=>{
|
||||
if(room.id == roomId) {
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
})
|
||||
|
||||
this.wsChatMethodsService._dm.forEach((room)=>{
|
||||
this.ChatSystemService._dm.forEach((room)=>{
|
||||
if(room.id == roomId) {
|
||||
this.openMessagesPage(roomId)
|
||||
}
|
||||
@@ -371,7 +371,7 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
|
||||
onSegmentChange() {
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.getAllRooms();
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ChatService } from 'src/app/services/chat.service';
|
||||
import { GroupMessagesPage } from '../group-messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-contacts',
|
||||
@@ -41,7 +41,7 @@ export class GroupContactsPage implements OnInit {
|
||||
private authService: AuthService,
|
||||
private navParams: NavParams,
|
||||
public ThemeService: ThemeService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
)
|
||||
{
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
@@ -93,14 +93,14 @@ export class GroupContactsPage implements OnInit {
|
||||
if(this.room.t == "p"){
|
||||
this.chatService.getGroupMembers(this.room._id).subscribe(res=>{
|
||||
this.members = res['members'];
|
||||
this.wsChatMethodsService.getAllRooms()
|
||||
this.ChatSystemService.getAllRooms()
|
||||
this.loadUsers();
|
||||
});
|
||||
}
|
||||
else if(this.room.t == "c"){
|
||||
this.chatService.getChannelMembers(this.room._id).subscribe(res=>{
|
||||
this.members = res['members'];
|
||||
this.wsChatMethodsService.getAllRooms()
|
||||
this.ChatSystemService.getAllRooms()
|
||||
this.loadUsers();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<ion-label>Esta conversa passou a grupo</ion-label><br />
|
||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||
</div>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of ChatSystemService.getGroupRoom(roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" (press)="handlePress(msg._id)">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name ?? ""}}</ion-label>
|
||||
@@ -217,13 +217,13 @@
|
||||
|
||||
<ion-footer>
|
||||
|
||||
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
|
||||
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
||||
<ngx-letters-avatar *ngIf="showAvatar"
|
||||
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
||||
[avatarName]= "ChatSystemService.getGroupRoom(roomId).name"
|
||||
[width]="30"
|
||||
[circular]="true"
|
||||
fontFamily="Roboto"></ngx-letters-avatar>
|
||||
{{ wsChatMethodsService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
||||
{{ ChatSystemService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
||||
</div>
|
||||
|
||||
<div class="width-100 pl-20 pr-20">
|
||||
@@ -243,7 +243,7 @@
|
||||
</div>
|
||||
<div class="message-box width-80">
|
||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||
<ion-textarea *ngIf="allowTyping" 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)="wsChatMethodsService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
|
||||
<ion-textarea *ngIf="allowTyping" autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="ChatSystemService.getGroupRoom(roomId).message" (ionChange)="ChatSystemService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
|
||||
</div>
|
||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||
@@ -252,15 +252,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button #recordbtn *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<button #recordbtn *ngIf="!ChatSystemService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||
<button *ngIf="ChatSystemService.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 == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<button *ngIf="!ChatSystemService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { FileType } from 'src/app/models/fileType';
|
||||
import { Storage } from '@ionic/storage';
|
||||
|
||||
@@ -100,7 +100,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private sqlservice: SqliteService,
|
||||
private platform: Platform,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private storage: Storage,
|
||||
private CameraService: CameraService,
|
||||
private sanitiser: DomSanitizer,
|
||||
@@ -116,10 +116,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
};
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked;
|
||||
this.wsChatMethodsService.openRoom(this.roomId)
|
||||
this.groupNameFormart = this.wsChatMethodsService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked;
|
||||
this.ChatSystemService.openRoom(this.roomId)
|
||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -145,7 +145,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.getChatMembers();
|
||||
|
||||
this.getRoomMessageDB(this.roomId);
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
|
||||
@@ -162,7 +162,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
deleteMessage(msgId: string) {
|
||||
const room = this.wsChatMethodsService.getGroupRoom(this.roomId)
|
||||
const room = this.ChatSystemService.getGroupRoom(this.roomId)
|
||||
this.alertService.confirmDeleteMessage(msgId, room);
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// this.getGroupContacts(this.room);
|
||||
// this.showLoader = false;
|
||||
// });
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||
// console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
@@ -442,7 +442,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// });
|
||||
// }
|
||||
|
||||
this.members = this.wsChatMethodsService.getGroupRoom(this.roomId).members
|
||||
this.members = this.ChatSystemService.getGroupRoom(this.roomId).members
|
||||
}
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
@@ -507,7 +507,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/audio",
|
||||
"msDuration": audioFile.value.msDuration,
|
||||
@@ -540,7 +540,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res.data == 'leave') {
|
||||
|
||||
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
|
||||
//this.ChatSystemService.subscribeToRoomUpdate(this.roomId, this.room);
|
||||
}
|
||||
else if (res.data == 'cancel') {
|
||||
|
||||
@@ -656,7 +656,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -695,7 +695,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
if (data.selected) {
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).send({
|
||||
file: {
|
||||
"name": res.data.selected.Assunto,
|
||||
"type": "application/webtrix",
|
||||
@@ -740,7 +740,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</ion-refresher>
|
||||
<div class="main-content">
|
||||
|
||||
<ion-virtual-scroll [items]="WsChatMethodsService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { MessagesPage } from '../messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
|
||||
import { ChatSystemService} from 'src/app/services/chat/chat-system.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
@@ -30,7 +30,7 @@ export class ContactsPage implements OnInit {
|
||||
private chatService: ChatService,
|
||||
private authService: AuthService,
|
||||
public ThemeService: ThemeService,
|
||||
public WsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
)
|
||||
{
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
@@ -100,7 +100,7 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
this.room = res['room'];
|
||||
|
||||
await this.WsChatMethodsService.getAllRooms();
|
||||
await this.ChatSystemService.getAllRooms();
|
||||
this.getDirectMessage(this.room._id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
</div>
|
||||
<div class="middle-container" *ngIf="!showMessageOptions">
|
||||
<div class="middle">
|
||||
<ion-label class="title">{{wsChatMethodsService.getDmRoom(roomId).name}}</ion-label>
|
||||
<ion-label class="title">{{ChatSystemService.getDmRoom(roomId).name}}</ion-label>
|
||||
<!-- <span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div (click)="wsChatMethodsService.getDmRoom(roomId).deleteAll()" >delete all</div> -->
|
||||
<!-- <div (click)="ChatSystemService.getDmRoom(roomId).deleteAll()" >delete all</div> -->
|
||||
<div class="middle-container-options" *ngIf="showMessageOptions">
|
||||
<fa-icon (click)="deleteMessage(selectedMsgId)" icon="trash" class="middle-container-options-icons"></fa-icon>
|
||||
<!-- <ion-icon name="trash"></ion-icon> -->
|
||||
@@ -45,7 +45,7 @@
|
||||
<div (click)="handleClick()" class="message-attachments messages" #scrollMe>
|
||||
|
||||
<div class="messages-list-item-wrapper container-width-100 file"
|
||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
|
||||
*ngFor="let msg of ChatSystemService.getDmRoom(this.roomId).messages; let last = last"
|
||||
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div (press)="handlePress(msg._id)" class='file message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}'
|
||||
*ngIf="msg.msg !=''">
|
||||
@@ -224,8 +224,8 @@
|
||||
<ion-footer >
|
||||
|
||||
|
||||
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true">
|
||||
<ngx-letters-avatar [avatarName]="wsChatMethodsService.getGroupRoom(roomId).name" [width]="30" [circular]="true"
|
||||
<div class="typing" *ngIf="ChatSystemService.getDmRoom(roomId).otherUserType == true">
|
||||
<ngx-letters-avatar [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30" [circular]="true"
|
||||
fontFamily="Roboto"></ngx-letters-avatar>
|
||||
está a escrever ...
|
||||
</div>
|
||||
@@ -251,8 +251,8 @@
|
||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||
<ion-textarea *ngIf="allowTyping" autocomplete="on" autocorrect="on" spellcheck="true" clearOnEdit="true"
|
||||
placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1"
|
||||
[(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message"
|
||||
(ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
||||
[(ngModel)]="ChatSystemService.getDmRoom(roomId).message"
|
||||
(ionChange)="ChatSystemService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
||||
</div>
|
||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||
@@ -261,21 +261,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded"
|
||||
<button #recordbtn *ngIf="!ChatSystemService.getDmRoom(roomId).message && !lastAudioRecorded"
|
||||
(click)="startRecording()" class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send"
|
||||
src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send"
|
||||
src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()"
|
||||
<button *ngIf="ChatSystemService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()"
|
||||
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 == 'gov' " class="chat-icon-send"
|
||||
src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && lastAudioRecorded"
|
||||
<button *ngIf="!ChatSystemService.getDmRoom(roomId).message && lastAudioRecorded"
|
||||
(click)="sendAudio(lastAudioRecorded)" 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>
|
||||
|
||||
@@ -23,7 +23,7 @@ import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-r
|
||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
|
||||
@@ -124,7 +124,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private platform: Platform,
|
||||
private sqlservice: SqliteService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private CameraService: CameraService,
|
||||
private processesService: ProcessesService,
|
||||
@@ -149,9 +149,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
this.wsChatMethodsService.openRoom(this.roomId)
|
||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
||||
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
this.ChatSystemService.openRoom(this.roomId)
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
@@ -162,9 +162,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.createDirectoryImage()
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatService.refreshtoken();
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
|
||||
@@ -301,7 +301,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
deleteMessage(msgId: string) {
|
||||
const room = this.wsChatMethodsService.getDmRoom(this.roomId)
|
||||
const room = this.ChatSystemService.getDmRoom(this.roomId)
|
||||
this.alertService.confirmDeleteMessage(msgId, room);
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
||||
this.ChatSystemService.getDmRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
@@ -434,7 +434,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/audio",
|
||||
"msDuration": audioFile.value.msDuration,
|
||||
@@ -526,8 +526,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// this.showLoader = false;
|
||||
// });
|
||||
|
||||
this.members = this.wsChatMethodsService.getDmRoom(this.roomId).members
|
||||
this.dmUsers = this.wsChatMethodsService.getDmRoom(this.roomId).membersExcludeMe
|
||||
this.members = this.ChatSystemService.getDmRoom(this.roomId).members
|
||||
this.dmUsers = this.ChatSystemService.getDmRoom(this.roomId).membersExcludeMe
|
||||
}
|
||||
|
||||
showDateDuration(start: any) {
|
||||
@@ -640,7 +640,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
console.log(capturedImage);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -684,7 +684,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
if (data.selected) {
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"name": res.data.selected.Assunto,
|
||||
"type": "application/webtrix",
|
||||
@@ -728,7 +728,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -767,7 +767,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { GroupContactsPage } from '../group-messages/group-contacts/group-contac
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@@ -33,7 +33,7 @@ export class NewGroupPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private chatService: ChatService,
|
||||
private processesService: ProcessesService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private authService: AuthService,
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
@@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit {
|
||||
let customFields = {
|
||||
"countDownDate": this.thedate
|
||||
}
|
||||
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
|
||||
}
|
||||
else{
|
||||
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export class NewGroupPage implements OnInit {
|
||||
this.addContacts(res.result);
|
||||
|
||||
setTimeout(() => {
|
||||
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ import { StorageService } from 'src/app/services/storage.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.page.html',
|
||||
@@ -50,9 +52,9 @@ export class LoginPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private storageservice: StorageService,
|
||||
public p: PermissionService,
|
||||
private WsChatService: WsChatService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private storage: Storage,
|
||||
public WsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private ChatService: ChatService
|
||||
) {}
|
||||
|
||||
@@ -144,9 +146,9 @@ export class LoginPage implements OnInit {
|
||||
|
||||
} else {
|
||||
|
||||
this.WsChatService.logout();
|
||||
this.RochetChatConnectorService.logout();
|
||||
this.clearStoreService.clear();
|
||||
this.WsChatMethodsService.clearChat();
|
||||
this.ChatSystemService.clearChat();
|
||||
SessionStore.delete();
|
||||
window.localStorage.clear();
|
||||
await MessageModel.deleteAll()
|
||||
@@ -162,7 +164,7 @@ export class LoginPage implements OnInit {
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader();
|
||||
this.ChatService.refreshtoken();
|
||||
this.WsChatMethodsService.ReLoadChat();
|
||||
this.ChatSystemService.ReLoadChat();
|
||||
}
|
||||
|
||||
this.getToken();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AlertController, AnimationController } from '@ionic/angular';
|
||||
import { WsChatMethodsService } from './chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from './chat/chat-system.service';
|
||||
import { ToastService } from './toast.service';
|
||||
|
||||
@Injectable({
|
||||
@@ -12,7 +12,7 @@ export class AlertService {
|
||||
public alertController: AlertController,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
) { }
|
||||
|
||||
async presentAlert(message:string) {
|
||||
@@ -58,10 +58,10 @@ export class AlertService {
|
||||
handler: () => {
|
||||
//const loader = this.toastService.loading();
|
||||
|
||||
this.wsChatMethodsService.deleteMessage(msgId).then(() => {
|
||||
this.ChatSystemService.deleteMessage(msgId).then(() => {
|
||||
room.deleteMessage(msgId)
|
||||
})
|
||||
//this.wsChatMethodsService.subscribeToRoomUpdate(room._id, room);
|
||||
//this.ChatSystemService.subscribeToRoomUpdate(room._id, room);
|
||||
//loader.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { AlertController } from '@ionic/angular';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AESEncrypt } from '../services/aesencrypt.service';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { NfService } from 'src/app/services/chat/nf.service'
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
@@ -20,7 +20,7 @@ import { RoomService } from './chat/room.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { InitialsService } from './functions/initials.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -41,7 +41,7 @@ export class AuthService {
|
||||
public alertController: AlertController,
|
||||
private aesencrypt: AESEncrypt,
|
||||
private cookieService: CookieService,
|
||||
private WsChatService: WsChatService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private router: Router,
|
||||
private NfService:NfService,
|
||||
private processesService: ProcessesService,
|
||||
@@ -49,7 +49,7 @@ export class AuthService {
|
||||
private storage: Storage,
|
||||
private initialsService: InitialsService,
|
||||
public p: PermissionService,
|
||||
public WsChatMethodsService: WsChatMethodsService, ) {
|
||||
public ChatSystemService: ChatSystemService, ) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
@@ -191,8 +191,8 @@ export class AuthService {
|
||||
loginToChatWs() {
|
||||
setTimeout(()=>{
|
||||
|
||||
this.WsChatService.connect();
|
||||
this.WsChatService.login().then((message: any) => {
|
||||
this.RochetChatConnectorService.connect();
|
||||
this.RochetChatConnectorService.login().then((message: any) => {
|
||||
|
||||
|
||||
SessionStore.user.RochetChatUserId = message.result.id
|
||||
@@ -201,10 +201,10 @@ export class AuthService {
|
||||
//
|
||||
|
||||
|
||||
this.WsChatService.setStatus('online')
|
||||
this.RochetChatConnectorService.setStatus('online')
|
||||
|
||||
setTimeout(() => {
|
||||
this.WsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.getAllRooms();
|
||||
}, 200);
|
||||
|
||||
// alert('wsLogin')
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WebsocketService } from './websocket.service';
|
||||
import { ChatSystemService } from './chat-system.service';
|
||||
|
||||
describe('WebsocketService', () => {
|
||||
let service: WebsocketService;
|
||||
describe('ChatSystemService', () => {
|
||||
let service: ChatSystemService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WebsocketService);
|
||||
service = TestBed.inject(ChatSystemService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
+18
-19
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { RoomService } from './room.service';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { capitalizeTxt } from 'src/plugin/text';
|
||||
@@ -23,7 +23,7 @@ import { NetworkServiceService} from 'src/app/services/network-service.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WsChatMethodsService {
|
||||
export class ChatSystemService {
|
||||
|
||||
dm: {[key: string]: RoomService} = {}
|
||||
group: {[key: string]: RoomService} = {}
|
||||
@@ -45,7 +45,7 @@ export class WsChatMethodsService {
|
||||
delete = []
|
||||
|
||||
constructor(
|
||||
private WsChatService: WsChatService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private storage: Storage,
|
||||
private platform: Platform,
|
||||
private sqlservice: SqliteService,
|
||||
@@ -66,7 +66,7 @@ export class WsChatMethodsService {
|
||||
|
||||
this.loadChat()
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: () => {
|
||||
/**
|
||||
@@ -171,7 +171,7 @@ export class WsChatMethodsService {
|
||||
|
||||
async getAllRooms () {
|
||||
this.loadingWholeList = true
|
||||
const rooms = await this.WsChatService.getRooms();
|
||||
const rooms = await this.RochetChatConnectorService.getRooms();
|
||||
try {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
@@ -299,7 +299,7 @@ export class WsChatMethodsService {
|
||||
this.defaultSubtribe(id)
|
||||
}
|
||||
|
||||
this.WsChatService.streamNotifyLogged().then((subscription=>{
|
||||
this.RochetChatConnectorService.streamNotifyLogged().then((subscription=>{
|
||||
|
||||
}))
|
||||
}
|
||||
@@ -326,23 +326,23 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
private defaultSubtribe(id: any) {
|
||||
|
||||
this.WsChatService.streamRoomMessages(id).then((subscription) => {
|
||||
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.message = true;
|
||||
})
|
||||
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
|
||||
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.typing = true;
|
||||
//
|
||||
})
|
||||
|
||||
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
||||
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.readMessage = true;
|
||||
})
|
||||
|
||||
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
||||
this.RochetChatConnectorService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
||||
const room = this.getRoomById(id);
|
||||
room.status.receive.deleteMessage = true;
|
||||
})
|
||||
@@ -389,7 +389,7 @@ export class WsChatMethodsService {
|
||||
if (setData.name != 'Rocket Cat') {
|
||||
// create room
|
||||
if(!this.roomExist(roomId)) {
|
||||
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this)
|
||||
let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this)
|
||||
room.setData(setData)
|
||||
room.receiveMessage()
|
||||
room.getAllUsers = this.getUsers
|
||||
@@ -458,7 +458,7 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
private getUserStatus(id?:string) {
|
||||
|
||||
this.WsChatService.getUserStatus((d) => {
|
||||
this.RochetChatConnectorService.getUserStatus((d) => {
|
||||
|
||||
const username = d.fields.args[0][1]
|
||||
const statusNum = d.fields.args[0][2]
|
||||
@@ -501,11 +501,11 @@ export class WsChatMethodsService {
|
||||
|
||||
|
||||
deleteMessage(id?) {
|
||||
return this.WsChatService.deleteMessage(id);
|
||||
return this.RochetChatConnectorService.deleteMessage(id);
|
||||
}
|
||||
|
||||
leaveRoom(id?) {
|
||||
return this.WsChatService.leaveRoom(id);
|
||||
return this.RochetChatConnectorService.leaveRoom(id);
|
||||
}
|
||||
|
||||
async hideRoom(id) {
|
||||
@@ -526,18 +526,18 @@ export class WsChatMethodsService {
|
||||
|
||||
hidingRoom(id?) {
|
||||
|
||||
return this.WsChatService.hidingRoom(id).then(()=>{
|
||||
return this.RochetChatConnectorService.hidingRoom(id).then(()=>{
|
||||
// this.hideRoom(id)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
addRoomOwner(roomid, userId) {
|
||||
return this.WsChatService.addRoomOwner(roomid, userId);
|
||||
return this.RochetChatConnectorService.addRoomOwner(roomid, userId);
|
||||
}
|
||||
|
||||
createPrivateRoom(groupName, username, customFields){
|
||||
return this.WsChatService.createPrivateRoom(groupName, username, customFields);
|
||||
return this.RochetChatConnectorService.createPrivateRoom(groupName, username, customFields);
|
||||
}
|
||||
|
||||
getDmRoom(id): RoomService {
|
||||
@@ -613,8 +613,7 @@ export class WsChatMethodsService {
|
||||
}
|
||||
|
||||
getUserOfRoom(roomId){
|
||||
return this.WsChatService.getUserOfRoom(roomId);
|
||||
return this.RochetChatConnectorService.getUserOfRoom(roomId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { Storage } from '@ionic/storage';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { capitalizeTxt } from 'src/plugin/text'
|
||||
import { NfService } from 'src/app/services/chat/nf.service'
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { ChatStorageService } from './chat-storage.service'
|
||||
import { ChatMethodsService } from './chat-methods.service'
|
||||
@@ -64,7 +64,7 @@ export class MessageService {
|
||||
|
||||
constructor(private storage: Storage,
|
||||
private NfService: NfService,
|
||||
private WsChatService: WsChatService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private ChatStorageService: ChatStorageService,
|
||||
private ChatMethodsService: ChatMethodsService,
|
||||
private AESEncrypt: AESEncrypt,
|
||||
@@ -166,9 +166,9 @@ export class MessageService {
|
||||
const params = {roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file, localReference: this.localReference}
|
||||
await this.sendRequest(params)
|
||||
|
||||
} else if(this.WsChatService.isLogin == false) {
|
||||
} else if(this.RochetChatConnectorService.isLogin == false) {
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
this.send()
|
||||
@@ -203,7 +203,7 @@ export class MessageService {
|
||||
|
||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||
console.log('online send')
|
||||
this.WsChatService.send(params).then(
|
||||
this.RochetChatConnectorService.send(params).then(
|
||||
(ChatMessage: any) => {
|
||||
console.log('response')
|
||||
ChatMessage = ChatMessage.message.result
|
||||
@@ -215,7 +215,7 @@ export class MessageService {
|
||||
|
||||
} else {
|
||||
console.log("reconnect")
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RochetChatConnectorService } from './rochet-chat-connector.service';
|
||||
|
||||
describe('RochetChatConnectorService', () => {
|
||||
let service: RochetChatConnectorService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(RochetChatConnectorService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+3
-2
@@ -9,7 +9,7 @@ import { chatHistory, Rooms } from 'src/app/models/chatMethod';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WsChatService {
|
||||
export class RochetChatConnectorService {
|
||||
|
||||
isLogin = false;
|
||||
loginResponse = {}
|
||||
@@ -803,4 +803,5 @@ export class WsChatService {
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { chatHistory } from 'src/app/models/chatMethod';
|
||||
@@ -22,7 +22,7 @@ import { AESEncrypt } from '../aesencrypt.service';
|
||||
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
|
||||
import { WsChatMethodsService } from './ws-chat-methods.service';
|
||||
import { ChatSystemService } from './chat-system.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -79,7 +79,7 @@ export class RoomService {
|
||||
chatServiceDeleteRoom = (roomId) => {}
|
||||
|
||||
constructor(
|
||||
public WsChatService: WsChatService,
|
||||
public RochetChatConnectorService: RochetChatConnectorService,
|
||||
private MessageService: MessageService,
|
||||
private storage: Storage,
|
||||
private platform: Platform,
|
||||
@@ -93,11 +93,11 @@ export class RoomService {
|
||||
private AESEncrypt: AESEncrypt,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
private wsChatMethodsService: WsChatMethodsService
|
||||
private ChatSystemService: ChatSystemService
|
||||
) {
|
||||
this.NativeNotificationService.askForPermission()
|
||||
|
||||
this.WsChatService.getUserStatus((d) => {
|
||||
this.RochetChatConnectorService.getUserStatus((d) => {
|
||||
|
||||
const userId = d.fields.args[0][0]
|
||||
const statusNum = d.fields.args[0][2]
|
||||
@@ -136,7 +136,7 @@ export class RoomService {
|
||||
}
|
||||
})
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'Offline',
|
||||
funx: () => {
|
||||
/**
|
||||
@@ -181,7 +181,7 @@ export class RoomService {
|
||||
}
|
||||
}
|
||||
|
||||
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
|
||||
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
|
||||
this.customFields = customFields
|
||||
this.id = id
|
||||
this.name = name
|
||||
@@ -236,15 +236,15 @@ export class RoomService {
|
||||
|
||||
if(this.t === 'p') {
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.id);
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.deleteRoom(this.id);
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatServiceDeleteRoom(this.id);
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.id);
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.deleteRoom(this.id);
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatServiceDeleteRoom(this.id);
|
||||
});
|
||||
}
|
||||
@@ -261,7 +261,7 @@ export class RoomService {
|
||||
|
||||
receiveMessage() {
|
||||
|
||||
this.WsChatService.updateRoomEventss(
|
||||
this.RochetChatConnectorService.updateRoomEventss(
|
||||
this.id,
|
||||
"stream-room-messages",
|
||||
async (IncomingChatMessage:IncomingChatMessage) => {
|
||||
@@ -335,7 +335,7 @@ export class RoomService {
|
||||
}
|
||||
)
|
||||
|
||||
this.WsChatService.receiveStreamNotifyRoom((message) => {
|
||||
this.RochetChatConnectorService.receiveStreamNotifyRoom((message) => {
|
||||
|
||||
if(message.fields.eventName == this.id+'/'+'typing') {
|
||||
|
||||
@@ -446,7 +446,7 @@ export class RoomService {
|
||||
|
||||
async receiveMessageDelete() {
|
||||
|
||||
this.WsChatService.updateRoomEventss(
|
||||
this.RochetChatConnectorService.updateRoomEventss(
|
||||
this.id,
|
||||
"stream-notify-room",
|
||||
async (ChatMessage) => {
|
||||
@@ -532,14 +532,14 @@ export class RoomService {
|
||||
|
||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||
|
||||
this.WsChatService.deleteMessage(msgId).then(async() => {
|
||||
this.RochetChatConnectorService.deleteMessage(msgId).then(async() => {
|
||||
message.delateRequest = true
|
||||
await message.save();
|
||||
this.deleteMessage(msgId);
|
||||
})
|
||||
|
||||
} else {
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
|
||||
@@ -609,7 +609,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
if(lastIsTyping != this.isTyping) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
|
||||
|
||||
@@ -618,7 +618,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendFalseTypingReadMessage(method,param: object) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.setTypingOff()
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ export class RoomService {
|
||||
|
||||
if(this.isTyping == true) {
|
||||
this.isTyping = false
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ export class RoomService {
|
||||
|
||||
|
||||
leave(rid?) {
|
||||
this.WsChatService.leaveRoom(this.id)
|
||||
this.RochetChatConnectorService.leaveRoom(this.id)
|
||||
}
|
||||
|
||||
isJson(str) {
|
||||
@@ -731,7 +731,7 @@ export class RoomService {
|
||||
|
||||
|
||||
|
||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
await this.RochetChatConnectorService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
// console.log('load history', chatHistory)
|
||||
//
|
||||
|
||||
@@ -807,7 +807,7 @@ export class RoomService {
|
||||
message = this.fix_updatedAt(message)
|
||||
|
||||
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -864,7 +864,7 @@ export class RoomService {
|
||||
async prepareCreate({message, save = true}): Promise<MessageService> {
|
||||
message = this.fix_updatedAt(message)
|
||||
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -902,7 +902,7 @@ export class RoomService {
|
||||
|
||||
simplePrepareMessage(message) {
|
||||
message = this.fix_updatedAt(message)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -977,7 +977,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendReadMessage() {
|
||||
this.WsChatService.readMessage(this.id)
|
||||
this.RochetChatConnectorService.readMessage(this.id)
|
||||
this.sendFalseTypingReadMessage('viewMessage', {})
|
||||
this.messageUnread = false
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import * as Rx from 'rxjs/Rx';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class WebsocketService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
private subject: Rx.Subject<MessageEvent>;
|
||||
|
||||
public connect(url): Rx.Subject<MessageEvent> {
|
||||
if(!this.subject){
|
||||
this.subject = this.create(url);
|
||||
|
||||
}
|
||||
return this.subject;
|
||||
}
|
||||
|
||||
private create(url): Rx.Subject<MessageEvent>{
|
||||
let ws = new WebSocket(url);
|
||||
|
||||
let observable = Rx.Observable.create(
|
||||
(obs: Rx.Observer<MessageEvent>) => {
|
||||
ws.onmessage = obs.next.bind(obs);
|
||||
ws.onerror = obs.error.bind(obs);
|
||||
ws.onclose = obs.complete.bind(obs);
|
||||
return ws.close.bind(ws)
|
||||
})
|
||||
|
||||
let observer = {
|
||||
next: (data: Object) => {
|
||||
if(ws.readyState === WebSocket.OPEN){
|
||||
ws.send(JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Rx.Subject.create(observer, observable);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WsChatMethodsService } from './ws-chat-methods.service';
|
||||
|
||||
describe('WsChatMethodsService', () => {
|
||||
let service: WsChatMethodsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WsChatMethodsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WsChatService } from './ws-chat.service';
|
||||
|
||||
describe('WsChatService', () => {
|
||||
let service: WsChatService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(WsChatService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ChatService } from '../chat.service';
|
||||
import { WsChatMethodsService } from '../chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from '../chat/chat-system.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -10,7 +10,7 @@ export class TimeService {
|
||||
room: any;
|
||||
|
||||
constructor(private chatService: ChatService,
|
||||
public wsChatMethodsService: WsChatMethodsService,) { }
|
||||
public ChatSystemService: ChatSystemService,) { }
|
||||
|
||||
showDateDuration(start:any) {
|
||||
let end;
|
||||
@@ -93,13 +93,13 @@ export class TimeService {
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(roomId)
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(roomId)
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).messages; let last = last">
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of ChatSystemService.getGroupRoom(roomId).messages; let last = last">
|
||||
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" >
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||
@@ -240,14 +240,14 @@
|
||||
|
||||
<ion-footer>
|
||||
|
||||
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
|
||||
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
||||
|
||||
<ngx-letters-avatar *ngIf="showAvatar"
|
||||
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
||||
[avatarName]= "ChatSystemService.getGroupRoom(roomId).name"
|
||||
[width]="30"
|
||||
[circular]="true"
|
||||
fontFamily="Roboto"></ngx-letters-avatar>
|
||||
{{ wsChatMethodsService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
||||
{{ ChatSystemService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
|
||||
</div>
|
||||
|
||||
<div class="width-100 pl-20 pr-20">
|
||||
@@ -286,7 +286,7 @@
|
||||
|
||||
<div class="width-100">
|
||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||
<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)="wsChatMethodsService.getGroupRoom(roomId).sendTyping()"></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)]="ChatSystemService.getGroupRoom(roomId).message" (ionChange)="ChatSystemService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
|
||||
</div>
|
||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||
@@ -296,15 +296,15 @@
|
||||
</div>
|
||||
|
||||
<div class="btn-send">
|
||||
<button #recordbtn *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<button #recordbtn *ngIf="!ChatSystemService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||
<button *ngIf="ChatSystemService.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 == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<button *ngIf="!ChatSystemService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
|
||||
@@ -106,7 +106,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
groupNameFormart = "";
|
||||
|
||||
constructor(
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
private chatService: ChatService,
|
||||
@@ -145,11 +145,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
this.getRoomInfo();
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||
//
|
||||
this.wsChatMethodsService.openRoom(this.roomId)
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
this.groupNameFormart = this.wsChatMethodsService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||
this.ChatSystemService.openRoom(this.roomId)
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||
|
||||
this.showAvatar = false
|
||||
|
||||
@@ -404,8 +404,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
async getRoomInfo() {
|
||||
|
||||
if(this.wsChatMethodsService.getGroupRoom(this.roomId)) {
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
if(this.ChatSystemService.getGroupRoom(this.roomId)) {
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||
}
|
||||
|
||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||
@@ -448,11 +448,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
// });
|
||||
// }
|
||||
|
||||
this.members = this.wsChatMethodsService.getGroupRoom(this.roomId).members
|
||||
this.members = this.ChatSystemService.getGroupRoom(this.roomId).members
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
|
||||
this.ChatSystemService.getGroupRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
@@ -497,7 +497,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/audio",
|
||||
"msDuration": audioFile.value.msDuration,
|
||||
@@ -516,7 +516,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
deleteMessage(msgId: string) {
|
||||
const room = this.wsChatMethodsService.getGroupRoom(this.roomId)
|
||||
const room = this.ChatSystemService.getGroupRoom(this.roomId)
|
||||
this.alertService.confirmDeleteMessage(msgId, room);
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.getRoomInfo();
|
||||
this.closeAllDesktopComponents.emit();
|
||||
this.showEmptyContainer.emit();
|
||||
this.wsChatMethodsService.hidingRoom(this.roomId);
|
||||
this.ChatSystemService.hidingRoom(this.roomId);
|
||||
}
|
||||
else if (res.data == 'delete') {
|
||||
this.closeAllDesktopComponents.emit();
|
||||
@@ -770,7 +770,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": '',
|
||||
@@ -799,7 +799,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -840,7 +840,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
if (data.selected) {
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"name": res.data.selected.Assunto,
|
||||
"type": "application/webtrix",
|
||||
@@ -886,7 +886,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -919,7 +919,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div class="main-content">
|
||||
|
||||
<ion-virtual-scroll [items]="WsChatMethodsService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { MessagesPage } from '../messages.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@Component({
|
||||
@@ -34,7 +34,7 @@ export class ContactsPage implements OnInit {
|
||||
private chatService: ChatService,
|
||||
private authService: AuthService,
|
||||
public ThemeService: ThemeService,
|
||||
public WsChatMethodsService: WsChatMethodsService
|
||||
public ChatSystemService: ChatSystemService
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.textSearch="";
|
||||
@@ -124,7 +124,7 @@ export class ContactsPage implements OnInit {
|
||||
|
||||
this.room = res['room'];
|
||||
this.openMessagesModal(this.room._id);
|
||||
this.WsChatMethodsService.getAllRooms()
|
||||
this.ChatSystemService.getAllRooms()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main-header">
|
||||
<div class="header-top">
|
||||
<div class="middle">
|
||||
<ion-label class="title">{{ this.wsChatMethodsService.getDmRoom(this.roomId).name }}</ion-label>
|
||||
<ion-label class="title">{{ this.ChatSystemService.getDmRoom(this.roomId).name }}</ion-label>
|
||||
<button (click)="ChatMessageDebuggingPage()">Dev</button>
|
||||
<!-- <span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span> -->
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
<ion-list>
|
||||
|
||||
<div class="messages-list-item-wrapper container-width-100"
|
||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; index as i; let last = last">
|
||||
*ngFor="let msg of ChatSystemService.getDmRoom(roomId).messages; index as i; let last = last">
|
||||
|
||||
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''">
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
@@ -218,11 +218,11 @@
|
||||
</ion-content>
|
||||
|
||||
|
||||
<ion-footer (click)="wsChatMethodsService.getDmRoom(roomId).sendReadMessage()">
|
||||
<ion-footer (click)="ChatSystemService.getDmRoom(roomId).sendReadMessage()">
|
||||
|
||||
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true" >
|
||||
<div class="typing" *ngIf="ChatSystemService.getDmRoom(roomId).otherUserType == true" >
|
||||
<ngx-letters-avatar *ngIf="showAvatar"
|
||||
[avatarName]= "wsChatMethodsService.getDmRoom(roomId).name"
|
||||
[avatarName]= "ChatSystemService.getDmRoom(roomId).name"
|
||||
[width]="30"
|
||||
[circular]="true"
|
||||
fontFamily="Roboto"></ngx-letters-avatar>
|
||||
@@ -268,7 +268,7 @@
|
||||
|
||||
<div class="width-100">
|
||||
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
|
||||
<ion-textarea *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
||||
<ion-textarea *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="ChatSystemService.getDmRoom(roomId).message" (ionChange)="ChatSystemService.getDmRoom(roomId).sendTyping()"></ion-textarea>
|
||||
</div>
|
||||
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
|
||||
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
|
||||
@@ -278,16 +278,16 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<button #recordbtn *ngIf="!ChatSystemService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||
<!-- <ion-icon *ngIf="audioPermissionStatus != 'granted' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio-disable.svg"></ion-icon> -->
|
||||
</button>
|
||||
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||
<button *ngIf="ChatSystemService.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 == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<button *ngIf="!ChatSystemService.getDmRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
|
||||
<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>
|
||||
</button>
|
||||
|
||||
@@ -15,8 +15,8 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service'
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { CameraService } from 'src/app/services/camera.service';
|
||||
@@ -116,8 +116,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private gestureController: GestureController,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public WsChatService: WsChatService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
public RochetChatConnectorService: RochetChatConnectorService,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private CameraService: CameraService,
|
||||
private sanitiser: DomSanitizer,
|
||||
@@ -131,12 +131,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
|
||||
this.wsChatMethodsService.openRoom(this.roomId)
|
||||
this.ChatSystemService.openRoom(this.roomId)
|
||||
|
||||
this.showAvatar = false
|
||||
|
||||
@@ -176,7 +176,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatService.refreshtoken();
|
||||
this.scrollToBottom();
|
||||
this.getChatMembers();
|
||||
@@ -406,7 +406,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
||||
this.ChatSystemService.getDmRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/audio",
|
||||
"msDuration": audioFile.value.msDuration,
|
||||
@@ -450,7 +450,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
deleteMessage(msgId: string, msg: MessageService) {
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
||||
this.ChatSystemService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
@@ -534,8 +534,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
// this.showLoader = false;
|
||||
// });
|
||||
|
||||
this.members = this.wsChatMethodsService.getDmRoom(this.roomId).members
|
||||
this.dmUsers = this.wsChatMethodsService.getDmRoom(this.roomId).membersExcludeMe
|
||||
this.members = this.ChatSystemService.getDmRoom(this.roomId).members
|
||||
this.dmUsers = this.ChatSystemService.getDmRoom(this.roomId).membersExcludeMe
|
||||
}
|
||||
|
||||
async openMessagesOptions(ev: any) {
|
||||
@@ -669,7 +669,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": '',
|
||||
@@ -702,7 +702,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -744,7 +744,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
if (data.selected) {
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"name": res.data.selected.Assunto,
|
||||
"type": "application/webtrix",
|
||||
@@ -787,7 +787,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": ''
|
||||
@@ -821,7 +821,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
@@ -1134,7 +1134,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
async getRoomInfo() {
|
||||
// this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
// this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||
// console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angu
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
@@ -39,7 +39,7 @@ export class NewGroupPage implements OnInit{
|
||||
private modalController: ModalController,
|
||||
private dataService:DataService,
|
||||
private router: Router,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService
|
||||
@@ -90,10 +90,10 @@ export class NewGroupPage implements OnInit{
|
||||
let customFields = {
|
||||
"countDownDate":this.thedate
|
||||
}
|
||||
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
}
|
||||
else {
|
||||
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,9 +104,9 @@ export class NewGroupPage implements OnInit{
|
||||
|
||||
if(res?.result?.rid) {
|
||||
this.addGroupMessage.emit(res.result.rid);
|
||||
await this.wsChatMethodsService.getAllRooms();
|
||||
await this.ChatSystemService.getAllRooms();
|
||||
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
@@ -127,7 +127,7 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
|
||||
createGroupWithAttachmentsCath(res: any) {
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
||||
setTimeout(()=>{
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
}, 1500)
|
||||
@@ -137,10 +137,10 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
|
||||
createGroupWithAttachments(res: any) {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).hasLoadHistory = true;
|
||||
this.ChatSystemService.getGroupRoom(res.result.rid).hasLoadHistory = true;
|
||||
|
||||
this.documents.forEach(element => {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
|
||||
this.ChatSystemService.getGroupRoom(res.result.rid).send({
|
||||
file: {
|
||||
"name": element.Assunto,
|
||||
"type": "application/webtrix",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<ion-content>
|
||||
<ul>
|
||||
<li>Chat login</li>
|
||||
<li>Chat user list {{ wsChatMethodsService.users | json }}</li>
|
||||
<li>Chat user list {{ ChatSystemService.users | json }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li *ngFor="let room of wsChatMethodsService._dm">chat Name: {{room.name}}; subcribe: {{room.status.receive.message}}; </li>
|
||||
<li *ngFor="let room of ChatSystemService._dm">chat Name: {{room.name}}; subcribe: {{room.status.receive.message}}; </li>
|
||||
</ul>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-debugging',
|
||||
@@ -9,7 +9,7 @@ import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.servi
|
||||
export class ChatDebuggingPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
public wsChatMethodsService: WsChatMethodsService
|
||||
public ChatSystemService: ChatSystemService
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-message-debugging',
|
||||
@@ -12,7 +12,7 @@ export class ChatMessageDebuggingPage implements OnInit {
|
||||
roomId: string
|
||||
|
||||
constructor(
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
private navParams: NavParams
|
||||
) { }
|
||||
|
||||
@@ -23,7 +23,7 @@ export class ChatMessageDebuggingPage implements OnInit {
|
||||
}
|
||||
|
||||
loadHistory() {
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({});
|
||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
@@ -27,7 +27,7 @@ export class ChatPopoverPage implements OnInit {
|
||||
private chatService: ChatService,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
public ChatSystemService: ChatSystemService,
|
||||
) {
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
this.members = this.navParams.get('members');
|
||||
@@ -73,7 +73,7 @@ export class ChatPopoverPage implements OnInit {
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res.data == 'success'){
|
||||
this.leaveGroup();
|
||||
//this.wsChatMethodsService.hidingRoom(this.roomId);
|
||||
//this.ChatSystemService.hidingRoom(this.roomId);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -82,8 +82,8 @@ export class ChatPopoverPage implements OnInit {
|
||||
|
||||
let body = { "roomId":this.roomId, }
|
||||
|
||||
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
|
||||
this.wsChatMethodsService.deleteRoom(this.roomId)
|
||||
let res:any = await this.ChatSystemService.leaveRoom(this.roomId);
|
||||
this.ChatSystemService.deleteRoom(this.roomId)
|
||||
|
||||
if(res.error){
|
||||
if(res.error.error = "error-you-are-last-owner"){
|
||||
@@ -114,12 +114,12 @@ export class ChatPopoverPage implements OnInit {
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.roomId)
|
||||
this.ChatSystemService.deleteRoom(this.roomId)
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.roomId)
|
||||
this.ChatSystemService.deleteRoom(this.roomId)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user