mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
multiple changes
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher> -->
|
||||
<div (click)="handleClick()" class="messages" #scrollMe>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getRoom(this.roomId).massages; let last = last"
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).massages; 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}}' (click)="openPreview(msg)" *ngIf="msg.msg !=''">
|
||||
<div class="title">
|
||||
|
||||
@@ -108,7 +108,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
};
|
||||
|
||||
this.wsChatMethodsService.getRoom(this.roomId).loadHistory()
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ export class LoginPage implements OnInit {
|
||||
private changeProfileService: ChangeProfileService,
|
||||
public ThemeService: ThemeService,
|
||||
private storageservice: StorageService,
|
||||
private chatService: ChatService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -102,7 +101,7 @@ export class LoginPage implements OnInit {
|
||||
// login to API successfully
|
||||
if (attempt) {
|
||||
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
if (attempt.UserId == SessionStore.user.UserId) {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
|
||||
@@ -73,8 +73,8 @@ export class RoomService {
|
||||
this.massages.push(wewMessage)
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
this.hasLoadHistory = true
|
||||
}
|
||||
|
||||
|
||||
@@ -88,12 +88,16 @@ export class WsChatMethodsService {
|
||||
}
|
||||
}
|
||||
|
||||
getRoom(id): RoomService {
|
||||
getDmRoom(id): RoomService {
|
||||
try {
|
||||
return this.dm[id]
|
||||
} catch(e) {
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
getGroupRoom(id): RoomService {
|
||||
try {
|
||||
return this.group[id]
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
getRoomName(roomData: room) {
|
||||
|
||||
@@ -44,7 +44,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 messages; let last = last">
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).massages; let last = last">
|
||||
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && 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>
|
||||
|
||||
@@ -90,7 +90,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
private fileService: FileService,
|
||||
public ThemeService: ThemeService,
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
//public wsChatMethodsService: WsChatMethodsService
|
||||
public wsChatMethodsService: WsChatMethodsService
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = true;
|
||||
@@ -101,11 +101,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.getRoomInfo();
|
||||
//this.scrollToBottom();
|
||||
//this.wsChatMethodsService.getRoom(this.roomId).loadHistory();
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory();
|
||||
console.log('MESSAGES'+this.wsChatMethodsService.getGroupRoom(this.roomId).massages);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
alert('Here')
|
||||
//console.log(this.wsChatMethodsService.getRoom(this.roomId).massages);
|
||||
|
||||
this.loggedUser=this.loggedUserChat;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="messages" #scrollMe>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getRoom(roomId).massages; let last = last">
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).massages; let last = last">
|
||||
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="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>
|
||||
|
||||
@@ -84,7 +84,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.wsChatMethodsService.getRoom(this.roomId).loadHistory()
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -214,7 +214,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.wsChatMethodsService.getRoom(this.roomId).send(this.message)
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send(this.message)
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user