Skip to content

Commit

Permalink
Fixing CR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Janusz Jakubiec authored and Janusz Jakubiec committed Dec 8, 2022
1 parent fddaa0b commit f3af8b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion priv/graphql/schemas/admin/private.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Allow admin to set the user's private data
"""
type PrivateAdminMutation @protected @use(modules: ["mod_private"]){
"Set the user's private data"
setPrivate(user: JID!, elementString: XmlElement): String
setPrivate(user: JID!, elementString: XmlElement): XmlElement
@protected(type: DOMAIN, args: ["user"]) @use(arg: "user")
}

Expand Down
2 changes: 1 addition & 1 deletion priv/graphql/schemas/user/private.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Allow user to set own private
"""
type PrivateUserMutation @protected @use(modules: ["mod_private"]){
"Set user's own private"
setPrivate(elementString: XmlElement!): String @use
setPrivate(elementString: XmlElement!): XmlElement @use
}

"""
Expand Down
6 changes: 3 additions & 3 deletions src/mod_private_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private_set(#jid{lserver = Domain} = JID, Xml) ->
true ->
{ok, HostType} = mongoose_domain_api:get_domain_host_type(Domain),
send_iq(set, Xml, JID, HostType),
{ok, ""};
{ok, Xml};
false ->
{not_found, io_lib:format("User ~s does not exist", [jid:to_binary(JID)])}
end.
Expand All @@ -35,8 +35,8 @@ do_private_get(JID, Element, Ns) ->
Xml = #xmlel{ name = Element, attrs = [{<<"xmlns">>, Ns}]},
{_, ResIq} = send_iq(get, Xml, JID, HostType),
[#xmlel{ name = <<"query">>,
attrs = [{<<"xmlns">>, ?NS_PRIVATE}],
children = [SubEl] }] = ResIq#iq.sub_el,
attrs = [{<<"xmlns">>, ?NS_PRIVATE}],
children = [SubEl] }] = ResIq#iq.sub_el,
{ok, SubEl}.

send_iq(Method, Xml, From = To = _JID, HostType) ->
Expand Down

0 comments on commit f3af8b6

Please sign in to comment.