Mercurial > prosody-modules
comparison mod_group_bookmarks/mod_group_bookmarks.lua @ 679:dcddd9195098
mod_group_bookmarks: Log error when group_bookmarks_file not specified
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 26 May 2012 22:53:39 +0100 |
parents | ee416b285802 |
children | 7dbde05b48a9 |
comparison
equal
deleted
inserted
replaced
678:429be98872dc | 679:dcddd9195098 |
---|---|
73 end | 73 end |
74 end | 74 end |
75 end, 1); | 75 end, 1); |
76 | 76 |
77 function module.load() | 77 function module.load() |
78 bookmarks_file = config.get(module:get_host(), "core", "group_bookmarks_file"); | 78 bookmarks_file = module:get_option_string("group_bookmarks_file"); |
79 if not bookmarks_file then return; end | 79 |
80 | |
81 rooms = { default = {} }; | 80 rooms = { default = {} }; |
82 members = { }; | 81 members = { }; |
82 | |
83 if not bookmarks_file then | |
84 module:log("error", "Please specify group_bookmarks_file in your configuration"); | |
85 return; | |
86 end | |
87 | |
83 local curr_room; | 88 local curr_room; |
84 for line in io.lines(bookmarks_file) do | 89 for line in io.lines(bookmarks_file) do |
85 if line:match("^%s*%[.-%]%s*$") then | 90 if line:match("^%s*%[.-%]%s*$") then |
86 curr_room = line:match("^%s*%[(.-)%]%s*$"); | 91 curr_room = line:match("^%s*%[(.-)%]%s*$"); |
87 if curr_room:match("^%+") then | 92 if curr_room:match("^%+") then |