cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
725
Views
0
Helpful
3
Replies

MUC resume on browser refresh

mark.kilby
Level 1
Level 1

Hi

Just getting going using Jabber in a web browser with MUCs, am working through the demo app (very good).

Problem I have at present is how to smoothly 'resume' if the user hits F5 on their browser.

The user will be in a room when they may hit F5, all I want to do is 'reconnect' to that room.

However - using the demo app it complains when you try to enter the room, complaining of a conflict.

I'm guessing the conflict is that an active nickname already exists in the room to which the user is trying to reconnect.

Any ideas?

Regards,

Mark.

3 Replies 3

Bticest_jt
Level 1
Level 1

     I'm facing this issue before eithor.

     The situation is not exactly same.

     When my app refresh the browser, 'client', 'entity', 'entitySet', etc objects are reset.

     Run your service in the background would be OK.

     Try Node.js?

     I wanna Jabber Web SDK works under Node.js. I know cwic.js is highly rely on the browser addons.

     So it would be a client, not a server. A client built by Node.js.

     But the JS libs (cwic.js and jabberwerx.js) are not up to the 'CommonJS' standard.

     So Node.js? Get real.

     For example, although 'jQuery' is rarely used under Node.js.

     But Can you consider 'jQuery' MUST run on the client as it's just a DOM selector?

     I wish cisco team value this.

Thanks Jeff

Thanks - that's a good idea - put it server side.

It was certainly the nickname that was the issue, and I'm not sure what the correct approach would be (if there is indeed one).

I worked around the issue though, I found I could tag on a unique number to the nickname each time, and prettify them later at render time (I use the current time in MS).

Each time you refresh you get a new presence in the room though, however not a big deal because the system seems to kill off the old ones pretty quick when not connected (that's good!).

So for example I might sign in with nick_58934789572

This guarantees me the means to circumvent the nickname conflict.

I can revert the nickname back to what it is supposed to be in code.

I can even eliminate duplicates of nicknames when displaying occupants.

Not brilliant but it works and I have no better solution at this present time.

Still open to ideas!

Mark.

Hi Mark,

     For the MUC, hope the link below helped.

     XEP-0045: Multi-User Chat

    

     Run the code in the server side/background wouldn't work.

     I'v been working on it for more than 1 weeks and nothing came of the ideas...

Thanks

Jeff

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: