25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Replace VVALUEL macro with function in order to shut up the dialyzer

This commit is contained in:
Evgeniy Khramtsov 2011-09-05 17:09:36 +10:00
parent ab2a298ebf
commit 3b95108a3a

View File

@ -473,17 +473,18 @@ announce_commands(From, To,
-define(VVALUE(Val),
{xmlelement, "value", [], [{xmlcdata, Val}]}).
-define(VVALUEL(Val),
case Val of
"" -> [];
_ -> [?VVALUE(Val)]
end).
-define(TVFIELD(Type, Var, Val),
{xmlelement, "field", [{"type", Type},
{"var", Var}],
?VVALUEL(Val)}).
vvaluel(Val)}).
-define(HFIELD(), ?TVFIELD("hidden", "FORM_TYPE", ?NS_ADMIN)).
vvaluel(Val) ->
case Val of
"" -> [];
_ -> [?VVALUE(Val)]
end.
generate_adhoc_form(Lang, Node, ServerHost) ->
LNode = tokenize(Node),
{OldSubject, OldBody} = if (LNode == ?NS_ADMINL("edit-motd"))
@ -512,12 +513,12 @@ generate_adhoc_form(Lang, Node, ServerHost) ->
[{"var", "subject"},
{"type", "text-single"},
{"label", translate:translate(Lang, "Subject")}],
?VVALUEL(OldSubject)},
vvaluel(OldSubject)},
{xmlelement, "field",
[{"var", "body"},
{"type", "text-multi"},
{"label", translate:translate(Lang, "Message body")}],
?VVALUEL(OldBody)}]
vvaluel(OldBody)}]
end}.
join_lines([]) ->