What the "Channel" mean in facebook chat application? - facebook

Facebook uses publish/subscribe pattern for their chat app. I used Firebug to catch request in facebook site and I saw that every request to receive message from facebook server almost link to an address with pattern : http://[number].[number].chanel.facebook.com. There is about 0->20 channels which mean number in address pattern will range in [0-20].
I don't know why they need to use channel as subdomain ? Does it relate to divide processing chat message to multiple service (server) to increase server performance ? or just a subdomain name ?
What is your opinion ? I'd like to hear your interesting idea on this.

I believe they use sub-somains because there's a limit on how many connections per domain a browser can keep open.
See How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?
So, those sub-domains are not "channels".

These are special servers which handle only chat messages and notifications. Source: Rodrigo Schmidt's lecture (https://www.facebook.com/rodrigo)

Related

is it possible to get online incoming messages from users in telegram (not bot)?

I need to get all incoming messages from all possible social media and redirect them in one app, using this protocol https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol/, I've read about getting messages in telegram API, but it's possible only with bots.
Have you tried telegram-cli yet?
https://github.com/LonamiWebs/Telethon is a Python 3 library which works both with regular users and bots

XMPP support for avatars in multi-user chat

I'm creating (yet another) mobile chat app, using Smack and ejabberd. I'm trying to ascertain the best way to implement user avatars for use in multi-user chat rooms, and also of course for roster members. Looking at possible solutions, I can see:
XEP-0008 IQ based avatars - avatars are limited to 64 by 64 pixels, too small.
XEP-0153 vCard based avatars - Easy to implement for both users in the roster and MUC rooms, however (a) sources such as this seem to indicate that one's own vcard needs to be downloaded on every login (is this strictly true? I can't see this in the specs), and (b) should be less than 96 by 96 pixels (still pretty small)
XEP-0084 User Avatar based on Personal Eventing Protocol - I'm not clear how I can retrieve avatars for all users in a multi-user chat room based on this protocol. After joining the chat room, I would need to subscribe to the metadata node of all users, and any subsequently joining users? And also unsubscribe when they leave the room? I figure this would be pretty ugly and clumsy to implement.
Can someone kindly point me in the right direction, or indicate where I may have misunderstood? Thanks.
I guess the best way to address this issue may be to store/load the images Out of band via a HTTP server. Images could be stored with a filename such as "username_imagehash.xxx". For users not in one's roster (eg strangers in a multi-user chat), we pull their avatar via a URI retrieved from their vCard PHOTO field. Each time a stranger is re/encountered, we reload their vCard, and can identify the need to redownload their photo via a change in the URI in the vCard.
Once the user is added to one's roster, we subscribe to their avatar updates via XEP-0084, publishing the same URI (see example 4. in XEP-0084).
I think this addresses all requirements, I will find out once I've implemented. I can understand that it is not done this way in standard XMPP clients as it depends on an HTTP server separate to the XMPP service (and need to handle HTTP server security - user authorization/authentication).
Feedback welcome!

Facebook Chat limitations

My company develop a product for customer support on Facebook and we want to give the representatives a way to contact the customer via Facebook Chat.
I have read the Chat API documentations and it is not clear whether users MUST be friends on Facebook in order to chat or is it just enough they both installed a Facebook app? more limitations?
any insight will be appreciated.
Thanks in advance for you answers,
Yaniv Hakim
Facebook provides an XMPP port to the outside world while internally it implements MQTT. As per XMPP specs, messaging works between two entities without they being in each other roster list (friend/contact list). However, Facebook seems to have this limitation as part of their own business requirement. I think even GoogleTalk disallows this if two federated entities try to send message to each other without being on the roster list.
In short, yes you can just send the message. You don't need a presence authorization from someone in order to send messages to them (in XMPP world). HOWEVER, some services has a policy of requiring this, despite the fact that this is not mandated by the XMPP specifications.

xmpp/jabber for chat for dating site?

we're in the process of adding text chat to our dating site and I'm considering using xmpp - specifically ejabberd on the server side, and we will be implementing an ajax client.
i'd like to hear from someone with good xmpp experience - is it architecturally suitable for chat on a dating site ? in chat on a dating site anybody can chat one-on-one with anybody - they don't have to be on your 'friends' list. Also we do not want a chat room - only one-on-one chat.
Or is xmpp more suitable for the model where someone has to add you to their friends list before you can with them ?
thanks in advance.
XMPP should work fine for you. Ejabberd, depending on the number of concurrent users you have, should be a fine starting point. Consider using a BOSH library like Strophe.js in your HTML client. If you use that library, you'll want a copy of Professional XMPP Programming with JavaScript and jQuery, which has examples of all of the code you'll need.
You do NOT need to have presence subscriptions in place to send chat messages between users, except in specific server implementations like GoogleTalk. Reducing the number of presence subscriptions will also drastically increase the number of users you can handle concurrently.

Whether the gtalk have any limitations on number of contacts or number of messages per minute/hour/day?

We plan to use gtalk for creating chat bot. My question is Whether the gtalk have any limitations on number of contacts or number of messages per minute/hour/day?
I used to run gtalkbots.com which was using google apps infra including jabber service. One of the utility bot called games#gtalkbots.com used to send/rcv about 100-150 chat messages per second at one point without any blockage from google app servers.
Also i think if ever you get such a warning, it will be appropriately told to you with error stanza from google talk servers. Error message should read something like "policy violation" etc... Hope this info helps.....