This commit is contained in:
Peter Maquiran
2022-04-18 15:12:27 +01:00
parent 8c704ca898
commit 7de80902cf
14 changed files with 41 additions and 24 deletions
@@ -7,6 +7,7 @@ import { GroupMessagesPage } from '../../group-messages/group-messages.page';
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 { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-contacts',
@@ -24,6 +25,7 @@ export class ContactsPage implements OnInit {
textSearch:string;
room:any;
dm:any;
sessionStore = SessionStore
constructor(
private modalController: ModalController,
@@ -55,7 +57,7 @@ export class ContactsPage implements OnInit {
};
this.chatService.getAllUsers().subscribe((res:any)=>{
console.log(res.users);
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.RochetChatUser);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
@@ -50,7 +50,7 @@
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}'
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}'
*ngIf="msg.msg !=''">
<div class="title">
<ion-label (click)="hkellor()">{{msg.u.name}}</ion-label>
@@ -74,7 +74,7 @@
<div *ngIf="msg.file && msg.delate == false">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.file.type != 'application/meeting'">
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=sessionStore.user.RochetChatUser}}' *ngIf="msg.file.type != 'application/meeting'">
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg.duration}}</span>
+3 -1
View File
@@ -46,6 +46,7 @@ import { StringDecoder } from 'string_decoder';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { DocumentViewer } from '@awesome-cordova-plugins/document-viewer/ngx';
import { SessionStore } from 'src/app/store/session.service';
const IMAGE_DIR = 'stored-images';
@@ -110,6 +111,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
downloadLoader: boolean;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
sessionStore = SessionStore
constructor(
public popoverController: PopoverController,
@@ -534,7 +536,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.RochetChatUser)
this.showLoader = false;
});
}