Skip to content

Commit

Permalink
Ensure we match everything in create_room_transaction LCs
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Feb 5, 2021
1 parent 3b6a716 commit 7fd536c
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 7fd536c

Please sign in to comment.