[add] handling of "topic" events
Christian Fraß

Christian Fraß commited on 2021-11-20 18:48:59
Zeige 1 geänderte Dateien mit 20 Einfügungen und 0 Löschungen.

... ...
@@ -193,6 +193,26 @@ namespace ns_model
193 193
 					}
194 194
 					break;
195 195
 				}
196
+				case "topic":
197
+				{
198
+					if (model.channels.hasOwnProperty(event.data["channel"]))
199
+					{
200
+						// model.channels[event.data["channel"]].topic = event.data["content"];
201
+						model.channels[event.data["channel"]].entries.push
202
+						({
203
+							"timestamp": event.timestamp,
204
+							"kind": enum_entrykind.info,
205
+							"sender": null,
206
+							"content": `channel topic: ${event.data["content"]}`,
207
+						});
208
+						shall_update_entries = true;
209
+					}
210
+					else
211
+					{
212
+						// do nothing
213
+					}
214
+					break;
215
+				}
196 216
 				case "message_channel":
197 217
 				{
198 218
 					model.channels[event.data["channel"]].entries.push
199 219