98 : void
99 {
100 $this->cdata = trim($this->cdata);
101
102 switch ($a_name) {
103 case 'Title':
104 if ($this->in_sub_rooms) {
106 } else {
108 }
109 break;
110
111 case 'Description':
113 break;
114
115 case 'OnlineStatus':
116 $this->room->setSetting('online_status', (int) $this->cdata);
117 break;
118
119 case 'AllowAnonymousAccess':
120 $this->room->setSetting('allow_anonymous', (int) $this->cdata);
121 break;
122
123 case 'AllowCustomUsernames':
124 $this->room->setSetting('allow_custom_usernames', (int) $this->cdata);
125 break;
126
127 case 'EnableHistory':
128 $this->room->setSetting('enable_history', (int) $this->cdata);
129 break;
130
131 case 'RestrictHistory':
132 $this->room->setSetting('restrict_history', (int) $this->cdata);
133 break;
134
135 case 'PrivateRoomsEnabled':
136 $this->room->setSetting('private_rooms_enabled', (int) $this->cdata);
137 break;
138
139 case 'DisplayPastMessages':
140 $this->room->setSetting('display_past_msgs', (int) $this->cdata);
141 break;
142
143 case 'AutoGeneratedUsernameSchema':
145 break;
146
147 case 'RoomId':
148 $this->exportRoomId = (
int) $this->cdata;
149 break;
150
151 case 'SubRoomId':
152 $this->exportSubRoomId = (
int) $this->cdata;
153 break;
154
155 case 'Owner':
156 $this->owner = (
int) $this->cdata;
157 break;
158
159 case 'Closed':
160 $this->closed = (
int) $this->cdata;
161 break;
162
163 case 'Public':
164 $this->
public = (
int) $this->cdata;
165 break;
166
167 case 'CreatedTimestamp':
168 $this->timestamp = (
int) $this->cdata;
169 break;
170
171 case 'PrivilegedUserId':
172 $this->userIds[] = (
int) $this->cdata;
173 break;
174
175 case 'SubRoom':
178 $user->setId((int) $this->owner);
179
181 $subRoomId = $this->room->addPrivateRoom(
182 $this->title,
183 $chat_user,
184 [
185 'public' => (bool) $this->public,
186 'created' => (int) $this->timestamp,
187 'closed' => (bool) $this->closed
188 ]
189 );
190
191 foreach ($this->userIds as $userId) {
192 $this->room->inviteUserToPrivateRoom($userId, $subRoomId);
193 }
194
196 }
197
198 $this->exportSubRoomId = 0;
199 $this->title = '';
200 $this->owner = 0;
201 $this->closed = 0;
202 $this->public = 0;
203 $this->timestamp = 0;
204 $this->userIds = [];
205 break;
206
207 case 'SubRooms':
208 $this->in_sub_rooms = false;
209 break;
210
211 case 'Body':
213 break;
214
215 case 'Message':
217 $message = json_decode($this->message,
true, 512, JSON_THROW_ON_ERROR);
218 if (
220 (0 === $this->exportSubRoomId || array_key_exists($this->exportSubRoomId, $this->subRoomIdMapping))
221 ) {
222 $message[
'roomId'] = $this->room->getRoomId();
226
227 $this->room->addHistoryEntry(
$message);
228 }
229 }
230
231 $this->timestamp = 0;
232 $this->exportSubRoomId = 0;
233 break;
234
235 case 'Messages':
236 $this->in_messages = false;
237 break;
238
239 case 'Chatroom':
240 $this->chat->update();
241
242 $this->room->setSetting('online_status', 0);
243 $this->room->save();
244 break;
245 }
246
247 $this->cdata = '';
248 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")