Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 2 KB

2016-07-10-ejabberd.md

File metadata and controls

87 lines (61 loc) · 2 KB

如何进行ejabberd开发

常用代码操作


群组聊天

使用客户端工具创建的持久化聊天室

[{title,<<"xx">>},
 {description,<<"yy">>},
 {allow_change_subj,true},
 {allow_query_users,true},
 {allow_private_messages,true},
 {allow_private_messages_from_visitors,anyone},
 {allow_visitor_status,true},
 {allow_visitor_nickchange,true},
 {public,true},
 {public_list,true},
 {persistent,true},
 {moderated,true},
 {members_by_default,true},
 {members_only,false},
 {allow_user_invites,false},
 {password_protected,false},
 {captcha_protected,false},
 {password,<<>>},
 {anonymous,true},
 {logging,false},
 {max_users,200},
 {allow_voice_requests,true},
 {mam,false},
 {voice_request_min_interval,1800},
 {vcard,<<>>},
 {captcha_whitelist,[]},
 {affiliations,[{{<<"ejabberd11">>,<<"localhost">>,<<>>},{owner,<<>>}}]},
 {subject,<<>>},
 {subject_author,<<>>},
 {subscribers,[]}]

是否可以让ejabberd不发送presence广播

MUC: Ability to disable presence broadcast to users with 'Visitor' Affiliation

代码.


# 获取当前群组配置的max_users_presence
gen_mod:get_module_opt(<<"localhost">>,mod_muc, max_users_presence,fun(MUP) when is_integer(MUP) -> MUP end, 0).

# 创建群组.
mod_muc_admin:create_room(<<"t3">>, <<"conference.localhost">>, <<"localhost">>).

# 当前在线的群组
mod_muc_admin:muc_online_rooms(<<"localhost">>).
# 当前群组表信息
ets:tab2list(muc_online_room).

# 热部署

API


curl -v -X POST -H "X-Admin: true"  http://localhost:5280/api/register -d '{"user": "ejabberd13", "host": "jhqc.platform.com", "password": "wwww" }'

mix release

https://blog.process-one.net/building-an-otp-release-for-ejabberd-with-elixir-mix/

docker build -t centos_erl ./ docker tag centos_erl 172.16.1.5:5000/centos_erl docker push 172.16.1.5:5000/centos_erl