Merge branch 'main' into v2
This commit is contained in:
63
pkg/connector/capabilities.go
Normal file
63
pkg/connector/capabilities.go
Normal file
@@ -0,0 +1,63 @@
|
||||
// mautrix-discord - A Matrix-Discord puppeting bridge.
|
||||
// Copyright (C) 2024 Tulir Asokan
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package connector
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.mau.fi/util/ffmpeg"
|
||||
"maunium.net/go/mautrix/bridgev2"
|
||||
"maunium.net/go/mautrix/event"
|
||||
)
|
||||
|
||||
var DiscordGeneralCaps = &bridgev2.NetworkGeneralCapabilities{
|
||||
Provisioning: bridgev2.ProvisioningCapabilities{
|
||||
ResolveIdentifier: bridgev2.ResolveIdentifierCapabilities{},
|
||||
GroupCreation: map[string]bridgev2.GroupTypeCapabilities{},
|
||||
},
|
||||
}
|
||||
|
||||
func (dc *DiscordConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities {
|
||||
return DiscordGeneralCaps
|
||||
}
|
||||
|
||||
func (wa *DiscordConnector) GetBridgeInfoVersion() (info, caps int) {
|
||||
return 1, 1
|
||||
}
|
||||
|
||||
/*func supportedIfFFmpeg() event.CapabilitySupportLevel {
|
||||
if ffmpeg.Supported() {
|
||||
return event.CapLevelPartialSupport
|
||||
}
|
||||
return event.CapLevelRejected
|
||||
}*/
|
||||
|
||||
func capID() string {
|
||||
base := "fi.mau.discord.capabilities.2025_11_20"
|
||||
if ffmpeg.Supported() {
|
||||
return base + "+ffmpeg"
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
var discordCaps = &event.RoomFeatures{
|
||||
ID: capID(),
|
||||
}
|
||||
|
||||
func (dc *DiscordClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *event.RoomFeatures {
|
||||
return discordCaps
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (d *DiscordConnector) LoadUserLogin(ctx context.Context, login *bridgev2.Us
|
||||
|
||||
var _ bridgev2.NetworkAPI = (*DiscordClient)(nil)
|
||||
|
||||
func (d *DiscordClient) Connect(ctx context.Context) error {
|
||||
func (d *DiscordClient) Connect(ctx context.Context) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
@@ -51,8 +51,3 @@ func (d *DiscordClient) LogoutRemote(ctx context.Context) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *DiscordClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *bridgev2.NetworkRoomCapabilities {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
@@ -41,8 +41,3 @@ func (d *DiscordConnector) GetName() bridgev2.BridgeName {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (d *DiscordConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user