ソースを参照

Show requesting contacts at the top of the roster view.

JC Brand 9 年 前
コミット
9cfec0ba8c
3 ファイル変更9 行追加8 行削除
  1. 3 2
      docs/CHANGES.md
  2. 1 1
      spec/controlbox.js
  3. 5 5
      src/converse-rosterview.js

+ 3 - 2
docs/CHANGES.md

@@ -3,6 +3,7 @@
 ## 1.0.4 (Unreleased)
 
 - Restrict occupants sidebar to 30% chatroom width. [jcbrand]
+- Made requesting contacts more visible, by placing them at the top of the roster. [jcbrand]
 
 ## 1.0.3 (2016-06-20)
 
@@ -15,9 +16,9 @@
 - Add processing hints to chat state notifications [jcbrand]
 - Don't use sound and desktop notifications for OTR messages (when setting up the session) [jcbrand]
 - New config option [default_state](https://conversejs.org/docs/html/configuration.html#default_state) [jcbrand]
-- New API method `converse.rooms.close()`
+- New API method `converse.rooms.close()` [jcbrand]
 - New configuration setting [allow_muc_invites](https://conversejs.org/docs/html/configuration.html#allow-muc-invites) [jcbrand]
-- Add new event [pluginsInitialized](https://conversejs.org/docs/html/development.html#pluginsInitialized)
+- Add new event [pluginsInitialized](https://conversejs.org/docs/html/development.html#pluginsInitialized) [jcbrand]
 - #553 Add processing hints to OTR messages [jcbrand]
 - #650 Don't ignore incoming messages with same JID as current user (might be MAM archived) [jcbrand]
 - #656 online users count in minimized chat window on initialization corrected [amanzur]

+ 1 - 1
spec/controlbox.js

@@ -320,12 +320,12 @@
                     // requesting and pending contacts are last.
                     var group_titles = $.map(this.rosterview.$el.find('dt'), function (o) { return $(o).text().trim(); });
                     expect(group_titles).toEqual([
+                        "Contact requests",
                         "colleagues",
                         "Family",
                         "friends & acquaintences",
                         "ænemies",
                         "Ungrouped",
-                        "Contact requests",
                         "Pending contacts"
                     ]);
                     // Check that usernames appear alphabetically per group

+ 5 - 5
src/converse-rosterview.js

@@ -33,9 +33,9 @@
     var HEADER_REQUESTING_CONTACTS = __('Contact requests');
     var HEADER_UNGROUPED = __('Ungrouped');
     var HEADER_WEIGHTS = {};
-    HEADER_WEIGHTS[HEADER_CURRENT_CONTACTS]    = 0;
-    HEADER_WEIGHTS[HEADER_UNGROUPED]           = 1;
-    HEADER_WEIGHTS[HEADER_REQUESTING_CONTACTS] = 2;
+    HEADER_WEIGHTS[HEADER_REQUESTING_CONTACTS] = 0;
+    HEADER_WEIGHTS[HEADER_CURRENT_CONTACTS]    = 1;
+    HEADER_WEIGHTS[HEADER_UNGROUPED]           = 2;
     HEADER_WEIGHTS[HEADER_PENDING_CONTACTS]    = 3;
 
     converse_api.plugins.add('rosterview', {
@@ -69,9 +69,9 @@
                     } else if (a_is_special && b_is_special) {
                         return HEADER_WEIGHTS[a] < HEADER_WEIGHTS[b] ? -1 : (HEADER_WEIGHTS[a] > HEADER_WEIGHTS[b] ? 1 : 0);
                     } else if (!a_is_special && b_is_special) {
-                        return (b === HEADER_CURRENT_CONTACTS) ? 1 : -1;
+                        return (b === HEADER_REQUESTING_CONTACTS) ? 1 : -1;
                     } else if (a_is_special && !b_is_special) {
-                        return (a === HEADER_CURRENT_CONTACTS) ? -1 : 1;
+                        return (a === HEADER_REQUESTING_CONTACTS) ? -1 : 1;
                     }
                 }
             }