Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to move channel to the top of listing with CreateChannel, EditChannel or Move Channel #38

Open
HydroCG opened this issue Feb 9, 2019 · 3 comments
Labels

Comments

@HydroCG
Copy link

HydroCG commented Feb 9, 2019

I've been trying to create a channel with a parent channel, but an issue I'm having is that channels are always moved to the top of the channel when they are A: edited or B: created. From what I can see, this is caused by the order being given the default value of zero when created. (See https://github.com/nikeee/TeamSpeak3QueryAPI/blob/master/src/TeamSpeak3QueryApi/Specialized/Notifications/ChannelCreated.cs#L32).

I've worked around this problem by using the QueryClient and sending my own channelcreate method. Could this behaviour be changed, or can we get some overloads which allows us to determine if we want it at the top of the channel or not.

This is the code I'm using to get the behaviour I expect.

await ts3.Client.Send("channelcreate", new TeamSpeak3QueryApi.Net.Parameter("channel_name", "Test Channel Name"), new TeamSpeak3QueryApi.Net.Parameter("cpid", mParentChannelId));

@HydroCG HydroCG changed the title Creating channels put it to the top of the parent channel Created channels are put to the top of the parent channel Feb 9, 2019
@nikeee
Copy link
Owner

nikeee commented Feb 9, 2019

Are they really moved to the top? Or does this only appear so if you get the notification/response?

Looking at this method:
https://github.com/nikeee/TeamSpeak3QueryAPI/blob/master/src/TeamSpeak3QueryApi/Specialized/TeamSpeakClient.cs#L359

There isn't even the option to pass a parent channel id. The result should be converted to the ChannelCreated response. As you said, it should be zero if no order was returned. The ChannelCreated class is only used as a container for the response. Could you elaborate more?

@HydroCG
Copy link
Author

HydroCG commented Feb 9, 2019

I've got the issue mixed up a little bit but the result is still the same as I have to work-around it. Below's my thought process.

  • When you create a channel, you are unable to specify a parent channel
  • TeamSpeakClient#EditChannelInfo does not move the channel to be a child of the parent provided (or at least doesn't change its order).
  • TeamSpeakClient#MoveChannel does move the channel, but it always moves the channel to the top of the sub-channel's list.

The result of this is that by using the calls built-in, I'm unable to get the channel to be at the bottom of the list (without doing dodgy things such as moving every other channel).

@HydroCG HydroCG changed the title Created channels are put to the top of the parent channel Unable to move channel to the top of listing with CreateChannel, EditChannel or Move Channel Feb 9, 2019
@nikeee
Copy link
Owner

nikeee commented Feb 11, 2019

Thanks for elaborating. I'll have a look at this this week.

@nikeee nikeee added the bug label Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants