Skip to content

Commit

Permalink
#32 Added "SubChannelIdList" property to "ChannelDeletedEventArgs"
Browse files Browse the repository at this point in the history
This allows to get the IDs of deleted sub-channels
  • Loading branch information
Scordo committed Sep 8, 2017
1 parent cf0ce49 commit 19f4430
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using TS3QueryLib.Core.CommandHandling;
using TS3QueryLib.Core.Common;

Expand All @@ -9,6 +11,7 @@ public class ChannelDeletedEventArgs : System.EventArgs, IDump
#region Properties

public int? ChannelId { get; protected set; }
public List<int> SubChannelIdList { get; protected set; }
public int? InvokerId { get; protected set; }
public string InvokerName { get; protected set; }

Expand All @@ -25,6 +28,8 @@ public ChannelDeletedEventArgs(CommandParameterGroupList commandParameterGroupLi
ChannelId = commandParameterGroupList.GetParameterValue<int?>("cid");
InvokerId = commandParameterGroupList.GetParameterValue<int?>("invokerid");
InvokerName = commandParameterGroupList.GetParameterValue<string>("invokername");

SubChannelIdList = commandParameterGroupList.Skip(1).Select(pg => pg.GetParameterValue<int>("cid")).ToList();
}

#endregion
Expand Down

5 comments on commit 19f4430

@Myszax
Copy link

@Myszax Myszax commented on 19f4430 Sep 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretical ChannelId property shouldn't be swapped with (if exists) last item from SubChannelIdList? Always when you delete channel with subs, last deleted channel is parent. It's strange when parent channel id is placed in SubChannelIdList :P

@Scordo
Copy link
Owner Author

@Scordo Scordo commented on 19f4430 Sep 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh.. Ok. Is this documented anywhere? I'll fix this when I'm back from vacation in a week.

@Myszax
Copy link

@Myszax Myszax commented on 19f4430 Sep 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is no documented :( I know this from my TS3 experience, but you can reproduce/test this if you want :)

@Myszax
Copy link

@Myszax Myszax commented on 19f4430 Sep 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway according to ChannelListEntry properties like ChannelId, InvokerId, SubChannelIdList shouldn't be uint? instead of int? ?

@Scordo
Copy link
Owner Author

@Scordo Scordo commented on 19f4430 Sep 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the order with this commit: 1c897d0
Regarding int? and uint?: uint? would be better, but the other properties are int?. I know there is inconsistency but changing the type now would make existing code incompatible.

Please sign in to comment.