Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch: Show join_muc button on logout/relogin #391

Closed
ChristianTacke opened this issue Oct 26, 2016 · 3 comments
Closed

Patch: Show join_muc button on logout/relogin #391

ChristianTacke opened this issue Oct 26, 2016 · 3 comments
Labels
Milestone

Comments

@ChristianTacke
Copy link
Contributor

ChristianTacke commented Oct 26, 2016

Version: 3.0.1-beta2/standalone

When logging out using jsxc.xmpp.logout and logging in again using jsxc.gui.showLoginBox the MUC features are basicly broken. Most notably the Join MUC menu item is missing.

The appended patch (applied to the built jsxc.js) seems to fix this mostly for me. Please review carefully!

@ChristianTacke
Copy link
Contributor Author

Okay, here is the patch. Appending it as a file did not work, for whatever reason.

--- jsxc.js.orig    2016-10-14 15:51:42.000000000 +0200
+++ jsxc.js 2016-10-26 19:49:03.447645252 +0200
@@ -1374,8 +1374,7 @@
       $('#jsxc_windowList').remove();

       if (jsxc.triggeredFromElement) {
-         $(document).trigger('toggle.roster.jsxc', ['hidden', 0]);
-         $('#jsxc_roster').remove();
+         jsxc.gui.roster.shutdown();

          // REVIEW: logoutElement without href attribute?
          if (jsxc.triggeredFromLogout) {
@@ -4019,6 +4018,15 @@
    },

    /**
+    * Shutdown roster
+    */
+   shutdown: function() {
+      $(document).trigger('toggle.roster.jsxc', ['hidden', 0]);
+      $('#jsxc_roster').remove();
+      jsxc.gui.roster.ready = false;
+   },
+
+   /**
     * Create roster item and add it to the roster
     *
     * @param {String} bid bar jid
@@ -7142,7 +7150,7 @@
 $(document).on('init.window.jsxc', jsxc.muc.initWindow);
 $(document).on('add.roster.jsxc', jsxc.muc.onAddRoster);

-$(document).one('attached.jsxc', function() {
+$(document).on('attached.jsxc', function() {
    jsxc.muc.init();
 });

@sualko
Copy link
Member

sualko commented Oct 28, 2016

Thank you for your report and patch. I could reproduce your issue, but sadly it will not go into the pending bug fix release, because I am afraid of side effects. So it will find his way into the next release after 3.0.1..

@sualko sualko added the bug label Oct 28, 2016
@sualko sualko added this to the 3.1 milestone Oct 28, 2016
@sualko sualko closed this as completed in 401ac98 Dec 15, 2016
@ChristianTacke
Copy link
Contributor Author

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants