Skip to content

Commit

Permalink
clean up and format
Browse files Browse the repository at this point in the history
  • Loading branch information
JJTech0130 committed Jun 28, 2024
1 parent 8cc5250 commit e2fe053
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions pkg/connector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ package connector
import (
_ "embed"
up "go.mau.fi/util/configupgrade"

)

//go:embed example-config.yaml
var ExampleConfig string

type MetaConfig struct {
Mode string `yaml:"mode"`
Mode string `yaml:"mode"`
}

func upgradeConfig(helper up.Helper) {
Expand All @@ -19,4 +18,4 @@ func upgradeConfig(helper up.Helper) {

func (s *MetaConnector) GetConfig() (string, any, up.Upgrader) {
return ExampleConfig, &s.Config, up.SimpleUpgrader(upgradeConfig)
}
}
8 changes: 4 additions & 4 deletions pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package connector

import (
"context"

"maunium.net/go/mautrix/bridgev2"
)

type MetaConnector struct {
Bridge *bridgev2.Bridge
Config *MetaConfig
Config *MetaConfig
}

func NewConnector() *MetaConnector {
Expand Down Expand Up @@ -39,7 +39,7 @@ func (s *MetaConnector) GetName() bridgev2.BridgeName {
NetworkIcon: "mxc://maunium.net/JxjlbZUlCPULEeHZSwleUXQv", // Instagram icon
NetworkID: "meta",
BeeperBridgeType: "meta",
DefaultPort: 29328,
DefaultPort: 29319,
}
}

Expand All @@ -54,4 +54,4 @@ func (m *MetaConnector) Start(context.Context) error {

func (m *MetaConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLogin) error {
panic("unimplemented")
}
}
14 changes: 6 additions & 8 deletions pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ func (m *MetaConnector) GetLoginFlows() []bridgev2.LoginFlow {
}}
}

type CookieLogin struct {}
type CookieLogin struct{}

var _ bridgev2.LoginProcessCookies = (*CookieLogin)(nil)

func (p *CookieLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) {
return &bridgev2.LoginStep{
Type: bridgev2.LoginStepTypeCookies,
StepID: "fi.mau.meta.cookies",
Instructions: "Please enter cookies from your browser",
CookiesParams: &bridgev2.LoginCookiesParams{

},
Type: bridgev2.LoginStepTypeCookies,
StepID: "fi.mau.meta.cookies",
Instructions: "Please enter cookies from your browser",
CookiesParams: &bridgev2.LoginCookiesParams{},
}, nil
}

Expand All @@ -46,4 +44,4 @@ func (p *CookieLogin) SubmitCookies(ctx context.Context, cookies map[string]stri
StepID: "fi.mau.meta.complete",
Instructions: "Login successful",
}, nil
}
}

0 comments on commit e2fe053

Please sign in to comment.