rename files

This commit is contained in:
Peter Maquiran
2022-09-30 15:13:36 +01:00
parent 64ad7bbc7f
commit 12cf5831a8
36 changed files with 256 additions and 315 deletions
+6 -6
View File
@@ -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()"
+5 -5
View File
@@ -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 -10
View File
@@ -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>
+16 -16
View File
@@ -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)
}
+9 -7
View File
@@ -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();