Skip to content

Commit

Permalink
Hotfix for release-1.5 (#1405)
Browse files Browse the repository at this point in the history
* Request data retention policies only when the user is logged in (#1351)

* Bump App version to 1.5.3

* Bump app build version to 83
  • Loading branch information
enahum authored Feb 1, 2018
1 parent 6b8c361 commit 768d843
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
applicationId "com.mattermost.rnbeta"
minSdkVersion 21
targetSdkVersion 23
versionCode 77
versionName "1.5.2"
versionCode 83
versionName "1.5.3"
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
Expand Down
11 changes: 11 additions & 0 deletions app/actions/views/login.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import {getDataRetentionPolicy} from 'mattermost-redux/actions/general';
import {GeneralTypes} from 'mattermost-redux/action_types';
import {Client, Client4} from 'mattermost-redux/client';

Expand All @@ -25,8 +27,10 @@ export function handlePasswordChanged(password) {

export function handleSuccessfulLogin() {
return async (dispatch, getState) => {
const {config, license} = getState().entities.general;
const token = Client4.getToken();
const url = Client4.getUrl();

dispatch({
type: GeneralTypes.RECEIVED_APP_CREDENTIALS,
data: {
Expand All @@ -38,6 +42,13 @@ export function handleSuccessfulLogin() {
Client.setToken(token);
Client.setUrl(url);

if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
license.IsLicensed === 'true' && license.DataRetention === 'true') {
getDataRetentionPolicy()(dispatch, getState);
} else {
dispatch({type: GeneralTypes.RECEIVED_DATA_RETENTION_POLICY, data: {}});
}

return true;
};
}
Expand Down
13 changes: 8 additions & 5 deletions app/actions/views/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {

export function loadConfigAndLicense() {
return async (dispatch, getState) => {
const {currentUserId} = getState().entities.users;
const [configData, licenseData] = await Promise.all([
getClientConfig()(dispatch, getState),
getLicenseConfig()(dispatch, getState)
Expand All @@ -27,11 +28,13 @@ export function loadConfigAndLicense() {
const config = configData.data || {};
const license = licenseData.data || {};

if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
license.IsLicensed === 'true' && license.DataRetention === 'true') {
getDataRetentionPolicy()(dispatch, getState);
} else {
dispatch({type: GeneralTypes.RECEIVED_DATA_RETENTION_POLICY, data: {}});
if (currentUserId) {
if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
license.IsLicensed === 'true' && license.DataRetention === 'true') {
getDataRetentionPolicy()(dispatch, getState);
} else {
dispatch({type: GeneralTypes.RECEIVED_DATA_RETENTION_POLICY, data: {}});
}
}

return {config, license};
Expand Down
4 changes: 2 additions & 2 deletions ios/Mattermost.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 77;
CURRENT_PROJECT_VERSION = 83;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2206,7 +2206,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 77;
CURRENT_PROJECT_VERSION = 83;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
Expand Down
4 changes: 2 additions & 2 deletions ios/Mattermost/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.2</string>
<string>1.5.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>77</string>
<string>83</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/MattermostTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.2</string>
<string>1.5.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>77</string>
<string>83</string>
</dict>
</plist>

0 comments on commit 768d843

Please sign in to comment.