MOBILE-2914 messages: New unstar and add/remove contact icons
parent
dd1076f994
commit
ec5ec8036f
|
@ -13,14 +13,14 @@
|
|||
<core-context-menu [aria-label]="'addon.messages.conversationactions' | translate">
|
||||
<core-context-menu-item [hidden]="isSelf || !showInfo || isGroup" [priority]="1000" [content]="'addon.messages.info' | translate" (action)="viewInfo()" iconAction="information-circle"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !showInfo || !isGroup" [priority]="1000" [content]="'addon.messages.groupinfo' | translate" (action)="viewInfo()" iconAction="information-circle"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversation" [priority]="800" [content]="(conversation && conversation.isfavourite ? 'addon.messages.removefromfavourites' : 'addon.messages.addtofavourites') | translate" (action)="changeFavourite($event)" [closeOnClick]="false" [iconAction]="favouriteIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversation" [priority]="800" [content]="(conversation && conversation.isfavourite ? 'addon.messages.removefromfavourites' : 'addon.messages.addtofavourites') | translate" (action)="changeFavourite($event)" [closeOnClick]="false" [iconAction]="favouriteIcon" [iconSlash]="favouriteIconSlash"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || otherMember.isblocked" [priority]="700" [content]="'addon.messages.blockuser' | translate" (action)="blockUser()" [iconAction]="blockIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || !otherMember.isblocked" [priority]="700" [content]="'addon.messages.unblockuser' | translate" (action)="unblockUser()" [iconAction]="blockIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="!muteEnabled || !conversation" [priority]="600" [content]="(conversation && conversation.ismuted ? 'addon.messages.unmuteconversation' : 'addon.messages.muteconversation') | translate" (action)="changeMute($event)" [closeOnClick]="false" [iconAction]="muteIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="!canDelete" [priority]="400" [content]="'addon.messages.showdeletemessages' | translate" (action)="toggleDelete()" [iconAction]="(showDelete ? 'checkbox-outline' : 'square-outline')"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="!groupMessagingEnabled || !conversationId || isGroup" [priority]="200" [content]="'addon.messages.deleteconversation' | translate" (action)="deleteConversation($event)" [closeOnClick]="false" [iconAction]="deleteIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || otherMember.iscontact || requestContactSent || requestContactReceived" [priority]="100" [content]="'addon.messages.addtoyourcontacts' | translate" (action)="createContactRequest()" [iconAction]="addRemoveIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || !otherMember.iscontact" [priority]="100" [content]="'addon.messages.removefromyourcontacts' | translate" (action)="removeContact()" [iconAction]="addRemoveIcon"></core-context-menu-item>
|
||||
<core-context-menu-item [hidden]="isSelf || !otherMember || !otherMember.iscontact" [priority]="100" [content]="'addon.messages.removefromyourcontacts' | translate" (action)="removeContact()" [iconAction]="addRemoveIcon" [iconSlash]="true"></core-context-menu-item>
|
||||
</core-context-menu>
|
||||
</core-navbar-buttons>
|
||||
</ion-header>
|
||||
|
|
|
@ -80,9 +80,10 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
isGroup = false;
|
||||
members: any = {}; // Members that wrote a message, indexed by ID.
|
||||
favouriteIcon = 'fa-star';
|
||||
favouriteIconSlash = false;
|
||||
deleteIcon = 'trash';
|
||||
blockIcon = 'close-circle';
|
||||
addRemoveIcon = 'add';
|
||||
addRemoveIcon = 'person';
|
||||
otherMember: any; // Other member information (individual conversations only).
|
||||
footerType: 'message' | 'blocked' | 'requiresContact' | 'requestSent' | 'requestReceived' | 'unable';
|
||||
requestContactSent = false;
|
||||
|
@ -244,7 +245,6 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
this.title = member.fullname;
|
||||
}
|
||||
this.blockIcon = this.otherMember && this.otherMember.isblocked ? 'checkmark-circle' : 'close-circle';
|
||||
this.addRemoveIcon = this.otherMember && this.otherMember.iscontact ? 'remove' : 'add';
|
||||
}));
|
||||
} else {
|
||||
this.otherMember = null;
|
||||
|
@ -446,7 +446,8 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
this.title = conversation.name;
|
||||
this.conversationImage = conversation.imageurl;
|
||||
this.isGroup = conversation.type == AddonMessagesProvider.MESSAGE_CONVERSATION_TYPE_GROUP;
|
||||
this.favouriteIcon = conversation.isfavourite ? 'fa-star-o' : 'fa-star';
|
||||
this.favouriteIcon = 'fa-star';
|
||||
this.favouriteIconSlash = conversation.isfavourite;
|
||||
this.muteIcon = conversation.ismuted ? 'volume-up' : 'volume-off';
|
||||
if (!this.isGroup) {
|
||||
this.userId = conversation.userid;
|
||||
|
@ -1118,7 +1119,8 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
}).catch((error) => {
|
||||
this.domUtils.showErrorModalDefault(error, 'Error changing favourite state.');
|
||||
}).finally(() => {
|
||||
this.favouriteIcon = this.conversation.isfavourite ? 'fa-star-o' : 'fa-star';
|
||||
this.favouriteIcon = 'fa-star';
|
||||
this.favouriteIconSlash = this.conversation.isfavourite;
|
||||
done && done();
|
||||
});
|
||||
}
|
||||
|
@ -1306,7 +1308,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
}).catch((error) => {
|
||||
this.domUtils.showErrorModalDefault(error, 'core.error', true);
|
||||
}).finally(() => {
|
||||
this.addRemoveIcon = this.otherMember.iscontact ? 'remove' : 'add';
|
||||
this.addRemoveIcon = 'person';
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1381,7 +1383,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
|
|||
}).catch((error) => {
|
||||
this.domUtils.showErrorModalDefault(error, 'core.error', true);
|
||||
}).finally(() => {
|
||||
this.addRemoveIcon = this.otherMember.iscontact ? 'remove' : 'add';
|
||||
this.addRemoveIcon = 'person';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue