|
@@ -105,19 +105,14 @@ function handle_get_room_size(event)
|
105
|
105
|
"there are %s occupants in room", tostring(participant_count));
|
106
|
106
|
else
|
107
|
107
|
log("debug", "no such room exists");
|
|
108
|
+ return 404;
|
108
|
109
|
end
|
109
|
110
|
|
110
|
111
|
if participant_count > 1 then
|
111
|
112
|
participant_count = participant_count - 1;
|
112
|
113
|
end
|
113
|
114
|
|
114
|
|
- local GET_response = {
|
115
|
|
- headers = {
|
116
|
|
- content_type = "application/json";
|
117
|
|
- };
|
118
|
|
- body = [[{"participants":]]..participant_count..[[}]];
|
119
|
|
- };
|
120
|
|
- return GET_response;
|
|
115
|
+ return [[{"participants":]]..participant_count..[[}]];
|
121
|
116
|
end
|
122
|
117
|
|
123
|
118
|
--- Handles request for retrieving the room participants details
|
|
@@ -171,19 +166,14 @@ function handle_get_room (event)
|
171
|
166
|
"there are %s occupants in room", tostring(participant_count));
|
172
|
167
|
else
|
173
|
168
|
log("debug", "no such room exists");
|
|
169
|
+ return 404;
|
174
|
170
|
end
|
175
|
171
|
|
176
|
172
|
if participant_count > 1 then
|
177
|
173
|
participant_count = participant_count - 1;
|
178
|
174
|
end
|
179
|
175
|
|
180
|
|
- local GET_response = {
|
181
|
|
- headers = {
|
182
|
|
- content_type = "application/json";
|
183
|
|
- };
|
184
|
|
- body = json.encode(occupants_json);
|
185
|
|
- };
|
186
|
|
- return GET_response;
|
|
176
|
+ return json.encode(occupants_json);
|
187
|
177
|
end;
|
188
|
178
|
|
189
|
179
|
function module.load()
|