Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
Premwoik committed Mar 1, 2022
1 parent e14f8f6 commit 28f484f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
13 changes: 6 additions & 7 deletions big_tests/tests/rest_client_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ all() ->

groups() ->
[{messages_with_props, [parallel], message_with_props_test_cases()},
{messages_with_thread, [parallel], message_with_thread_test_cases()},
{messages, [parallel], message_test_cases()},
{muc, [pararell], muc_test_cases()},
{muc_config, [], muc_config_cases()},
{roster, [parallel], roster_test_cases()},
{security, [], security_test_cases()}].
%ct_helper:repeat_all_until_all_ok(G).
{messages_with_thread, [parallel], message_with_thread_test_cases()},
{messages, [parallel], message_test_cases()},
{muc, [pararell], muc_test_cases()},
{muc_config, [], muc_config_cases()},
{roster, [parallel], roster_test_cases()},
{security, [], security_test_cases()}].

message_test_cases() ->
[msg_is_sent_and_delivered_over_xmpp,
Expand Down
12 changes: 6 additions & 6 deletions priv/graphql/schemas/admin/muc_light.gql
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ type MUCLightAdminQuery @protected{
}

type Room{
jid: JID
name: String
subject: String
participants: [RoomUser!]
jid: JID!
name: String!
subject: String!
participants: [RoomUser!]!
}

type RoomUser{
jid: JID
affiliation: Affiliation
jid: JID!
affiliation: Affiliation!
}
22 changes: 11 additions & 11 deletions src/muc_light/mod_muc_light_api.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
-include("mongoose_rsm.hrl").

-type room() :: #{jid := jid:jid(),
name := binary(),
subject := binary(),
aff_users := aff_users()}.
name := binary(),
subject := binary(),
aff_users := aff_users()}.

-export_type([room/0]).

Expand Down Expand Up @@ -109,13 +109,13 @@ change_room_config(#jid{luser = RoomID, lserver = MUCServer} = RoomJID,

-spec change_affiliation(jid:jid(), jid:jid(), jid:jid(), binary()) -> ok.
change_affiliation(RoomJID, SenderJID, RecipientJID, Affiliation) ->
RecipientBare = jid:to_bare(RecipientJID),
S = jid:to_bare(SenderJID),
Changes = query(?NS_MUC_LIGHT_AFFILIATIONS,
[affiliate(jid:to_binary(RecipientBare), Affiliation)]),
ejabberd_router:route(S, RoomJID, iq(jid:to_binary(S), jid:to_binary(RoomJID),
<<"set">>, [Changes])),
ok.
RecipientBare = jid:to_bare(RecipientJID),
S = jid:to_bare(SenderJID),
Changes = query(?NS_MUC_LIGHT_AFFILIATIONS,
[affiliate(jid:to_binary(RecipientBare), Affiliation)]),
ejabberd_router:route(S, RoomJID, iq(jid:to_binary(S), jid:to_binary(RoomJID),
<<"set">>, [Changes])),
ok.

-spec remove_user_from_room(jid:jid(), jid:jid(), jid:jid()) ->
{ok, iolist()}.
Expand Down Expand Up @@ -182,7 +182,7 @@ delete_room(RoomJID) ->

-spec get_room_messages(jid:jid(), integer() | undefined,
mod_mam:unix_timestamp() | undefined) ->
{ok, list()} | {muc_server_not_found | internal, iolist()}.
{ok, [mod_mam:message_row()]} | {muc_server_not_found | internal, iolist()}.
get_room_messages(RoomJID, PageSize, Before) ->
case mongoose_domain_api:get_subdomain_host_type(RoomJID#jid.lserver) of
{ok, HostType} ->
Expand Down

0 comments on commit 28f484f

Please sign in to comment.