diff options
author | Jean-Sébastien Pédron <js.pedron@meetic-corp.com> | 2009-01-21 16:34:26 +0300 |
---|---|---|
committer | Jean-Sébastien Pédron <js.pedron@meetic-corp.com> | 2009-01-21 16:34:26 +0300 |
commit | 842ebfcca0ba349cdd62dc9dc55a0a8ccdfefcdb (patch) | |
tree | d902c25f5d11838d4718325a746ed4992a98e9a3 /src/jd2ejd.erl | |
parent | 376ee2ed90283957dd7ea86cb5c4af5c7526f84c (diff) |
A lot of bug fixes regarding attribute values type:
o Fix some bugs by getting attributes as list() instead of binary().
o Instead creating #xmlattr directly, use the new ?XMLATTR macro; it'll
take care of the anything-to-binary() conversion.
o Fix a bug where recipient and sender were used as binary() instead of
list(), which is required by the rest of the S2S code.
o Fix a bug where binary_to_list/1 was called on a list().
Now concerning JIDs :
o Now that #jid{} isn't part of the API of Exmppp anymore, replace
remaining direct usages by calls to exmpp_jid.
o Replace exmpp_jid:make_bare_jid() by exmpp_jid:make_jid().
o Replace exmpp_jid:*_to_jid/1 by exmpp_jid:parse_jid/1.
PR: EJABP-1
SVN Revision: 1841
Diffstat (limited to 'src/jd2ejd.erl')
-rw-r--r-- | src/jd2ejd.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/jd2ejd.erl b/src/jd2ejd.erl index 86a6df3d6..4ee7577f4 100644 --- a/src/jd2ejd.erl +++ b/src/jd2ejd.erl @@ -115,7 +115,7 @@ process_xdb(_User, _Server, _El) -> xdb_data(_User, _Server, #xmlcdata{}) -> ok; xdb_data(User, Server, #xmlel{ns = NS} = El) -> - From = exmpp_jid:make_bare_jid(User, Server), + From = exmpp_jid:make_jid(User, Server), LServer = exmpp_stringprep:nameprep(Server), case NS of ?NS_LEGACY_AUTH -> @@ -132,7 +132,7 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) -> end, ok; ?NS_LAST_ACTIVITY -> - TimeStamp = exmpp_xml:get_attribute(El, 'last', ""), + TimeStamp = exmpp_xml:get_attribute_as_list(El, 'last', ""), Status = exmpp_xml:get_cdata(El), case lists:member(mod_last_odbc, gen_mod:loaded_modules(LServer)) of @@ -156,12 +156,12 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) -> true -> catch mod_vcard_odbc:process_sm_iq( From, - exmpp_jid:make_bare_jid(Server), + exmpp_jid:make_jid(Server), #iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT}); false -> catch mod_vcard:process_sm_iq( From, - exmpp_jid:make_bare_jid(Server), + exmpp_jid:make_jid(Server), #iq{kind = request, type = set, ns = ?NS_VCARD, payload = El, iq_ns = ?NS_JABBER_CLIENT}) end, ok; @@ -169,11 +169,11 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) -> process_offline(Server, From, El), ok; XMLNS -> - case exmpp_xml:get_attribute(El, "j_private_flag", "") of + case exmpp_xml:get_attribute_as_list(El, "j_private_flag", "") of "1" -> catch mod_private:process_sm_iq( From, - exmpp_jid:make_bare_jid(Server), + exmpp_jid:make_jid(Server), #iq{kind = request, type = set, ns = ?NS_PRIVATE, iq_ns = ?NS_JABBER_CLIENT, payload = #xmlel{name = 'query', children = @@ -192,10 +192,10 @@ process_offline(Server, To, #xmlel{children = Els}) -> FromS = exmpp_stanza:get_sender(El), From = case FromS of undefined -> - exmpp_jid:make_bare_jid(Server); + exmpp_jid:make_jid(Server); _ -> try - exmpp_jid:list_to_jid(FromS) + exmpp_jid:parse_jid(FromS) catch _ -> error |