Browse Source

Use composition instead of chaining

JC Brand 8 years ago
parent
commit
728c7622e9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/converse-core.js

+ 1 - 1
src/converse-core.js

@@ -1253,7 +1253,7 @@
                     contact.save({'chat_status': contact.getHighestPriorityStatus()});
                 } else if (contact) { // presence_type is undefined
                     var resources = contact.addResource(resource, priority, chat_status);
-                    if (priority >= _(resources).values().map('priority').max()) {
+                    if (priority >= _.flow(_.values, _.partial(_.map, _, 'priority'), _.max)(resources)) {
                         // Only save if it's the resource with the highest
                         // priority
                         contact.save({'chat_status': chat_status});