Commit 01e10a9b authored by JC Brand's avatar JC Brand

Bugfix. Don't call Jed's translate method

before converse.initialize has been called. Otherwise we won't get
translations.

Updates #669
parent 71381e2f
...@@ -18,6 +18,39 @@ ...@@ -18,6 +18,39 @@
_ = converse_api.env._, _ = converse_api.env._,
__ = utils.__.bind(converse); __ = utils.__.bind(converse);
converse_api.plugins.add('rosterview', {
overrides: {
// Overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the
// relevant objects or classes.
//
// New functions which don't exist yet can also be added.
afterReconnected: function () {
this.rosterview.registerRosterXHandler();
this._super.afterReconnected.apply(this, arguments);
},
RosterGroups: {
comparator: function () {
// RosterGroupsComparator only gets set later (once i18n is
// set up), so we need to wrap it in this nameless function.
return converse.RosterGroupsComparator.apply(this, arguments);
}
}
},
initialize: function () {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
this.updateSettings({
allow_chat_pending_contacts: false,
allow_contact_removal: true,
show_toolbar: true,
});
var STATUSES = { var STATUSES = {
'dnd': __('This contact is busy'), 'dnd': __('This contact is busy'),
'online': __('This contact is online'), 'online': __('This contact is online'),
...@@ -38,22 +71,7 @@ ...@@ -38,22 +71,7 @@
HEADER_WEIGHTS[HEADER_UNGROUPED] = 2; HEADER_WEIGHTS[HEADER_UNGROUPED] = 2;
HEADER_WEIGHTS[HEADER_PENDING_CONTACTS] = 3; HEADER_WEIGHTS[HEADER_PENDING_CONTACTS] = 3;
converse_api.plugins.add('rosterview', { converse.RosterGroupsComparator = function (a, b) {
overrides: {
// Overrides mentioned here will be picked up by converse.js's
// plugin architecture they will replace existing methods on the
// relevant objects or classes.
//
// New functions which don't exist yet can also be added.
afterReconnected: function () {
this.rosterview.registerRosterXHandler();
this._super.afterReconnected.apply(this, arguments);
},
RosterGroups: {
comparator: function (a, b) {
/* Groups are sorted alphabetically, ignoring case. /* Groups are sorted alphabetically, ignoring case.
* However, Ungrouped, Requesting Contacts and Pending Contacts * However, Ungrouped, Requesting Contacts and Pending Contacts
* appear last and in that order. * appear last and in that order.
...@@ -72,20 +90,8 @@ ...@@ -72,20 +90,8 @@
} else if (a_is_special && !b_is_special) { } else if (a_is_special && !b_is_special) {
return (a === HEADER_REQUESTING_CONTACTS) ? -1 : 1; return (a === HEADER_REQUESTING_CONTACTS) ? -1 : 1;
} }
} };
}
},
initialize: function () {
/* The initialize function gets called as soon as the plugin is
* loaded by converse.js's plugin machinery.
*/
this.updateSettings({
allow_chat_pending_contacts: false,
allow_contact_removal: true,
show_toolbar: true,
});
converse.RosterFilter = Backbone.Model.extend({ converse.RosterFilter = Backbone.Model.extend({
initialize: function () { initialize: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment