Ignore ack and notification counts if notifications are blocked by the device (#27570)
* Ignore performance counts if notifications are blocked by the device * Change the endpoint to allow more information * Add tests and API description * Remove wrong test * Address feedback * Only update the cache when there is no error * Follow same casing as other props * use one single endpoint * Fix tests * Fix i18n --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b9debc75a0
Коммит
af503d9d45
@@ -1727,10 +1727,9 @@ func (c *Client4) RevokeSessionsFromAllUsers(ctx context.Context) (*Response, er
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
// AttachDeviceId attaches a mobile device ID to the current session.
|
||||
func (c *Client4) AttachDeviceId(ctx context.Context, deviceId string) (*Response, error) {
|
||||
requestBody := map[string]string{"device_id": deviceId}
|
||||
r, err := c.DoAPIPut(ctx, c.usersRoute()+"/sessions/device", MapToJSON(requestBody))
|
||||
// AttachDeviceProps attaches a mobile device ID to the current session and other props.
|
||||
func (c *Client4) AttachDeviceProps(ctx context.Context, newProps map[string]string) (*Response, error) {
|
||||
r, err := c.DoAPIPut(ctx, c.usersRoute()+"/sessions/device", MapToJSON(newProps))
|
||||
if err != nil {
|
||||
return BuildResponse(r), err
|
||||
}
|
||||
|
||||
@@ -12,26 +12,28 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
SessionCookieToken = "MMAUTHTOKEN"
|
||||
SessionCookieUser = "MMUSERID"
|
||||
SessionCookieCsrf = "MMCSRF"
|
||||
SessionCookieCloudUrl = "MMCLOUDURL"
|
||||
SessionCacheSize = 35000
|
||||
SessionPropPlatform = "platform"
|
||||
SessionPropOs = "os"
|
||||
SessionPropBrowser = "browser"
|
||||
SessionPropType = "type"
|
||||
SessionPropUserAccessTokenId = "user_access_token_id"
|
||||
SessionPropIsBot = "is_bot"
|
||||
SessionPropIsBotValue = "true"
|
||||
SessionPropOAuthAppID = "oauth_app_id"
|
||||
SessionPropMattermostAppID = "mattermost_app_id"
|
||||
SessionTypeUserAccessToken = "UserAccessToken"
|
||||
SessionTypeCloudKey = "CloudKey"
|
||||
SessionTypeRemoteclusterToken = "RemoteClusterToken"
|
||||
SessionPropIsGuest = "is_guest"
|
||||
SessionActivityTimeout = 1000 * 60 * 5 // 5 minutes
|
||||
SessionUserAccessTokenExpiryHours = 100 * 365 * 24 // 100 years
|
||||
SessionCookieToken = "MMAUTHTOKEN"
|
||||
SessionCookieUser = "MMUSERID"
|
||||
SessionCookieCsrf = "MMCSRF"
|
||||
SessionCookieCloudUrl = "MMCLOUDURL"
|
||||
SessionCacheSize = 35000
|
||||
SessionPropPlatform = "platform"
|
||||
SessionPropOs = "os"
|
||||
SessionPropBrowser = "browser"
|
||||
SessionPropType = "type"
|
||||
SessionPropUserAccessTokenId = "user_access_token_id"
|
||||
SessionPropIsBot = "is_bot"
|
||||
SessionPropIsBotValue = "true"
|
||||
SessionPropOAuthAppID = "oauth_app_id"
|
||||
SessionPropMattermostAppID = "mattermost_app_id"
|
||||
SessionPropDeviceNotificationDisabled = "device_notification_disabled"
|
||||
SessionPropMobileVersion = "mobile_version"
|
||||
SessionTypeUserAccessToken = "UserAccessToken"
|
||||
SessionTypeCloudKey = "CloudKey"
|
||||
SessionTypeRemoteclusterToken = "RemoteClusterToken"
|
||||
SessionPropIsGuest = "is_guest"
|
||||
SessionActivityTimeout = 1000 * 60 * 5 // 5 minutes
|
||||
SessionUserAccessTokenExpiryHours = 100 * 365 * 24 // 100 years
|
||||
)
|
||||
|
||||
//msgp:tuple StringMap
|
||||
|
||||
Ссылка в новой задаче
Block a user