mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
merge developer
This commit is contained in:
@@ -39,7 +39,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
showLoader: boolean;
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
messages:any;
|
||||
|
||||
room:any;
|
||||
roomName:any;
|
||||
@@ -101,7 +100,8 @@ 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)
|
||||
|
||||
setTimeout(()=>{
|
||||
this.scrollToBottomClicked()
|
||||
}, 50)
|
||||
@@ -613,7 +613,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
|
||||
this.messages = chatmsgArray;
|
||||
// this.messages = chatmsgArray;
|
||||
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
|
||||
})
|
||||
}
|
||||
@@ -672,7 +672,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//this.loadMessages()
|
||||
let msgOnly = res['messages'].filter(data => data.t != 'au');
|
||||
//this.messages = msgOnly.reverse();
|
||||
console.log('MOBILE MSG ROCKET',this.messages);
|
||||
// console.log('MOBILE MSG ROCKET',this.messages);
|
||||
this.transformDataMSG(msgOnly.reverse());
|
||||
this.getRoomMessageDB(this.roomId);
|
||||
// Reconnect in one second
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</ion-refresher>
|
||||
<div class="main-content">
|
||||
|
||||
<ion-virtual-scroll [items]="users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<ion-virtual-scroll [items]="WsChatMethodsService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ChatService } from 'src/app/services/chat.service';
|
||||
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'
|
||||
|
||||
@Component({
|
||||
selector: 'app-contacts',
|
||||
@@ -29,7 +30,8 @@ export class ContactsPage implements OnInit {
|
||||
private http: HttpClient,
|
||||
private chatService: ChatService,
|
||||
private authService: AuthService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
public WsChatMethodsService: WsChatMethodsService
|
||||
)
|
||||
{
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
|
||||
@@ -49,8 +49,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
canvas: any
|
||||
ctx: any
|
||||
loggedUser: any;
|
||||
message = '';
|
||||
messages: any;
|
||||
userPresence = '';
|
||||
dmUsers: any;
|
||||
roomId: string;
|
||||
@@ -114,7 +112,8 @@ 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)
|
||||
|
||||
setTimeout(()=>{
|
||||
this.scrollToBottomClicked()
|
||||
}, 150)
|
||||
@@ -348,31 +347,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": this.roomId, "msg": this.message
|
||||
}
|
||||
}
|
||||
this.chatService.sendMessage(body).subscribe(res => {
|
||||
//this.loadMessages();
|
||||
this.scrollingOnce = true;
|
||||
});
|
||||
this.message = "";
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send()
|
||||
}
|
||||
|
||||
loadMessages() {
|
||||
this.showLoader = true;
|
||||
const roomId = this.roomId;
|
||||
|
||||
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
||||
console.log(res);
|
||||
this.messages = res['messages'].reverse();
|
||||
this.chatMessageStore.add(roomId, this.messages)
|
||||
console.log(this.messages);
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
|
||||
viewDocument(file: any, url?: string) {
|
||||
|
||||
@@ -575,7 +553,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||
//this.addDocGestaoDocumental();
|
||||
}
|
||||
this.loadMessages();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
@@ -641,7 +619,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
|
||||
this.messages = chatmsgArray.reverse();
|
||||
|
||||
console.log('CHAT MSG FROM DB', chatmsgArray)
|
||||
})
|
||||
}
|
||||
@@ -716,8 +694,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//showMessage(response.statusText);
|
||||
//this.loadMessages()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.messages = res['messages'].reverse();
|
||||
this.chatMessageStore.add(roomId, this.messages)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user