-
-
Notifications
You must be signed in to change notification settings - Fork 11
Voice support #33
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
base: main
Are you sure you want to change the base?
Voice support #33
Changes from 17 commits
4b66a39
d49fcc1
f942d4d
a820da1
4cf68cb
61a4263
8d412d3
c9e96ae
15d959a
ef52d96
753c916
5075107
1cf1c9a
2917dc6
8a767b5
0e66982
5645ece
d4da406
368e7e4
d5aea9d
5be2f71
bfe23ed
bf98f17
9e6664f
35a5599
6299376
b8bcdf2
dc7a63c
8b20bbc
e3fade7
56d79fa
88aa05d
6001c74
12ab4de
3b6303f
e990997
34f7ee4
c182f07
bde09a4
5fe71f9
7f7623f
42ca30e
8b1e6ff
6f758a5
7cdc426
ddd4160
d42b3d5
0525f9d
65aaef7
90514e0
11f2c62
a3d771a
81e7b2c
e7ccd8c
ad0a4fb
de68d6c
3c58754
50a9be0
ee443c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -258,6 +258,79 @@ struct ChannelButton: View { | |||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| struct VoiceChannelButton<Content: View>: View { | ||||||||||||||||||||
| @Environment(\.appState) var appState | ||||||||||||||||||||
| @Environment(\.gateway) var gw | ||||||||||||||||||||
| @Environment(\.guildStore) var guild | ||||||||||||||||||||
| @State private var isHovered = false | ||||||||||||||||||||
| var channels: [ChannelSnowflake: DiscordChannel] | ||||||||||||||||||||
| var channel: DiscordChannel | ||||||||||||||||||||
| var content: (_ hovered: Bool) -> Content | ||||||||||||||||||||
|
|
||||||||||||||||||||
| var shouldHide: Bool { | ||||||||||||||||||||
| guard let guild else { return false } | ||||||||||||||||||||
| return guild.hasPermission( | ||||||||||||||||||||
| channel: channel, | ||||||||||||||||||||
| .viewChannel | ||||||||||||||||||||
| ) == false | ||||||||||||||||||||
| } | ||||||||||||||||||||
| var body: some View { | ||||||||||||||||||||
| if !shouldHide { | ||||||||||||||||||||
| Button { | ||||||||||||||||||||
| Task { | ||||||||||||||||||||
| await gw.voice.updateVoiceConnection( | ||||||||||||||||||||
| .join( | ||||||||||||||||||||
| channelId: channel.id, | ||||||||||||||||||||
| guildId: channel.guild_id! | ||||||||||||||||||||
|
||||||||||||||||||||
| await gw.voice.updateVoiceConnection( | |
| .join( | |
| channelId: channel.id, | |
| guildId: channel.guild_id! | |
| guard let guildId = channel.guild_id else { return } | |
| await gw.voice.updateVoiceConnection( | |
| .join( | |
| channelId: channel.id, | |
| guildId: guildId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting SWIFT_OBJC_INTEROP_MODE to objcxx enables C++ interoperability which is required for some dependencies (likely DaveKit). However, this is a significant compiler mode change that affects the entire project. Ensure this is intentional and documented, as it may have implications for build times and compatibility with other dependencies.