Jelajahi Sumber

Hide inactive IDs in contact list

Only do this if the app also hides inactive contacts.
Danilo Bargen 7 tahun lalu
induk
melakukan
61d1ada18f

+ 1 - 1
src/partials/messenger.navigation.html

@@ -118,7 +118,7 @@
 <!-- Contacts -->
 <div id="navigation-contacts" class="tab-content" ng-if="ctrl.activeTab == 'contacts'" in-view-container>
     <p class="empty" ng-if="ctrl.contacts().length === 0" translate>messenger.NO_CONTACTS_FOUND</p>
-    <ul>
+    <ul ng-class="{'hide-inactive': ctrl.hideInactiveContacts()}">
         <li ng-repeat="contact in ctrl.contacts() | isNotMe | filter:ctrl.searchContact"
             ui-sref="messenger.home.conversation({ type: 'contact', id: contact.id, initParams: null })"
             class="contact"

+ 8 - 0
src/partials/messenger.ts

@@ -868,6 +868,7 @@ class NavigationController {
     public isVisible(conversation: threema.Conversation) {
         return conversation.receiver.visible;
     }
+
     public conversations(): threema.Conversation[] {
         return this.webClientService.conversations.get();
     }
@@ -876,6 +877,13 @@ class NavigationController {
         return this.receiverService.isConversationActive(value);
     }
 
+    /**
+     * Return true if the app wants to hide inactive contacts.
+     */
+    public hideInactiveContacts(): boolean {
+        return !this.webClientService.appConfig.showInactiveIDs;
+    }
+
     /**
      * Show dialog.
      */

+ 4 - 0
src/sass/sections/_navigation.scss

@@ -340,6 +340,10 @@
     .contact.inactive {
         opacity: 0.5;
     }
+
+    .hide-inactive .contact.inactive {
+        display: none;
+    }
 }
 
 #navigation-fab {

+ 1 - 1
src/services/webclient.ts

@@ -2390,7 +2390,7 @@ export class WebClientService {
                 voipEnabled: getOrDefault<boolean>(data.configuration.voipEnabled, true),
                 voipForceTurn: getOrDefault<boolean>(data.configuration.voipForceTurn, false),
                 largeSingleEmoji: getOrDefault<boolean>(data.configuration.largeSingleEmoji, true),
-                showInactiveIds: getOrDefault<boolean>(data.configuration.showInactiveIds, true),
+                showInactiveIDs: getOrDefault<boolean>(data.configuration.showInactiveIDs, true),
             },
             capabilities: {
                 maxGroupSize: getOrDefault<number>(data.capabilities.maxGroupSize, 50),

+ 1 - 1
src/threema.d.ts

@@ -678,7 +678,7 @@ declare namespace threema {
         voipEnabled: boolean;
         voipForceTurn: boolean;
         largeSingleEmoji: boolean;
-        showInactiveIds: boolean;
+        showInactiveIDs: boolean;
     }
 
     interface AppCapabilities {