aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2016-11-04 16:54:31 +0100
committerBadlop <badlop@process-one.net>2016-11-04 16:54:31 +0100
commit5e723bc90e9701c7112d741558bfd8b45ea637b0 (patch)
treec1ac31b80b99a9e22817102e2df625d598e0b8fb /src
parentReplace ctlscriptpath and produce ejabberd.service file (#434) (diff)
Fix reading room jids from file for create and destroy_rooms_file commands
Diffstat (limited to 'src')
-rw-r--r--src/mod_muc_admin.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl
index e334dca2b..c9da1c66c 100644
--- a/src/mod_muc_admin.erl
+++ b/src/mod_muc_admin.erl
@@ -514,7 +514,7 @@ destroy_room({N, H, SH}) ->
%% The file encoding must be UTF-8
destroy_rooms_file(Filename) ->
- {ok, F} = file:open(Filename, [read, binary]),
+ {ok, F} = file:open(Filename, [read]),
RJID = read_room(F),
Rooms = read_rooms(F, RJID, []),
file:close(F),
@@ -533,7 +533,7 @@ read_room(F) ->
eof -> eof;
String ->
case io_lib:fread("~s", String) of
- {ok, [RoomJID], _} -> split_roomjid(RoomJID);
+ {ok, [RoomJID], _} -> split_roomjid(list_to_binary(RoomJID));
{error, What} ->
io:format("Parse error: what: ~p~non the line: ~p~n~n", [What, String])
end
@@ -551,7 +551,7 @@ split_roomjid(RoomJID) ->
%%----------------------------
create_rooms_file(Filename) ->
- {ok, F} = file:open(Filename, [read, binary]),
+ {ok, F} = file:open(Filename, [read]),
RJID = read_room(F),
Rooms = read_rooms(F, RJID, []),
file:close(F),