diff options
author | Badlop <badlop@process-one.net> | 2010-08-07 20:48:36 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2010-08-07 20:48:36 +0200 |
commit | 972440c2cac305d8d0bf51e0dc848eedeb9d9275 (patch) | |
tree | b7398445584132e6ca274783137c99f5f5b446fa /src | |
parent | Update the 'configure' script (diff) |
When user joins non-anonymous room, warn also in presence stanza (EJAB-310)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_muc/mod_muc_room.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index b0a07178b..0eeea91e8 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -1887,10 +1887,18 @@ send_new_presence(NJID, Reason, StateData) -> false -> [] end, + Status2 = case ((StateData#state.config)#config.anonymous==false) + andalso (NJID == Info#user.jid) of + true -> + [{xmlelement, "status", [{"code", "100"}], []} + | Status]; + false -> + Status + end, Packet = xml:append_subtags( Presence, [{xmlelement, "x", [{"xmlns", ?NS_MUC_USER}], - [{xmlelement, "item", ItemAttrs, ItemEls} | Status]}]), + [{xmlelement, "item", ItemAttrs, ItemEls} | Status2]}]), ejabberd_router:route( jlib:jid_replace_resource(StateData#state.jid, Nick), Info#user.jid, |