MM-42810: Using websocket broadcast hook for permalink preview (#28627)
We use the newly introduced websocket broadcast hook system to implement permalink preview efficiently. This is essentially a re-do of https://github.com/mattermost/mattermost/pull/23812 using the new system. https://mattermost.atlassian.net/browse/MM-42810 ```release-note NONE ``` --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6939623e11
Коммит
64677dd554
@@ -57,6 +57,9 @@ func (ms *mockSuite) RolesGrantPermission(roleNames []string, permissionId strin
|
||||
func (ms *mockSuite) UserCanSeeOtherUser(c request.CTX, userID string, otherUserId string) (bool, *model.AppError) {
|
||||
return true, nil
|
||||
}
|
||||
func (ms *mockSuite) HasPermissionToReadChannel(c request.CTX, userID string, channel *model.Channel) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func Setup(tb testing.TB, options ...Option) *TestHelper {
|
||||
if testing.Short() {
|
||||
|
||||
@@ -48,6 +48,24 @@ func (_m *SuiteIFace) GetSession(token string) (*model.Session, *model.AppError)
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// HasPermissionToReadChannel provides a mock function with given fields: c, userID, channel
|
||||
func (_m *SuiteIFace) HasPermissionToReadChannel(c request.CTX, userID string, channel *model.Channel) bool {
|
||||
ret := _m.Called(c, userID, channel)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for HasPermissionToReadChannel")
|
||||
}
|
||||
|
||||
var r0 bool
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, *model.Channel) bool); ok {
|
||||
r0 = rf(c, userID, channel)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// RolesGrantPermission provides a mock function with given fields: roleNames, permissionId
|
||||
func (_m *SuiteIFace) RolesGrantPermission(roleNames []string, permissionId string) bool {
|
||||
ret := _m.Called(roleNames, permissionId)
|
||||
|
||||
@@ -24,6 +24,7 @@ const (
|
||||
type SuiteIFace interface {
|
||||
GetSession(token string) (*model.Session, *model.AppError)
|
||||
RolesGrantPermission(roleNames []string, permissionId string) bool
|
||||
HasPermissionToReadChannel(c request.CTX, userID string, channel *model.Channel) bool
|
||||
UserCanSeeOtherUser(c request.CTX, userID string, otherUserId string) (bool, *model.AppError)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user