loqui / im

Loqui IM allows you to use all your chat accounts in just one FirefoxOS or Ubuntu Touch app.
https://loqui.im
304 stars 112 forks source link

Synchronize chats between devices #18

Open Gioyik opened 11 years ago

Gioyik commented 11 years ago

Hi,

I installed loqui in my Samsung Galaxy S3 phone with Firefox for Android and in a Unagi phone with FirefoxOS. I sent a message to @Nukeador from my Unagi phone, and when I open loqui in my Galaxy S3 I watched that the conversations are not synchronized, it's this a Bug? Or it's probably feature for the future?

Regards

aesedepece commented 11 years ago

Sorry, such feature is not implemented yet, but you can be sure it will have high priority in the roadmap. (It's a must-have!) Although XMPP does not directly support synchronizing chats between devices, it could be achieved by backing the chats up in the server as described by XEP-0049.

Gioyik commented 11 years ago

Probably, providing a way to host that conversations in a Host to export to every phone could fix this. What you think?

aesedepece commented 11 years ago

I forgot that XMPP already DOES have a feature for implementing this feature.

It is called "Message Archiving" and is described by XEP-0136 → http://xmpp.org/extensions/xep-0136.html

The sad fact is that Google Talk doesn't implement it yet.

Gioyik commented 11 years ago

XMPP Rules! But it that's the problem with GTalk, could be great try to provide the idea of the Host but probably the people will not feel good knowing that loqui is saving their conversations in a private server. Or probably providing a way to export and import his conversations.

Regards

Gioyik commented 11 years ago

How loqui save the conversations? I thinking in make a Webapp to export/import conversations in loqui. Could you tell me how loqui save the conversations?

aesedepece commented 11 years ago

LOQUI saves the chat list (and the messages inside) as JSON in localStorage. You can see it in scripts/waalt/app.js.

localStorage.setItem("clist", JSON.stringify(this.messenger.list));

The chat list is an Array containing objects of class Chat as defined in scrips/waalt/messenjer.js:

this.Chat = function(jid, title){
    this.title = title;
    this.jid = jid;
    this.messages = new Array();
}

The message list inside every chat object is an Array containing objects of class Message as defined in scrips/waalt/messenjer.js:

this.Message = function(from, to, text, html, stamp){
    this.from = from;
    this.to = to;
    this.text = text;
    this.html = html;
    this.read = false;
    this.stamp = stamp;
}

I think the fields in the classes are auto-descriptive. If not, feel free to keep asking!

Zash commented 11 years ago

May I suggest you look at Carbons for real-time synchronization of chats and MAM for a more modern and simple archiving spec.

aesedepece commented 11 years ago

@Zash thanks for the suggestions, both XEPs meet perfectly the needs.