File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,7 @@ func (lc *LineConnector) Init(bridge *bridgev2.Bridge) {
4141 lc .br = bridge
4242}
4343
44- func (lc * LineConnector ) Start (ctx context.Context ) error {
45- _ , ok := lc .br .Matrix .(bridgev2.MatrixConnectorWithServer )
46- if ! ok {
47- return fmt .Errorf ("matrix connector does not implement MatrixConnectorWithServer" )
48- }
44+ func (lc * LineConnector ) Start (context.Context ) error {
4945 return nil
5046}
5147
@@ -88,7 +84,7 @@ func (lc *LineConnector) GetName() bridgev2.BridgeName {
8884 NetworkURL : "https://line.me" ,
8985 NetworkIcon : "" ,
9086 NetworkID : "line" ,
91- BeeperBridgeType : "github.com/highesttt/matrix- line-messenger " ,
87+ BeeperBridgeType : "line" ,
9288 DefaultPort : 29322 ,
9389 }
9490}
Original file line number Diff line number Diff line change @@ -87,6 +87,31 @@ func TestInitDisablesManagementRoomBridgeStatusNotices(t *testing.T) {
8787 }
8888}
8989
90+ func TestStartSupportsMatrixConnectorWithoutServer (t * testing.T ) {
91+ matrix := & bridgeStateTestMatrix {}
92+ if _ , ok := any (matrix ).(bridgev2.MatrixConnectorWithServer ); ok {
93+ t .Fatal ("test Matrix connector unexpectedly implements MatrixConnectorWithServer" )
94+ }
95+
96+ bridge := & bridgev2.Bridge {
97+ Config : & bridgeconfig.BridgeConfig {},
98+ Matrix : matrix ,
99+ }
100+ connector := & LineConnector {}
101+ connector .Init (bridge )
102+
103+ if err := connector .Start (context .Background ()); err != nil {
104+ t .Fatalf ("Start rejected a Matrix connector without a server: %v" , err )
105+ }
106+ }
107+
108+ func TestGetNameUsesCanonicalBeeperBridgeType (t * testing.T ) {
109+ name := (& LineConnector {}).GetName ()
110+ if name .BeeperBridgeType != "line" {
111+ t .Fatalf ("BeeperBridgeType = %q, want line" , name .BeeperBridgeType )
112+ }
113+ }
114+
90115func TestBridgeStateUpdatesDoNotUseManagementRoom (t * testing.T ) {
91116 tests := map [string ]id.RoomID {
92117 "room must not be created" : "" ,
You can’t perform that action at this time.
0 commit comments