Skip to content

Commit

Permalink
MUC-light: Match everything in create_room_transaction LCs #3011 - fi…
Browse files Browse the repository at this point in the history
…nal commit
  • Loading branch information
arcusfelis committed Mar 1, 2021
1 parent 5935d79 commit 2bf2ec3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/muc_light/mod_muc_light_db_rdbms.erl
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,16 @@ create_room_transaction(MainHost, {RoomU, RoomS}, Config, AffUsers, Version) ->
RoomID = mongoose_rdbms:selected_to_integer(select_room_id(MainHost, RoomU, RoomS)),
Schema = mod_muc_light:config_schema(RoomS),
ConfigFields = mod_muc_light_room_config:to_binary_kv(Config, Schema),
[insert_aff(MainHost, RoomID, UserU, UserS, Aff)
|| {{UserU, UserS}, Aff} <- AffUsers],
[insert_config(MainHost, RoomID, Key, Val)
|| {Key, Val} <- ConfigFields],
[insert_aff_tuple(MainHost, RoomID, AffUser) || AffUser <- AffUsers],
[insert_config_kv(MainHost, RoomID, KV) || KV <- ConfigFields],
ok.

insert_aff_tuple(MainHost, RoomID, {{UserU, UserS}, Aff}) ->
insert_aff(MainHost, RoomID, UserU, UserS, Aff).

insert_config_kv(MainHost, RoomID, {Key, Val}) ->
insert_config(MainHost, RoomID, Key, Val).

-spec destroy_room_transaction(MainHost :: jid:lserver(),
RoomUS :: jid:simple_bare_jid()) ->
ok | {error, not_exists}.
Expand Down

0 comments on commit 2bf2ec3

Please sign in to comment.