2018-02-14 16:19:09 +00:00
|
|
|
|
<ion-header>
|
2018-07-13 11:10:55 +00:00
|
|
|
|
<ion-navbar core-back-button>
|
2018-11-19 10:10:25 +00:00
|
|
|
|
<ion-title>
|
2019-04-26 07:02:17 +00:00
|
|
|
|
<img *ngIf="loaded && !otherMember && conversationImage" class="core-bar-button-image" [src]="conversationImage" [alt]="title" onError="this.src='assets/img/group-avatar.png'" core-external-content role="presentation" [siteId]="siteId || null">
|
2019-01-04 10:55:57 +00:00
|
|
|
|
<ion-avatar *ngIf="loaded && otherMember" class="core-bar-button-image" core-user-avatar [user]="otherMember" [linkProfile]="false" [checkOnline]="otherMember.showonlinestatus" item-start (click)="showInfo && viewInfo()"></ion-avatar>
|
2018-12-20 14:55:18 +00:00
|
|
|
|
<core-format-text [text]="title" (click)="showInfo && !isGroup && viewInfo()"></core-format-text>
|
2019-04-26 07:02:17 +00:00
|
|
|
|
<core-icon *ngIf="conversation && conversation.isfavourite" name="fa-star" [label]="'core.favourites' | translate"></core-icon>
|
|
|
|
|
<core-icon *ngIf="conversation && conversation.ismuted" name="volume-off" [label]="'addon.messages.mutedconversation' | translate"></core-icon>
|
2018-11-19 10:10:25 +00:00
|
|
|
|
</ion-title>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<ion-buttons end></ion-buttons>
|
|
|
|
|
</ion-navbar>
|
|
|
|
|
<core-navbar-buttons end>
|
2019-04-26 07:02:17 +00:00
|
|
|
|
<core-context-menu [aria-label]="'addon.messages.conversationactions' | translate">
|
2019-04-09 12:42:09 +00:00
|
|
|
|
<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>
|
2018-12-20 09:09:45 +00:00
|
|
|
|
<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>
|
2019-04-09 12:42:09 +00:00
|
|
|
|
<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>
|
2019-04-04 14:02:40 +00:00
|
|
|
|
<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>
|
2018-12-20 09:09:45 +00:00
|
|
|
|
<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>
|
2019-04-09 12:42:09 +00:00
|
|
|
|
<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>
|
2018-11-19 10:10:25 +00:00
|
|
|
|
</core-context-menu>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
</core-navbar-buttons>
|
|
|
|
|
</ion-header>
|
2018-09-03 11:29:20 +00:00
|
|
|
|
<ion-content class="has-footer">
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<core-loading [hideUntil]="loaded">
|
|
|
|
|
<!-- Load previous messages. -->
|
2018-11-16 14:07:34 +00:00
|
|
|
|
<core-infinite-loading [enabled]="canLoadMore" (action)="loadPrevious($event)" position="top" [error]="loadMoreError"></core-infinite-loading>
|
2019-04-09 12:42:09 +00:00
|
|
|
|
|
|
|
|
|
<ng-container *ngIf="isSelf && !canLoadMore">
|
|
|
|
|
<p text-center>{{ 'addon.messages.selfconversation' | translate }}</p>
|
|
|
|
|
<p text-center><i>{{ 'addon.messages.selfconversationdefaultmessage' | translate }}</i></p>
|
|
|
|
|
</ng-container>
|
|
|
|
|
|
2018-12-11 14:40:45 +00:00
|
|
|
|
<ion-list class="addon-messages-discussion-container safe-area-page" [class.addon-messages-discussion-group]="isGroup" [attr.aria-live]="'polite'">
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<ng-container *ngFor="let message of messages; index as index; last as last">
|
2018-12-11 14:40:45 +00:00
|
|
|
|
<h6 text-center *ngIf="message.showDate" class="addon-messages-date">
|
2018-12-13 14:35:47 +00:00
|
|
|
|
{{ message.timecreated | coreFormatDate: "strftimedayshort" }}
|
2018-12-11 14:40:45 +00:00
|
|
|
|
</h6>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
|
2018-11-19 10:10:25 +00:00
|
|
|
|
<ion-chip class="addon-messages-unreadfrom" *ngIf="unreadMessageFrom && message.id == unreadMessageFrom" color="light">
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<ion-label>{{ 'addon.messages.newmessages' | translate:{$a: title} }}</ion-label>
|
|
|
|
|
<ion-icon name="arrow-round-down"></ion-icon>
|
|
|
|
|
</ion-chip>
|
|
|
|
|
|
2018-12-11 14:40:45 +00:00
|
|
|
|
<ion-item text-wrap (longPress)="copyMessage(message)" class="addon-message" [class.addon-message-mine]="message.useridfrom == currentUserId" [class.addon-message-not-mine]="message.useridfrom != currentUserId" [class.addon-message-no-user]="!message.showUserData" [@coreSlideInOut]="message.useridfrom == currentUserId ? '' : 'fromLeft'">
|
2018-11-19 12:04:59 +00:00
|
|
|
|
<!-- User data. -->
|
2019-04-26 15:36:27 +00:00
|
|
|
|
<h2 class="addon-message-user">
|
2018-12-11 14:40:45 +00:00
|
|
|
|
<ion-avatar item-start core-user-avatar [user]="members[message.useridfrom]" [linkProfile]="false" *ngIf="message.showUserData"></ion-avatar>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="message.showUserData">{{ members[message.useridfrom].fullname }}</div>
|
|
|
|
|
|
2018-12-13 14:35:47 +00:00
|
|
|
|
<ion-note *ngIf="!message.pending">{{ message.timecreated | coreFormatDate: "strftimetime" }}</ion-note>
|
2018-12-11 14:40:45 +00:00
|
|
|
|
<ion-note *ngIf="message.pending"><ion-icon name="time"></ion-icon></ion-note>
|
|
|
|
|
</h2>
|
2018-11-19 12:04:59 +00:00
|
|
|
|
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<!-- Some messages have <p> and some others don't. Add a <p> so they all have same styles. -->
|
|
|
|
|
<p class="addon-message-text">
|
|
|
|
|
<core-format-text (afterRender)="last && scrollToBottom()" [text]="message.text"></core-format-text>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<button ion-button icon-only clear="true" *ngIf="!message.sending && showDelete" (click)="deleteMessage(message, index)" class="addon-messages-delete-button" [@coreSlideInOut]="'fromRight'" [attr.aria-label]=" 'addon.messages.deletemessage' | translate">
|
|
|
|
|
<ion-icon name="trash" color="danger"></ion-icon>
|
|
|
|
|
</button>
|
2019-04-26 15:36:27 +00:00
|
|
|
|
<div class="tail" *ngIf="message.showTail"></div>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
</ion-item>
|
|
|
|
|
</ng-container>
|
|
|
|
|
</ion-list>
|
2018-12-18 10:10:06 +00:00
|
|
|
|
<core-empty-box *ngIf="!messages || messages.length <= 0" icon="chatbubbles" [message]="'addon.messages.nomessagesfound' | translate"></core-empty-box>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
</core-loading>
|
|
|
|
|
</ion-content>
|
2018-11-28 14:50:32 +00:00
|
|
|
|
<ion-footer color="light" class="footer-adjustable" *ngIf="loaded && (!conversationId || conversation)">
|
2018-02-14 16:19:09 +00:00
|
|
|
|
<ion-toolbar color="light" position="bottom">
|
2018-12-07 12:29:14 +00:00
|
|
|
|
<p *ngIf="footerType == 'unable'" text-center margin-horizontal>{{ 'addon.messages.unabletomessage' | translate }}</p>
|
|
|
|
|
<div *ngIf="footerType == 'blocked'" padding-horizontal>
|
|
|
|
|
<p text-center>{{ 'addon.messages.youhaveblockeduser' | translate }}</p>
|
|
|
|
|
<button ion-button block text-wrap margin-bottom (click)="unblockUser()">{{ 'addon.messages.unblockuser' | translate }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div *ngIf="footerType == 'requiresContact'" padding-horizontal>
|
|
|
|
|
<p text-center><strong>{{ 'addon.messages.isnotinyourcontacts' | translate: {$a: otherMember.fullname} }}</strong></p>
|
|
|
|
|
<p text-center>{{ 'addon.messages.requirecontacttomessage' | translate: {$a: otherMember.fullname} }}</p>
|
|
|
|
|
<button ion-button block text-wrap margin-bottom (click)="createContactRequest()">{{ 'addon.messages.sendcontactrequest' | translate }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div *ngIf="footerType == 'requestReceived'" padding-horizontal>
|
|
|
|
|
<p text-center>{{ 'addon.messages.userwouldliketocontactyou' | translate: {$a: otherMember.fullname} }}</p>
|
|
|
|
|
<button ion-button block text-wrap margin-bottom (click)="confirmContactRequest()">{{ 'addon.messages.acceptandaddcontact' | translate }}</button>
|
|
|
|
|
<button ion-button block text-wrap margin-bottom color="light" (click)="declineContactRequest()">{{ 'addon.messages.decline' | translate }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div *ngIf="footerType == 'requestSent' || (footerType == 'message' && requestContactSent)" padding-horizontal>
|
|
|
|
|
<p text-center><strong>{{ 'addon.messages.contactrequestsent' | translate }}</strong></p>
|
|
|
|
|
<p text-center>{{ 'addon.messages.yourcontactrequestpending' | translate: {$a: otherMember.fullname} }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<core-send-message-form *ngIf="footerType == 'message'" (onSubmit)="sendMessage($event)" [showKeyboard]="showKeyboard" [placeholder]="'addon.messages.newmessage' | translate" (onResize)="resizeContent()"></core-send-message-form>
|
2018-02-14 16:19:09 +00:00
|
|
|
|
</ion-toolbar>
|
|
|
|
|
</ion-footer>
|