maxpowel / jQuery-XMPP-plugin

Javascript library for the XMMP protocol
http://plugins.jquery.com/project/xmpp-lib
163 stars 50 forks source link

Hello - additional Options #25

Open golfixe opened 11 years ago

golfixe commented 11 years ago

123

The work you can see in the picture, is a social network quite simple. The site uses no metedo to reload the page. The entire site has real-time services. So far this has simple graphic environment to complete all future services below.

I have been modifying the entire script to run to the effect that you want to give. News added:

More changes to come.

After it's all done with due authorization from maxpowel I can create a simple script with all the features.

maxpowel commented 11 years ago

Hi, your work looks so fine! Please do a pull request if you want your features to be included

golfixe commented 11 years ago

In the end I can post the full code of my project if it is useful to people, but my script is very basic but functional. I wonder if it is possible to make the connection to the update page is not destroyed, using a session, is to make it so simple? If you know how to do it would be possible to tell me? liked on my webpage deploy the same code but my desire to do. well ... I was able to request the code for this purpose can make all the code that will please everyone and thus help you in this project. thanks for the reply

maxpowel commented 11 years ago

Maybe using a cookie to save some session would work. But I dont really know what exactly do you want. Can you give more details?

golfixe commented 11 years ago

Yes it was, to reload the page to continue ligção, as the example of facebook chat ... Has the code for that or a light to guide me?

maxpowel commented 11 years ago

That problem appeared in the past and there are several solutions. The synchronization and identification is maintained using RID and SID (looking the code you see how this variables are sent in every request). SID would be a connection id (the same during all session) and RID is a number associated to every message which the server uses to know the real order or detect duplications (since every call is independent in HTTP, the send order may not be the same that receive order).

You can save (in a cookie for example) these 2 numbers (the RID should be refreshed on every message or you could detect onExit javascript event to save the state).

The other option is modify the server to allow a custom token notification.

In both cases you need to implement your own login method. If you prefer the first way, you could take the actual login method and modify to receive SID and RID instead of username and password.

This feature is out of the plugin competences area (which is handle XMPP protocol) because of that it is not implemented.

The third option (the most common) is to use a javascript environment which does not require to reload the page to refresh the content (all is managed through ajax). Every modern javascript framework has a router utility for that

golfixe commented 11 years ago

It would be asking too much if I could ever spend it working with the code ... I'm sick of trying to figure out how to do and I can not ... I think I can add it to your project and we create a web client fantastic

maxpowel commented 11 years ago

I could do an easy auth method to support it if it helps you

golfixe commented 11 years ago

Yes if you can do this code thanked. I am waiting for your code, thanks