mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
customise message when group name is changed
This commit is contained in:
@@ -49,10 +49,10 @@
|
||||
</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div class="item-date">{{dm.lastMessage._updatedAt | date: 'HH:mm'}}</div>
|
||||
<div class="item-date">{{dm._updatedAt | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<ion-label>{{dm.lastMessage.msg}}</ion-label>
|
||||
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,13 +56,8 @@ export class ChatPage implements OnInit {
|
||||
|
||||
});
|
||||
this.doRefresh();
|
||||
/* this.loadJoinedRooms(); */
|
||||
}
|
||||
loadJoinedRooms(){
|
||||
this.chatService.loadJoinedRooms().subscribe(res => {
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
onSegmentChange(){
|
||||
this.doRefresh();
|
||||
}
|
||||
@@ -84,7 +79,6 @@ export class ChatPage implements OnInit {
|
||||
getDirectMessages(){
|
||||
this.showLoader = true;
|
||||
|
||||
/* this.result = */
|
||||
this.chatService.getAllDirectMessages().subscribe((res:any)=>{
|
||||
console.log(res.ims);
|
||||
|
||||
@@ -101,8 +95,6 @@ export class ChatPage implements OnInit {
|
||||
getChatMembers(){
|
||||
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
/* console.log(res);
|
||||
console.log(this.dmUsers); */
|
||||
});
|
||||
}
|
||||
getGroups(){
|
||||
@@ -123,38 +115,7 @@ export class ChatPage implements OnInit {
|
||||
});
|
||||
});
|
||||
}
|
||||
/* getConnectedChannels(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.userChannels = res.channels;
|
||||
console.log(res);
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
/* getConnectedRooms(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllRooms().subscribe((res:any)=>{
|
||||
this.userRooms = res.update;
|
||||
console.log(res.update);
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
/* getConnectedUsers(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{
|
||||
this.userConnectedList = res.users;
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
|
||||
async startConversation(selectedUser) {
|
||||
const modal = await this.modalController.create({
|
||||
component: ConversationPage,
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<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">
|
||||
<div *ngFor="let msg of messages" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||
<div *ngFor="let msg of messages" class="messages">
|
||||
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.username}}</ion-label>
|
||||
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
|
||||
@@ -40,6 +40,9 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||
<ion-label>Alterou o assunto de para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -90,6 +90,19 @@
|
||||
margin: 20px 39px 25px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.info-text{
|
||||
/* width: 322px; */
|
||||
width: em(422px);
|
||||
background: #fef4c5;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
}
|
||||
.messages{
|
||||
font-size: 13px;
|
||||
font-family: Roboto;
|
||||
|
||||
@@ -49,42 +49,6 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Presidente da República</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Pois é, momentos históricos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Ministro do interior</ion-label>
|
||||
<span class="time">16:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Grande momento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -47,7 +47,6 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
/* console.log(this.dm); */
|
||||
|
||||
/* setInterval(()=>{ */
|
||||
this.checkUserPresence();
|
||||
this.loadMessages();
|
||||
/* }, 2000); */
|
||||
|
||||
@@ -71,11 +70,6 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
|
||||
}
|
||||
|
||||
checkUserPresence(){
|
||||
this.chatService.getUserPresence(this.dm.lastMessage.u._id).subscribe(res=>{
|
||||
this.userPresence = res['presence'];
|
||||
});
|
||||
}
|
||||
sendMessage(){
|
||||
|
||||
let body = {
|
||||
@@ -95,6 +89,8 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
this.chatService.getRoomMessages(this.dm._id).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
this.messages = res['messages'].reverse();
|
||||
console.log(this.messages);
|
||||
|
||||
})
|
||||
}
|
||||
getChatMembers(){
|
||||
|
||||
Reference in New Issue
Block a user