Fix some exmpp attribute type
This commit is contained in:
parent
1bbb41682a
commit
aee3e30232
|
@ -154,7 +154,7 @@ xdb_data(User, Server, #xmlel{ns = NS} = El) ->
|
|||
iq_ns = ?NS_JABBER_CLIENT,
|
||||
payload = #xmlel{name = 'query', children =
|
||||
[exmpp_xml:remove_attribute(
|
||||
exmpp_xml:remove_attribute(El, "xdbns"), "j_private_flag")]}});
|
||||
exmpp_xml:remove_attribute(El, <<"xdbns">>), <<"j_private_flag">>)]}});
|
||||
_ ->
|
||||
?DEBUG("jd2ejd: Unknown namespace \"~s\"~n", [XMLNS])
|
||||
end,
|
||||
|
|
|
@ -3665,7 +3665,7 @@ send_decline_invitation({Packet, XEl, DEl = #xmlel{name='decline'}, ToJID},
|
|||
RoomJID, FromJID) ->
|
||||
FromString = exmpp_jid:to_binary(FromJID),
|
||||
|
||||
DEl1 = exmpp_xml:remove_attribute(DEl, 'to'),
|
||||
DEl1 = exmpp_xml:remove_attribute(DEl, <<"to">>),
|
||||
DEl2 = exmpp_xml:set_attribute(DEl1, <<"from">>,FromString),
|
||||
XEl2 = replace_subelement(XEl,DEl2),
|
||||
Packet2 = replace_subelement(Packet,XEl2),
|
||||
|
|
|
@ -34,42 +34,42 @@
|
|||
-define(XACT(Name, Attrs, Text), ?XAC(Name, Attrs, ?T(Text))).
|
||||
|
||||
-define(LI(Els), ?XE('li', Els)).
|
||||
-define(A(URL, Els), ?XAE('a', [exmpp_xml:attribute('href', URL)], Els)).
|
||||
-define(A(URL, Els), ?XAE('a', [exmpp_xml:attribute(<<"href">>, URL)], Els)).
|
||||
-define(AC(URL, Text), ?A(URL, [?C(Text)])).
|
||||
-define(ACT(URL, Text), ?AC(URL, ?T(Text))).
|
||||
-define(P, ?X('p')).
|
||||
-define(BR, ?X('br')).
|
||||
-define(INPUT(Type, Name, Value),
|
||||
?XA('input', [exmpp_xml:attribute('type', Type),
|
||||
exmpp_xml:attribute('name', Name),
|
||||
exmpp_xml:attribute('value', Value)])).
|
||||
?XA('input', [exmpp_xml:attribute(<<"type">>, Type),
|
||||
exmpp_xml:attribute(<<"name">>, Name),
|
||||
exmpp_xml:attribute(<<"value">>, Value)])).
|
||||
|
||||
-define(INPUTT(Type, Name, Value), ?INPUT(Type, Name, ?T(Value))).
|
||||
-define(INPUTS(Type, Name, Value, Size),
|
||||
?XA('input', [exmpp_xml:attribute('type', Type),
|
||||
exmpp_xml:attribute('name', Name),
|
||||
exmpp_xml:attribute('value', Value),
|
||||
exmpp_xml:attribute('size', Size)])).
|
||||
?XA('input', [exmpp_xml:attribute(<<"type">>, Type),
|
||||
exmpp_xml:attribute(<<"name">>, Name),
|
||||
exmpp_xml:attribute(<<"value">>, Value),
|
||||
exmpp_xml:attribute(<<"size">>, Size)])).
|
||||
-define(INPUTST(Type, Name, Value, Size), ?INPUT(Type, Name, ?T(Value), Size)).
|
||||
-define(ACLINPUT(Text), ?XE('td', [?INPUT("text", "value" ++ ID, Text)])).
|
||||
|
||||
-define(TEXTAREA(Name, Rows, Cols, Value),
|
||||
?XAC('textarea', [exmpp_xml:attribute('name', list_to_binary(Name)),
|
||||
exmpp_xml:attribute('rows', list_to_binary(Rows)),
|
||||
exmpp_xml:attribute('cols', list_to_binary(Cols))],
|
||||
?XAC('textarea', [exmpp_xml:attribute(<<"name">>, list_to_binary(Name)),
|
||||
exmpp_xml:attribute(<<"rows">>, list_to_binary(Rows)),
|
||||
exmpp_xml:attribute(<<"cols">>, list_to_binary(Cols))],
|
||||
Value)).
|
||||
|
||||
%% Build an xmlelement for result
|
||||
-define(XRES(Text), ?XAC('p', [exmpp_xml:attribute('class', <<"result">>)], Text)).
|
||||
-define(XRES(Text), ?XAC('p', [exmpp_xml:attribute(<<"class">>, <<"result">>)], Text)).
|
||||
-define(XREST(Text), ?XRES(?T(Text))).
|
||||
|
||||
%% Guide Link
|
||||
-define(GL(Ref, Title),
|
||||
?XAE('div',
|
||||
[exmpp_xml:attribute('class', <<"guidelink">>)],
|
||||
[exmpp_xml:attribute(<<"class">>, <<"guidelink">>)],
|
||||
[?XAE('a',
|
||||
[exmpp_xml:attribute('href', list_to_binary("/admin/doc/guide.html#"++ Ref)),
|
||||
exmpp_xml:attribute('target', <<"_blank">>)],
|
||||
[exmpp_xml:attribute(<<"href">>, list_to_binary("/admin/doc/guide.html#"++ Ref)),
|
||||
exmpp_xml:attribute(<<"target">>, <<"_blank">>)],
|
||||
[?C("[Guide: " ++ Title ++ "]")])
|
||||
])).
|
||||
|
||||
|
|
Loading…
Reference in New Issue