Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RoomNode.cs
1using System;
2using System.Collections.Generic;
3using System.Threading.Tasks;
4using System.Windows;
5using System.Windows.Controls;
6using System.Windows.Media;
7using System.Windows.Input;
8using System.Xml;
12using Waher.Events;
18
20{
24 public class RoomNode : TreeNode
25 {
26 private readonly Dictionary<string, OccupantNode> occupantByNick = new Dictionary<string, OccupantNode>();
27 private readonly string roomId;
28 private readonly string domain;
29 private readonly string name;
30 private string nickName;
31 private string password;
32 private bool entered;
33 private bool entering = false;
34
35 public RoomNode(TreeNode Parent, string RoomId, string Domain, string NickName, string Password, string Name, bool Entered)
36 : base(Parent)
37 {
38 this.roomId = RoomId;
39 this.domain = Domain;
40 this.name = Name;
41 this.nickName = NickName;
42 this.password = Password;
43 this.entered = Entered;
44
45 this.SetParameters();
46 }
47
48 public override string Header
49 {
50 get
51 {
52 if (!string.IsNullOrEmpty(this.name))
53 return this.name;
54
55 if (this.domain == (this.Parent as MucService)?.JID)
56 return this.roomId;
57 else
58 return this.Jid;
59 }
60 }
61
62 public override string Key => this.Jid;
63 public string RoomId => this.roomId;
64 public string Domain => this.domain;
65 public string NickName => this.nickName;
66 public string Password => this.password;
67 public string Jid => this.roomId + "@" + this.domain;
68 public bool Entered => this.entered;
69 public bool Entering => this.entering;
70
71 public int NrOccupants
72 {
73 get
74 {
75 lock (this.occupantByNick)
76 {
77 return this.occupantByNick.Count;
78 }
79 }
80 }
81
82 private void SetParameters()
83 {
84 List<Parameter> Parameters = new List<Parameter>()
85 {
86 new StringParameter("RoomID", "Room ID", this.roomId),
87 new StringParameter("Domain", "Domain", this.domain)
88 };
89
90 if (!string.IsNullOrEmpty(this.name))
91 Parameters.Add(new StringParameter("Name", "Name", this.name));
92
93 if (!string.IsNullOrEmpty(this.nickName))
94 Parameters.Add(new StringParameter("NickName", "Nick-Name", this.nickName));
95
96 this.children = new SortedDictionary<string, TreeNode>()
97 {
98 { string.Empty, new Loading(this) }
99 };
100
101 this.parameters = new DisplayableParameters(Parameters.ToArray());
102 }
103
104 public override string ToolTip => this.name;
105 public override bool CanRecycle => true;
106
107 public override Task Recycle(MainWindow Window)
108 {
109 this.entered = false;
110 return Task.CompletedTask;
111 }
112
113 public override string TypeName => "Multi-User Chat Room";
114
115 public override ImageSource ImageResource
116 {
117 get
118 {
119 if (this.domain == (this.Parent as MucService)?.JID)
120 {
121 if (this.IsExpanded)
122 return XmppAccountNode.folderYellowOpen;
123 else
124 return XmppAccountNode.folderYellowClosed;
125 }
126 else
127 {
128 if (this.IsExpanded)
129 return XmppAccountNode.folderBlueOpen;
130 else
131 return XmppAccountNode.folderBlueClosed;
132 }
133 }
134 }
135
136 public override void Write(XmlWriter Output)
137 {
138 // Don't output.
139 }
140
141 public MucService Service
142 {
143 get
144 {
145 TreeNode Loop = this.Parent;
146
147 while (!(Loop is null))
148 {
149 if (Loop is MucService MucService)
150 return MucService;
151
152 Loop = Loop.Parent;
153 }
154
155 return null;
156 }
157 }
158
159 private bool loadingChildren = false;
160
161 public MultiUserChatClient MucClient
162 {
163 get
164 {
165 return this.Service?.MucClient;
166 }
167 }
168
169 public override bool CanAddChildren => true;
170 public override bool CanEdit => true;
171 public override bool CanDelete => true;
172 public override bool CustomDeleteQuestion => true;
173
174 protected override async void LoadChildren()
175 {
176 try
177 {
178 if (!this.loadingChildren && !this.IsLoaded)
179 {
180 Mouse.OverrideCursor = Cursors.Wait;
181 this.loadingChildren = true;
182
183 if (!await this.AssertEntered(true))
184 {
185 this.loadingChildren = false;
186 MainWindow.MouseDefault();
187 return;
188 }
189
190 this.MucClient?.GetOccupants(this.roomId, this.domain, null, null, (Sender, e) =>
191 {
192 this.loadingChildren = false;
193 MainWindow.MouseDefault();
194
195 this.Service.NodesRemoved(this.children.Values, this);
196
197 if (e.Ok)
198 {
199 SortedDictionary<string, TreeNode> Children = new SortedDictionary<string, TreeNode>();
200
201 lock (this.occupantByNick)
202 {
203 foreach (KeyValuePair<string, OccupantNode> P in this.occupantByNick)
204 Children[P.Key] = P.Value;
205 }
206
207 foreach (MucOccupant Occupant in e.Occupants)
208 {
209 Children[Occupant.Jid] = this.CreateOccupantNode(Occupant.RoomId, Occupant.Domain, Occupant.NickName,
210 Occupant.Affiliation, Occupant.Role, Occupant.Jid);
211 }
212
213 this.children = new SortedDictionary<string, TreeNode>(Children);
214 this.OnUpdated();
215 this.Service.NodesAdded(Children.Values, this);
216 }
217 else
218 MainWindow.ShowStatus(string.IsNullOrEmpty(e.ErrorText) ? "Unable to get occupants." : e.ErrorText);
219
220 return Task.CompletedTask;
221
222 }, null);
223 }
224
225 base.LoadChildren();
226 }
227 catch (Exception ex)
228 {
229 this.loadingChildren = false;
230 MainWindow.ErrorBox(ex.Message);
231 }
232 }
233
234 internal OccupantNode CreateOccupantNode(string RoomId, string Domain, string NickName, Affiliation Affiliation, Role Role, string Jid)
235 {
236 lock (this.occupantByNick)
237 {
238 if (!this.occupantByNick.TryGetValue(NickName, out OccupantNode Node))
239 {
240 Node = new OccupantNode(this, RoomId, Domain, NickName, Affiliation, Role, Jid);
241
242 lock (this.occupantByNick)
243 this.occupantByNick[NickName] = Node;
244 }
245
246 return Node;
247 }
248 }
249
250 protected override void UnloadChildren()
251 {
252 base.UnloadChildren();
253
254 if (this.IsLoaded)
255 {
256 if (!(this.children is null))
257 this.Service?.NodesRemoved(this.children.Values, this);
258
259 this.children = new SortedDictionary<string, TreeNode>()
260 {
261 { string.Empty, new Loading(this) }
262 };
263
264 this.OnUpdated();
265 }
266 }
267
268 internal async void EnterIfNotAlready(bool ForwardPresence)
269 {
270 try
271 {
272 await this.AssertEntered(ForwardPresence);
273 }
274 catch (Exception ex)
275 {
276 Log.Exception(ex);
277 }
278 }
279
280 private async Task<bool> AssertEntered(bool ForwardPresence)
281 {
282 if (!this.entered && !this.entering)
283 {
284 this.entering = true;
285
286 try
287 {
289 EnterRoomForm Form = null;
290
291 Mouse.OverrideCursor = Cursors.Wait;
292
293 if (string.IsNullOrEmpty(this.nickName))
294 {
295 ServiceDiscoveryEventArgs e2 = await this.MucClient.GetMyNickNameAsync(this.roomId, this.domain);
296
297 if (e2.Ok)
298 {
299 foreach (Identity Id in e2.Identities)
300 {
301 if (Id.Category == "conference" && Id.Type == "text")
302 {
303 this.nickName = Id.Name;
304 this.OnUpdated();
305 break;
306 }
307 }
308 }
309 }
310
311 if (string.IsNullOrEmpty(this.nickName))
312 e = null;
313 else
314 e = await this.MucClient.EnterRoomAsync(this.roomId, this.domain, this.nickName, this.password);
315
316 while (!(e?.Ok ?? false))
317 {
318 TaskCompletionSource<bool> InputReceived = new TaskCompletionSource<bool>();
319
320 if (Form is null)
321 {
322 Form = new EnterRoomForm(this.roomId, this.domain)
323 {
324 Owner = MainWindow.currentInstance
325 };
326
327 Form.NickName.Text = this.nickName;
328 Form.Password.Password = this.password;
329 }
330
331 MainWindow.MouseDefault();
332 MainWindow.UpdateGui(() =>
333 {
334 bool? Result = Form.ShowDialog();
335 InputReceived.TrySetResult(Result.HasValue && Result.Value);
336 return Task.CompletedTask;
337 });
338
339 if (!await InputReceived.Task)
340 {
341 this.entered = false;
342 return false;
343 }
344
345 Mouse.OverrideCursor = Cursors.Wait;
346 e = await this.MucClient.EnterRoomAsync(this.roomId, this.domain, Form.NickName.Text, Form.Password.Password);
347 if (!e.Ok)
348 MainWindow.ErrorBox(string.IsNullOrEmpty(e.ErrorText) ? "Unable to enter room." : e.ErrorText);
349 }
350
351 if (!(Form is null))
352 {
353 string Prefix = this.MucClient.Client.BareJID + "." + this.roomId + "@" + this.domain;
354 bool Updated = false;
355
356 if (this.nickName != Form.NickName.Text)
357 {
358 this.nickName = Form.NickName.Text;
359 await RuntimeSettings.SetAsync(Prefix + ".Nick", this.nickName);
360 Updated = true;
361 }
362
363 if (this.password != Form.Password.Password)
364 {
365 this.password = Form.Password.Password;
366 await RuntimeSettings.SetAsync(Prefix + ".Pwd", this.password);
367 Updated = true;
368 }
369
370 if (Updated)
371 this.OnUpdated();
372 }
373
374 if (ForwardPresence)
375 await this.Service.MucClient_OccupantPresence(this, e);
376
377 this.entered = true;
378 }
379 finally
380 {
381 this.entering = false;
382 }
383 }
384
385 return true;
386 }
387
388 public override async void Edit()
389 {
390 try
391 {
392 if (!await this.AssertEntered(true))
393 return;
394
395 DataForm ConfigurationForm = await this.MucClient.GetRoomConfigurationAsync(this.roomId, this.domain, (Sender, e) =>
396 {
397 if (e.Ok)
398 this.OnUpdated();
399
400 return Task.CompletedTask;
401 }, null);
402
403 MainWindow.currentInstance.ShowDataForm(ConfigurationForm);
404 }
405 catch (Exception ex)
406 {
407 MainWindow.ErrorBox(ex.Message);
408 }
409 }
410
411 public override async Task Delete(TreeNode Parent, EventHandler OnDeleted)
412 {
413 DestroyRoomForm Form = new DestroyRoomForm(this.Header)
414 {
415 Owner = MainWindow.currentInstance
416 };
417
418 bool? Result = Form.ShowDialog();
419 if (!Result.HasValue || !Result.Value)
420 return;
421
422 await this.MucClient.DestroyRoom(this.roomId, this.domain, Form.Reason.Text, Form.AlternativeRoomJid.Text, (Sender, e) =>
423 {
424 if (e.Ok)
425 base.Delete(Parent, OnDeleted);
426 else
427 MainWindow.ErrorBox(string.IsNullOrEmpty(e.ErrorText) ? "Unable to destroy room." : e.ErrorText);
428
429 return Task.CompletedTask;
430 }, null);
431 }
432
433 public override void SelectionChanged()
434 {
435 this.EnterIfNotAlready(true);
436
437 base.SelectionChanged();
438 }
439
440 public override async void Add()
441 {
442 try
443 {
445 {
446 Owner = MainWindow.currentInstance
447 };
448
449 bool? Result = Form.ShowDialog();
450 if (!Result.HasValue || !Result.Value)
451 return;
452
453 string BareJid = Form.BareJid.Text.Trim();
454 string Reason = Form.Reason.Text.Trim();
455 bool InvitationSent = false;
456
457 Networking.XMPP.RosterItem Item = this.MucClient.Client[BareJid];
458 if (!(Item is null) && Item.HasLastPresence && Item.LastPresence.IsOnline)
459 {
460 ServiceDiscoveryEventArgs e = await this.MucClient.Client.ServiceDiscoveryAsync(Item.LastPresenceFullJid);
461
463 {
464 await this.MucClient.InviteDirect(this.roomId, this.domain, BareJid, Reason, string.Empty, this.password);
465 MainWindow.ShowStatus("Direct Invitation sent.");
466 InvitationSent = true;
467 }
468 }
469
470 if (!InvitationSent)
471 {
472 await this.MucClient.Invite(this.roomId, this.domain, Form.BareJid.Text, Form.Reason.Text);
473 MainWindow.ShowStatus("Invitation sent.");
474 }
475 }
476 catch (Exception ex)
477 {
478 MainWindow.ErrorBox(ex.Message);
479 }
480 }
481
482 public override bool CanChat => true;
483
484 public override async Task SendChatMessage(string Message, string ThreadId, MarkdownDocument Markdown)
485 {
486 if (Markdown is null)
487 await this.MucClient.SendGroupChatMessage(this.roomId, this.domain, Message, string.Empty, ThreadId);
488 else
489 {
490 await this.MucClient.SendCustomGroupChatMessage(this.roomId, this.domain, await XmppContact.MultiFormatMessage(Message, Markdown),
491 string.Empty, ThreadId);
492 }
493 }
494
495 public override bool RemoveChild(TreeNode Node)
496 {
497 if (Node is OccupantNode OccupantNode)
498 {
499 lock (this.occupantByNick)
500 {
501 this.occupantByNick.Remove(OccupantNode.NickName);
502 }
503 }
504
505 return base.RemoveChild(Node);
506 }
507
508 private OccupantNode AddOccupantNode(string RoomId, string Domain, string NickName, Affiliation? Affiliation, Role? Role, string Jid)
509 {
510 OccupantNode Node = new OccupantNode(this, RoomId, Domain, NickName, Affiliation, Role, Jid);
511
512 lock (this.occupantByNick)
513 {
514 this.occupantByNick[NickName] = Node;
515 }
516
517 if (this.IsLoaded)
518 {
519 if (this.children is null)
520 this.children = new SortedDictionary<string, TreeNode>() { { Node.Key, Node } };
521 else
522 {
523 lock (this.children)
524 {
525 this.children[Node.Key] = Node;
526 }
527 }
528
529 MainWindow.UpdateGui(() =>
530 {
531 this.Service?.Account?.View?.NodeAdded(this, Node);
532
533 if (!(Node.Children is null))
534 {
535 foreach (TreeNode Node2 in Node.Children)
536 this.Service?.Account?.View?.NodeAdded(Node, Node2);
537 }
538
539 this.OnUpdated();
540
541 return Task.CompletedTask;
542 });
543 }
544
545 return Node;
546 }
547
548 public OccupantNode GetOccupantNode(string NickName, Affiliation? Affiliation, Role? Role, string Jid)
549 {
550 OccupantNode Result;
551
552 lock (this.occupantByNick)
553 {
554 if (!this.occupantByNick.TryGetValue(NickName, out Result))
555 Result = null;
556 }
557
558 if (!(Result is null))
559 {
560 bool Changed = false;
561
562 if (Affiliation.HasValue && Affiliation != Result.Affiliation)
563 {
564 Result.Affiliation = Affiliation;
565 Changed = true;
566 }
567
568 if (Role.HasValue && Role != Result.Role)
569 {
570 Result.Role = Role;
571 Changed = true;
572 }
573
574 if (!string.IsNullOrEmpty(Jid) && Jid != Result.Jid)
575 {
576 Result.Jid = Jid;
577 Changed = true;
578 }
579
580 if (Changed)
581 Result.OnUpdated();
582
583 return Result;
584 }
585
586 Result = this.AddOccupantNode(this.roomId, this.domain, NickName, Affiliation, Role, Jid);
587
588 return Result;
589 }
590
591 public override void AddContexMenuItems(ref string CurrentGroup, ContextMenu Menu)
592 {
593 base.AddContexMenuItems(ref CurrentGroup, Menu);
594
595 MenuItem Item;
596 MenuItem Item2;
597
598 this.GroupSeparator(ref CurrentGroup, "MUC", Menu);
599
600 Menu.Items.Add(Item = new MenuItem()
601 {
602 Header = "_Register with room...",
603 IsEnabled = true,
604 });
605
606 Item.Click += this.RegisterWithRoom_Click;
607
608 Menu.Items.Add(Item = new MenuItem()
609 {
610 Header = "Request _voice...",
611 IsEnabled = true,
612 });
613
614 Item.Click += this.RequestPrivileges_Click;
615
616 Menu.Items.Add(Item = new MenuItem()
617 {
618 Header = "Change _Subject...",
619 IsEnabled = true,
620 });
621
622 Item.Click += this.ChangeSubject_Click;
623
624 Menu.Items.Add(Item = new MenuItem()
625 {
626 Header = "Occupant Lists",
627 IsEnabled = true,
628 });
629
630 Item.Items.Add(Item2 = new MenuItem()
631 {
632 Header = "Owners...",
633 IsEnabled = true,
634 });
635
636 Item2.Click += this.GetOwnersList_Click;
637
638 Item.Items.Add(Item2 = new MenuItem()
639 {
640 Header = "Administrators...",
641 IsEnabled = true,
642 });
643
644 Item2.Click += this.GetAdministratorsList_Click;
645
646 Item.Items.Add(Item2 = new MenuItem()
647 {
648 Header = "Moderators...",
649 IsEnabled = true,
650 });
651
652 Item2.Click += this.GetModeratorsList_Click;
653
654 Item.Items.Add(Item2 = new MenuItem()
655 {
656 Header = "Members...",
657 IsEnabled = true,
658 });
659
660 Item2.Click += this.GetMembersList_Click;
661
662 Item.Items.Add(Item2 = new MenuItem()
663 {
664 Header = "Participants...",
665 IsEnabled = true,
666 });
667
668 Item2.Click += this.GetParticipantsList_Click;
669
670 Item.Items.Add(Item2 = new MenuItem()
671 {
672 Header = "Visitors...",
673 IsEnabled = true,
674 });
675
676 Item2.Click += this.GetVisitorsList_Click;
677
678 Item.Items.Add(Item2 = new MenuItem()
679 {
680 Header = "Outcasts...",
681 IsEnabled = true,
682 });
683
684 Item2.Click += this.GetOutcastsList_Click;
685 }
686
687 private void RegisterWithRoom_Click(object Sender, RoutedEventArgs e)
688 {
689 Mouse.OverrideCursor = Cursors.Wait;
690
691 this.MucClient.GetRoomRegistrationForm(this.roomId, this.domain, (sender2, e2) =>
692 {
693 MainWindow.MouseDefault();
694
695 if (e2.Ok)
696 {
697 if (e2.AlreadyRegistered)
698 {
699 if (this.nickName != e2.UserName)
700 {
701 string Prefix = this.MucClient.Client.BareJID + "." + this.roomId + "@" + this.domain;
702
703 this.nickName = e2.UserName;
704 RuntimeSettings.Set(Prefix + ".Nick", this.nickName);
705
706 this.EnterIfNotAlready(true);
707 }
708
709 MainWindow.MessageBox("You are already registered in the room with nick-name '" + e2.UserName + "'.",
710 "Information", MessageBoxButton.OK, MessageBoxImage.Information);
711 }
712 else
713 {
714 MainWindow.UpdateGui(async () =>
715 {
716 ParameterDialog Dialog = await ParameterDialog.CreateAsync(e2.Form);
717 Dialog.ShowDialog();
718 });
719 }
720 }
721 else
722 MainWindow.ErrorBox(string.IsNullOrEmpty(e2.ErrorText) ? "Unable to get room registration form." : e2.ErrorText);
723
724 return Task.CompletedTask;
725 }, null);
726 }
727
728 private async void RequestPrivileges_Click(object Sender, RoutedEventArgs e)
729 {
730 try
731 {
732 await this.MucClient.RequestVoice(this.roomId, this.domain);
733 MainWindow.SuccessBox("Voice privileges requested.");
734 }
735 catch (Exception ex)
736 {
737 MainWindow.ErrorBox(ex.Message);
738 }
739 }
740
741 private void ChangeSubject_Click(object Sender, RoutedEventArgs e)
742 {
744 {
745 Owner = MainWindow.currentInstance
746 };
747
748 bool? b = Form.ShowDialog();
749
750 if (b.HasValue && b.Value)
751 this.MucClient.ChangeRoomSubject(this.roomId, this.domain, Form.Subject.Text);
752 }
753
754 public override void ViewClosed()
755 {
756 this.MucClient.LeaveRoom(this.roomId, this.domain, this.nickName, null, null);
757 this.entered = false;
758 }
759
760 private void GetAdministratorsList_Click(object Sender, RoutedEventArgs e)
761 {
762 this.MucClient.GetAdminList(this.roomId, this.domain, this.OccupantListCallback, "Administrators");
763 }
764
765 private void GetOwnersList_Click(object Sender, RoutedEventArgs e)
766 {
767 this.MucClient.GetOwnerList(this.roomId, this.domain, this.OccupantListCallback, "Owners");
768 }
769
770 private void GetModeratorsList_Click(object Sender, RoutedEventArgs e)
771 {
772 this.MucClient.GetModeratorList(this.roomId, this.domain, this.OccupantListCallback, "Moderators");
773 }
774
775 private void GetMembersList_Click(object Sender, RoutedEventArgs e)
776 {
777 this.MucClient.GetMemberList(this.roomId, this.domain, this.OccupantListCallback, "Members");
778 }
779
780 private void GetParticipantsList_Click(object Sender, RoutedEventArgs e)
781 {
782 this.MucClient.GetVoiceList(this.roomId, this.domain, this.OccupantListCallback, "Participants");
783 }
784
785 private void GetVisitorsList_Click(object Sender, RoutedEventArgs e)
786 {
787 this.MucClient.GetOccupants(this.roomId, this.domain, null, Role.Visitor, this.OccupantListCallback, "Visitors");
788 }
789
790 private void GetOutcastsList_Click(object Sender, RoutedEventArgs e)
791 {
792 this.MucClient.GetBannedOccupants(this.roomId, this.domain, this.OccupantListCallback, "Outcasts");
793 }
794
795 private Task OccupantListCallback(object Sender, OccupantListEventArgs e)
796 {
797 if (e.Ok)
798 {
799 OccupantListForm Form = new OccupantListForm((string)e.State, e.Occupants)
800 {
801 Owner = MainWindow.currentInstance
802 };
803
804 MainWindow.UpdateGui(() =>
805 {
806 bool? b = Form.ShowDialog();
807 if (b.HasValue && b.Value)
808 {
809 this.MucClient.ConfigureOccupants(this.roomId, this.domain, Form.GetChanges(), (sender2, e2) =>
810 {
811 if (!e2.Ok)
812 MainWindow.ErrorBox(string.IsNullOrEmpty(e.ErrorText) ? "Unable to apply changes." : e.ErrorText);
813
814 return Task.CompletedTask;
815 }, null);
816 }
817
818 return Task.CompletedTask;
819 });
820 }
821 else
822 MainWindow.ErrorBox(string.IsNullOrEmpty(e.ErrorText) ? "Unable to get occupant list." : e.ErrorText);
823
824 return Task.CompletedTask;
825 }
826
827 }
828}
Interaction logic for ChangeSubjectForm.xaml
Interaction logic for DestroyRoomForm.xaml
Interaction logic for EnterRoomForm.xaml
Interaction logic for OccupantListForm.xaml
Interaction logic for SendRoomInvitationForm.xaml
Interaction logic for xaml
Represents a data source in a concentrator.
Definition: Loading.cs:11
Represents an occupant in a room hosted by a Multi-User Chat service.
Definition: OccupantNode.cs:20
Represents a room hosted by a Multi-User Chat service.
Definition: RoomNode.cs:25
override void AddContexMenuItems(ref string CurrentGroup, ContextMenu Menu)
Adds context sensitive menu items to a context menu.
Definition: RoomNode.cs:591
override async void Edit()
Is called when the user wants to edit a node.
Definition: RoomNode.cs:388
override void Write(XmlWriter Output)
Saves the object to a file.
Definition: RoomNode.cs:136
override async void Add()
Is called when the user wants to add a node to the current node.
Definition: RoomNode.cs:440
override async Task SendChatMessage(string Message, string ThreadId, MarkdownDocument Markdown)
Sends a chat message.
Definition: RoomNode.cs:484
override async void LoadChildren()
Method is called to make sure children are loaded.
Definition: RoomNode.cs:174
override bool RemoveChild(TreeNode Node)
Removes a child node.
Definition: RoomNode.cs:495
override void ViewClosed()
Method called when the view has been closed.
Definition: RoomNode.cs:754
override async Task Delete(TreeNode Parent, EventHandler OnDeleted)
Method called when a node is to be deleted.
Definition: RoomNode.cs:411
override Task Recycle(MainWindow Window)
Is called when the user wants to recycle the node.
Definition: RoomNode.cs:107
override void UnloadChildren()
Method is called to notify children can be unloaded.
Definition: RoomNode.cs:250
override void SelectionChanged()
Method called when selection has been changed.
Definition: RoomNode.cs:433
Abstract base class for tree nodes in the connection view.
Definition: TreeNode.cs:24
TreeNode[] Children
Children of the node. If null, children are not loaded.
Definition: TreeNode.cs:72
virtual DisplayableParameters DisplayableParameters
Gets available displayable parameters.
Definition: TreeNode.cs:214
TreeNode Parent
Parent node. May be null if a root node.
Definition: TreeNode.cs:107
bool IsExpanded
If the node is expanded.
Definition: TreeNode.cs:233
Class representing a normal XMPP account.
Represents an XMPP contact whose capabilities have not been measured.
Definition: XmppContact.cs:24
Contains a markdown document. This markdown document class supports original markdown,...
Static class managing the application event log. Applications and services log events on this static ...
Definition: Log.cs:13
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
Definition: Log.cs:1647
Implements support for data forms. Data Forms are defined in the following XEPs:
Definition: DataForm.cs:42
bool Ok
If the response is an OK result response (true), or an error response (false).
object State
State object passed to the original request.
bool Ok
If the response is an OK result response (true), or an error response (false).
XmppClient Client
XMPP Client. Is null if event raised by a component.
Multi-User Chat room occupant.
Definition: MucOccupant.cs:11
Client managing communication with a Multi-User-Chat service. https://xmpp.org/extensions/xep-0045....
Task GetOccupants(string RoomId, string Domain, Affiliation Affiliation, EventHandlerAsync< OccupantListEventArgs > Callback, object State)
Gets a list of occupants having a specific affiliation.
const string NamespaceJabberConference
jabber:x:conference
Event arguments for a occupant list event handlers.
Event arguments for user presence events.
Maintains information about an item in the roster.
Definition: RosterItem.cs:75
Contains information about an identity of an entity.
Definition: Identity.cs:11
Contains information about an item of an entity.
Definition: Item.cs:11
bool HasFeature(string Feature)
Checks if the remote entity supports a specific feature.
Task< ServiceDiscoveryEventArgs > ServiceDiscoveryAsync(string To)
Performs an asynchronous service discovery request
Definition: XmppClient.cs:6003
Static class managing persistent settings.
static async Task< bool > SetAsync(string Key, string Value)
Sets a string-valued setting.
Contains information about a message logged on a node.
Definition: Message.cs:32
Affiliation
Affiliation enumeration
Definition: Enumerations.cs:11
Role
Role enumeration
Definition: Enumerations.cs:42
Prefix
SI prefixes. http://physics.nist.gov/cuu/Units/prefixes.html
Definition: Prefixes.cs:11