mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
short_jid/1 and short_bare_jid/1 now produce a short JID from the
user-provided JID parts. To obtain a short JID from the STRINGPREP'd parts, use the new short_prepd_jid/1 and short_prepd_bare_jid/1 functions. SVN Revision: 1543
This commit is contained in:
parent
d8c3aae412
commit
ab75683bc9
@ -1,3 +1,10 @@
|
||||
2008-08-26 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* src/jlib.erl: short_jid/1 and short_bare_jid/1 now produce a short
|
||||
JID from the user-provided JID parts. To obtain a short JID from the
|
||||
STRINGPREP'd parts, use the new short_prepd_jid/1 and
|
||||
short_prepd_bare_jid/1 functions.
|
||||
|
||||
2008-08-14 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
* translate.erl (ascii_tolower): Accept 'undefined' as a language and
|
||||
|
22
src/jlib.erl
22
src/jlib.erl
@ -64,7 +64,9 @@
|
||||
from_old_jid/1,
|
||||
to_old_jid/1,
|
||||
short_jid/1,
|
||||
short_bare_jid/1]).
|
||||
short_bare_jid/1,
|
||||
short_prepd_jid/1,
|
||||
short_prepd_bare_jid/1]).
|
||||
|
||||
-include("jlib.hrl").
|
||||
|
||||
@ -761,10 +763,20 @@ to_old_jid(#jid{user = Node, resource = Resource,
|
||||
JID#jid{user = Node1, resource = Resource1,
|
||||
luser = LNode1, lresource = LResource1}.
|
||||
|
||||
short_jid(JID) ->
|
||||
JID1 = to_old_jid(JID),
|
||||
{JID1#jid.luser, JID1#jid.lserver, JID1#jid.lresource}.
|
||||
short_jid(JID1) ->
|
||||
%JID1 = to_old_jid(JID),
|
||||
{JID1#jid.user, JID1#jid.server, JID1#jid.resource}.
|
||||
|
||||
short_bare_jid(JID) ->
|
||||
JID1 = to_old_jid(exmpp_jid:jid_to_bare_jid(JID)),
|
||||
%JID1 = to_old_jid(exmpp_jid:jid_to_bare_jid(JID)),
|
||||
JID1 = exmpp_jid:jid_to_bare_jid(JID),
|
||||
{JID1#jid.user, JID1#jid.server, JID1#jid.resource}.
|
||||
|
||||
short_prepd_jid(JID1) ->
|
||||
%JID1 = to_old_jid(JID),
|
||||
{JID1#jid.luser, JID1#jid.lserver, JID1#jid.lresource}.
|
||||
|
||||
short_prepd_bare_jid(JID) ->
|
||||
%JID1 = to_old_jid(exmpp_jid:jid_to_bare_jid(JID)),
|
||||
JID1 = exmpp_jid:jid_to_bare_jid(JID),
|
||||
{JID1#jid.luser, JID1#jid.lserver, JID1#jid.lresource}.
|
||||
|
Loading…
Reference in New Issue
Block a user