Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FinClip
ligase
提交
139fae98
ligase
项目概览
FinClip
/
ligase
通知
33
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ligase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
139fae98
编写于
11月 15, 2017
作者:
E
Erik Johnston
提交者:
Richard van der Hoff
11月 15, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix linting errors in go1.9.1 (#336)
Fix linting errors in go1.9.1
上级
ff8b2291
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
21 addition
and
65 deletion
+21
-65
src/github.com/matrix-org/dendrite/clientapi/consumers/roomserver.go
...com/matrix-org/dendrite/clientapi/consumers/roomserver.go
+1
-5
src/github.com/matrix-org/dendrite/clientapi/threepid/invites.go
...hub.com/matrix-org/dendrite/clientapi/threepid/invites.go
+1
-5
src/github.com/matrix-org/dendrite/common/test/config.go
src/github.com/matrix-org/dendrite/common/test/config.go
+1
-4
src/github.com/matrix-org/dendrite/federationapi/routing/profile.go
....com/matrix-org/dendrite/federationapi/routing/profile.go
+4
-4
src/github.com/matrix-org/dendrite/federationapi/routing/send.go
...hub.com/matrix-org/dendrite/federationapi/routing/send.go
+2
-9
src/github.com/matrix-org/dendrite/federationsender/storage/storage.go
...m/matrix-org/dendrite/federationsender/storage/storage.go
+1
-5
src/github.com/matrix-org/dendrite/mediaapi/routing/upload.go
...github.com/matrix-org/dendrite/mediaapi/routing/upload.go
+3
-7
src/github.com/matrix-org/dendrite/mediaapi/storage/sql.go
src/github.com/matrix-org/dendrite/mediaapi/storage/sql.go
+4
-6
src/github.com/matrix-org/dendrite/roomserver/alias/alias.go
src/github.com/matrix-org/dendrite/roomserver/alias/alias.go
+2
-10
src/github.com/matrix-org/dendrite/roomserver/input/events.go
...github.com/matrix-org/dendrite/roomserver/input/events.go
+1
-5
src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go
...com/matrix-org/dendrite/roomserver/input/latest_events.go
+1
-5
未找到文件。
src/github.com/matrix-org/dendrite/clientapi/consumers/roomserver.go
浏览文件 @
139fae98
...
@@ -96,11 +96,7 @@ func (s *OutputRoomEventConsumer) onMessage(msg *sarama.ConsumerMessage) error {
...
@@ -96,11 +96,7 @@ func (s *OutputRoomEventConsumer) onMessage(msg *sarama.ConsumerMessage) error {
return
err
return
err
}
}
if
err
:=
s
.
db
.
UpdateMemberships
(
context
.
TODO
(),
events
,
output
.
NewRoomEvent
.
RemovesStateEventIDs
);
err
!=
nil
{
return
s
.
db
.
UpdateMemberships
(
context
.
TODO
(),
events
,
output
.
NewRoomEvent
.
RemovesStateEventIDs
)
return
err
}
return
nil
}
}
// lookupStateEvents looks up the state events that are added by a new event.
// lookupStateEvents looks up the state events that are added by a new event.
...
...
src/github.com/matrix-org/dendrite/clientapi/threepid/invites.go
浏览文件 @
139fae98
...
@@ -355,9 +355,5 @@ func emit3PIDInviteEvent(
...
@@ -355,9 +355,5 @@ func emit3PIDInviteEvent(
return
err
return
err
}
}
if
err
:=
producer
.
SendEvents
(
ctx
,
[]
gomatrixserverlib
.
Event
{
*
event
},
cfg
.
Matrix
.
ServerName
);
err
!=
nil
{
return
producer
.
SendEvents
(
ctx
,
[]
gomatrixserverlib
.
Event
{
*
event
},
cfg
.
Matrix
.
ServerName
)
return
err
}
return
nil
}
}
src/github.com/matrix-org/dendrite/common/test/config.go
浏览文件 @
139fae98
...
@@ -113,10 +113,7 @@ func WriteConfig(cfg *config.Dendrite, configDir string) error {
...
@@ -113,10 +113,7 @@ func WriteConfig(cfg *config.Dendrite, configDir string) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
if
err
=
ioutil
.
WriteFile
(
filepath
.
Join
(
configDir
,
ConfigFile
),
data
,
0666
);
err
!=
nil
{
return
ioutil
.
WriteFile
(
filepath
.
Join
(
configDir
,
ConfigFile
),
data
,
0666
)
return
err
}
return
nil
}
}
// NewMatrixKey generates a new ed25519 matrix server key and writes it to a file.
// NewMatrixKey generates a new ed25519 matrix server key and writes it to a file.
...
...
src/github.com/matrix-org/dendrite/federationapi/routing/profile.go
浏览文件 @
139fae98
...
@@ -63,11 +63,11 @@ func GetProfile(
...
@@ -63,11 +63,11 @@ func GetProfile(
switch
field
{
switch
field
{
case
"displayname"
:
case
"displayname"
:
res
=
common
.
DisplayName
{
res
=
common
.
DisplayName
{
profile
.
DisplayName
,
DisplayName
:
profile
.
DisplayName
,
}
}
case
"avatar_url"
:
case
"avatar_url"
:
res
=
common
.
AvatarURL
{
res
=
common
.
AvatarURL
{
profile
.
AvatarURL
,
AvatarURL
:
profile
.
AvatarURL
,
}
}
default
:
default
:
code
=
400
code
=
400
...
@@ -75,8 +75,8 @@ func GetProfile(
...
@@ -75,8 +75,8 @@ func GetProfile(
}
}
}
else
{
}
else
{
res
=
common
.
ProfileResponse
{
res
=
common
.
ProfileResponse
{
profile
.
AvatarURL
,
AvatarURL
:
profile
.
AvatarURL
,
profile
.
DisplayName
,
DisplayName
:
profile
.
DisplayName
,
}
}
}
}
...
...
src/github.com/matrix-org/dendrite/federationapi/routing/send.go
浏览文件 @
139fae98
...
@@ -170,11 +170,7 @@ func (t *txnReq) processEvent(e gomatrixserverlib.Event) error {
...
@@ -170,11 +170,7 @@ func (t *txnReq) processEvent(e gomatrixserverlib.Event) error {
// TODO: Check that the event is allowed by its auth_events.
// TODO: Check that the event is allowed by its auth_events.
// pass the event to the roomserver
// pass the event to the roomserver
if
err
:=
t
.
producer
.
SendEvents
(
t
.
context
,
[]
gomatrixserverlib
.
Event
{
e
},
api
.
DoNotSendToOtherServers
);
err
!=
nil
{
return
t
.
producer
.
SendEvents
(
t
.
context
,
[]
gomatrixserverlib
.
Event
{
e
},
api
.
DoNotSendToOtherServers
)
return
err
}
return
nil
}
}
func
checkAllowedByState
(
e
gomatrixserverlib
.
Event
,
stateEvents
[]
gomatrixserverlib
.
Event
)
error
{
func
checkAllowedByState
(
e
gomatrixserverlib
.
Event
,
stateEvents
[]
gomatrixserverlib
.
Event
)
error
{
...
@@ -218,8 +214,5 @@ func (t *txnReq) processEventWithMissingState(e gomatrixserverlib.Event) error {
...
@@ -218,8 +214,5 @@ func (t *txnReq) processEventWithMissingState(e gomatrixserverlib.Event) error {
return
err
return
err
}
}
// pass the event along with the state to the roomserver
// pass the event along with the state to the roomserver
if
err
:=
t
.
producer
.
SendEventWithState
(
t
.
context
,
state
,
e
);
err
!=
nil
{
return
t
.
producer
.
SendEventWithState
(
t
.
context
,
state
,
e
)
return
err
}
return
nil
}
}
src/github.com/matrix-org/dendrite/federationsender/storage/storage.go
浏览文件 @
139fae98
...
@@ -54,11 +54,7 @@ func (d *Database) prepare() error {
...
@@ -54,11 +54,7 @@ func (d *Database) prepare() error {
return
err
return
err
}
}
if
err
=
d
.
PartitionOffsetStatements
.
Prepare
(
d
.
db
,
"federationsender"
);
err
!=
nil
{
return
d
.
PartitionOffsetStatements
.
Prepare
(
d
.
db
,
"federationsender"
)
return
err
}
return
nil
}
}
// UpdateRoom updates the joined hosts for a room and returns what the joined
// UpdateRoom updates the joined hosts for a room and returns what the joined
...
...
src/github.com/matrix-org/dendrite/mediaapi/routing/upload.go
浏览文件 @
139fae98
...
@@ -22,7 +22,6 @@ import (
...
@@ -22,7 +22,6 @@ import (
"net/url"
"net/url"
"path"
"path"
log
"github.com/sirupsen/logrus"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/common/config"
"github.com/matrix-org/dendrite/common/config"
"github.com/matrix-org/dendrite/mediaapi/fileutils"
"github.com/matrix-org/dendrite/mediaapi/fileutils"
...
@@ -31,6 +30,7 @@ import (
...
@@ -31,6 +30,7 @@ import (
"github.com/matrix-org/dendrite/mediaapi/types"
"github.com/matrix-org/dendrite/mediaapi/types"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/util"
"github.com/matrix-org/util"
log
"github.com/sirupsen/logrus"
)
)
// uploadRequest metadata included in or derivable from an upload request
// uploadRequest metadata included in or derivable from an upload request
...
@@ -161,14 +161,10 @@ func (r *uploadRequest) doUpload(
...
@@ -161,14 +161,10 @@ func (r *uploadRequest) doUpload(
}
}
}
}
if
resErr
:=
r
.
storeFileAndMetadata
(
return
r
.
storeFileAndMetadata
(
ctx
,
tmpDir
,
cfg
.
Media
.
AbsBasePath
,
db
,
cfg
.
Media
.
ThumbnailSizes
,
ctx
,
tmpDir
,
cfg
.
Media
.
AbsBasePath
,
db
,
cfg
.
Media
.
ThumbnailSizes
,
activeThumbnailGeneration
,
cfg
.
Media
.
MaxThumbnailGenerators
,
activeThumbnailGeneration
,
cfg
.
Media
.
MaxThumbnailGenerators
,
);
resErr
!=
nil
{
)
return
resErr
}
return
nil
}
}
// Validate validates the uploadRequest fields
// Validate validates the uploadRequest fields
...
...
src/github.com/matrix-org/dendrite/mediaapi/storage/sql.go
浏览文件 @
139fae98
...
@@ -23,15 +23,13 @@ type statements struct {
...
@@ -23,15 +23,13 @@ type statements struct {
thumbnail
thumbnailStatements
thumbnail
thumbnailStatements
}
}
func
(
s
*
statements
)
prepare
(
db
*
sql
.
DB
)
error
{
func
(
s
*
statements
)
prepare
(
db
*
sql
.
DB
)
(
err
error
)
{
var
err
error
if
err
=
s
.
media
.
prepare
(
db
);
err
!=
nil
{
if
err
=
s
.
media
.
prepare
(
db
);
err
!=
nil
{
return
err
return
}
}
if
err
=
s
.
thumbnail
.
prepare
(
db
);
err
!=
nil
{
if
err
=
s
.
thumbnail
.
prepare
(
db
);
err
!=
nil
{
return
err
return
}
}
return
nil
return
}
}
src/github.com/matrix-org/dendrite/roomserver/alias/alias.go
浏览文件 @
139fae98
...
@@ -79,11 +79,7 @@ func (r *RoomserverAliasAPI) SetRoomAlias(
...
@@ -79,11 +79,7 @@ func (r *RoomserverAliasAPI) SetRoomAlias(
// At this point we've already committed the alias to the database so we
// At this point we've already committed the alias to the database so we
// shouldn't cancel this request.
// shouldn't cancel this request.
// TODO: Ensure that we send unsent events when if server restarts.
// TODO: Ensure that we send unsent events when if server restarts.
if
err
:=
r
.
sendUpdatedAliasesEvent
(
context
.
TODO
(),
request
.
UserID
,
request
.
RoomID
);
err
!=
nil
{
return
r
.
sendUpdatedAliasesEvent
(
context
.
TODO
(),
request
.
UserID
,
request
.
RoomID
)
return
err
}
return
nil
}
}
// GetAliasRoomID implements api.RoomserverAliasAPI
// GetAliasRoomID implements api.RoomserverAliasAPI
...
@@ -123,11 +119,7 @@ func (r *RoomserverAliasAPI) RemoveRoomAlias(
...
@@ -123,11 +119,7 @@ func (r *RoomserverAliasAPI) RemoveRoomAlias(
// At this point we've already committed the alias to the database so we
// At this point we've already committed the alias to the database so we
// shouldn't cancel this request.
// shouldn't cancel this request.
// TODO: Ensure that we send unsent events when if server restarts.
// TODO: Ensure that we send unsent events when if server restarts.
if
err
:=
r
.
sendUpdatedAliasesEvent
(
context
.
TODO
(),
request
.
UserID
,
roomID
);
err
!=
nil
{
return
r
.
sendUpdatedAliasesEvent
(
context
.
TODO
(),
request
.
UserID
,
roomID
)
return
err
}
return
nil
}
}
type
roomAliasesContent
struct
{
type
roomAliasesContent
struct
{
...
...
src/github.com/matrix-org/dendrite/roomserver/input/events.go
浏览文件 @
139fae98
...
@@ -129,11 +129,7 @@ func processRoomEvent(
...
@@ -129,11 +129,7 @@ func processRoomEvent(
}
}
// Update the extremities of the event graph for the room
// Update the extremities of the event graph for the room
if
err
:=
updateLatestEvents
(
ctx
,
db
,
ow
,
roomNID
,
stateAtEvent
,
event
,
input
.
SendAsServer
);
err
!=
nil
{
return
updateLatestEvents
(
ctx
,
db
,
ow
,
roomNID
,
stateAtEvent
,
event
,
input
.
SendAsServer
)
return
err
}
return
nil
}
}
func
processInviteEvent
(
func
processInviteEvent
(
...
...
src/github.com/matrix-org/dendrite/roomserver/input/latest_events.go
浏览文件 @
139fae98
...
@@ -162,11 +162,7 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
...
@@ -162,11 +162,7 @@ func (u *latestEventsUpdater) doUpdateLatestEvents() error {
return
err
return
err
}
}
if
err
=
u
.
updater
.
MarkEventAsSent
(
u
.
stateAtEvent
.
EventNID
);
err
!=
nil
{
return
u
.
updater
.
MarkEventAsSent
(
u
.
stateAtEvent
.
EventNID
)
return
err
}
return
nil
}
}
func
(
u
*
latestEventsUpdater
)
latestState
()
error
{
func
(
u
*
latestEventsUpdater
)
latestState
()
error
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录