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
Is there a start guide? #1
Comments
Sorry, I thougth no one will notice this project. First I just wanted someplace to write my thought. If you want I will write a guide for this. |
恩,谢谢,我正在研究im,顺便问一下, 你熟悉ejabberd吗?我有两个问题 ejabberd如何实现群聊?xep-0045中的实现是用户下线会自动退出群聊,上线后需要重新加入该群,但下线期间收不到任何离线消息.如何实现类似微信群聊,whatsapp-like的group chat? ejabberd如何实现只有朋友关系才能私聊?xmpp中只要知道对方的jid,且对方没有屏蔽你,那么就可以给对方发送消息.如何实现只有朋友关系才能聊天呢?难道要屏蔽所有人,我觉得这不是一种好的方式. 不宁赐教. |
Group chat : like chat message, but you need to push it to everybody in the group. Only friend can talk: Have fun, :) |
Thanks a lot. In this way, I need to hack core for Group chat : like chat message, but you need to push it to everybody in the group.
About offline group message, just like the way you do with chat message, store it in your server db. But |
@wudixiaotie I use a pubsub + muc_room for implement a whatsapp-like group chat. Use the room only for store room information and pubsub to handle the message both online and offline(May there is no difference in online and offline). In this way, I need to store group users in another db, because I can not get the members of pubsub. I need not hack core. |
Yes, you are right. I told my boss of this about how dangers it is, he seems not quiet agree with me. So what ever. I did my best. |
I don't think pubsub is a good idea. I think it is too complex. Group chat message or chat message, they are all messages, so all you need to do is to push the message to the client, if the client is offline, store the message to what ever you want. That is the server's logic. |
In this way, there is an answer in stackoverflow, ejabberd manual XMPP rules for leaving rooms. It implemented with shared roster. Possible approach involving a modified mod_muc_room:
|
Why need a shared roster? Just a Group Member List store in db, and a cache when im running. When you have group message, find this group member by searching cache,and send them message. That's all you need. |
So, I need to write a module which is a customed mod_muc_room for this solution. |
Hello. I am writting a chat server. Error log: =SUPERVISOR REPORT==== 7-Sep-2015::16:41:03 ===
Supervisor: {local,erlim_sup}
Context: start_error
Reason: {noproc,{gen_server,call,
[erlim_session,
{start_child,[#Port<0.3940>]},
infinity]}}
Offender: [{pid,undefined},
{name,erlim_server},
{mfargs,{erlim_server,start_link,[3000]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,worker}]
{error,{{shutdown,{failed_to_start_child,erlim_server,
{noproc,{gen_server,call,
[erlim_session,{start_child,[#Port<0.3940>]},infinity]}}}},
{erlim_app,start,[normal,[]]}}} Can you help me? |
You don't need to work? Why you always update your code on working hours? |
My job now is writting an im server. |
cy & ck is your client? Why you always start a tcp connection when you sending message? One client only need one tcp conn for message sending. I think you would better read some book about network. :) |
Ok, thanks. I have fixed it. |
If you want to spawn lots of worker process of a gen_server module. You must not named it. gen_server:start_link(?MODULE, [Socket], []). That is why you use supervisor:start_child alway failed at the second time, beause the first time one child process already registered as name "erlim_session". |
@wudixiaotie How can I receive split data block of big data more then 4k when I set the server buffer to 2k? Also, I can set the buffer size to 8k. But if the data is 64M or more, client must split it into block, then send to server. |
First you need a http server to do upload & download thing. Put everything in a im server is not a good idea. |
I am new to erlang. And I want to study it.
The text was updated successfully, but these errors were encountered: