Compare commits

...

6 Commits

Author SHA1 Message Date
Elias Nahum
bff06f3ab2 Bump app build number to 179 (#2632) 2019-03-05 14:04:47 -03:00
Elias Nahum
b942d24cdc Bump app version number to 1.16.2 (#2631) 2019-03-05 13:59:23 -03:00
Saturnino Abril
d65e1b3b5d fix intermittent crash when selecting a link (#2620) (#2622) 2019-03-05 08:56:52 +08:00
Elias Nahum
753a1b52ce Bump app Version to 1.16.1 and Build Number to 176 (#2584)
* Bump app build number to 176

* Bump app version number to 1.16.1

* Update fastlane
2019-02-20 16:56:34 -03:00
Elias Nahum
4e83c1f944 Prevent the app from crashing when file mime type is null (#2582) 2019-02-20 16:48:55 -03:00
Elias Nahum
50082e327b Fix opengraph and reactions for older servers (#2581) 2019-02-19 19:05:50 -03:00
14 changed files with 71 additions and 27 deletions

View File

@@ -113,8 +113,8 @@ android {
applicationId "com.mattermost.rnbeta"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 175
versionName "1.16.0"
versionCode 179
versionName "1.16.2"
multiDexEnabled = true
ndk {
abiFilters "armeabi-v7a", "x86"

View File

@@ -205,8 +205,12 @@ public class RealPathUtil {
}
public static String getMimeTypeFromUri(final Context context, final Uri uri) {
ContentResolver cR = context.getContentResolver();
return cR.getType(uri);
try {
ContentResolver cR = context.getContentResolver();
return cR.getType(uri);
} catch (Exception e) {
return "application/octet-stream";
}
}
public static void deleteTempFiles(final File dir) {

View File

@@ -165,12 +165,15 @@ public class ShareModule extends ReactContextBaseJavaModule {
map.putString("value", text);
type = RealPathUtil.getMimeTypeFromUri(currentActivity, uri);
if (type.equals("image/*")) {
type = "image/jpeg";
} else if (type.equals("video/*")) {
type = "video/mp4";
if (type != null) {
if (type.equals("image/*")) {
type = "image/jpeg";
} else if (type.equals("video/*")) {
type = "video/mp4";
}
} else {
type = "application/octet-stream";
}
map.putString("type", type);
items.pushMap(map);
}

View File

@@ -26,6 +26,8 @@ export default class MarkdownLink extends PureComponent {
static defaultProps = {
onPermalinkPress: () => true,
serverURL: '',
siteURL: '',
};
static contextTypes = {

View File

@@ -184,7 +184,7 @@ export default class PostBodyAdditionalContent extends PureComponent {
return attachments;
}
if (!openGraphData) {
if (!openGraphData && metadata) {
return null;
}

View File

@@ -50,6 +50,8 @@ export default class PostListBase extends PureComponent {
onLoadMoreUp: () => true,
renderFooter: () => null,
refreshing: false,
serverURL: '',
siteURL: '',
};
componentWillMount() {

View File

@@ -44,7 +44,7 @@ export default class Reactions extends PureComponent {
componentDidMount() {
const {actions, postId, reactions} = this.props;
if (reactions) {
if (!reactions) {
actions.getReactionsForPost(postId);
}
}

View File

@@ -97,6 +97,10 @@ export function getScheme(url) {
}
export function matchPermalink(link, rootURL) {
if (!link || !rootURL) {
return null;
}
return new RegExp('^' + escapeRegex(rootURL) + '\\/([^\\/]+)\\/pl\\/(\\w+)').exec(link);
}

View File

@@ -1,6 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import assert from 'assert';
import * as UrlUtils from 'app/utils/url';
/* eslint-disable max-nested-callbacks */
@@ -86,4 +88,31 @@ describe('UrlUtils', () => {
expect(UrlUtils.stripTrailingSlashes(url)).toEqual(expected);
});
});
describe('matchPermalink', () => {
const ROOT_URL = 'http://localhost:8065';
const tests = [
{name: 'should return null if all inputs are empty', input: {link: '', rootURL: ''}, expected: null},
{name: 'should return null if any of the inputs is null', input: {link: '', rootURL: null}, expected: null},
{name: 'should return null if any of the inputs is null', input: {link: null, rootURL: ''}, expected: null},
{name: 'should return null for not supported link', input: {link: 'https://mattermost.com', rootURL: ROOT_URL}, expected: null},
{name: 'should match permalink', input: {link: ROOT_URL + '/ad-1/pl/qe93kkfd7783iqwuwfcwcxbsgy', rootURL: ROOT_URL}, expected: ['http://localhost:8065/ad-1/pl/qe93kkfd7783iqwuwfcwcxbsgy', 'ad-1', 'qe93kkfd7783iqwuwfcwcxbsgy']},
];
for (const test of tests) {
const {name, input, expected} = test;
it(name, () => {
const actual = UrlUtils.matchPermalink(input.link, input.rootURL);
if (actual) {
assert.equal(actual[0], expected[0]);
assert.equal(actual[1], expected[1]);
assert.equal(actual[2], expected[2]);
} else {
assert.equal(actual, expected);
}
});
}
});
});

View File

@@ -6,8 +6,8 @@ GEM
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.3)
aws-eventstream (1.0.1)
aws-partitions (1.136.0)
aws-sdk-core (3.46.0)
aws-partitions (1.139.0)
aws-sdk-core (3.46.2)
aws-eventstream (~> 1.0)
aws-partitions (~> 1.0)
aws-sigv4 (~> 1.0)
@@ -39,10 +39,10 @@ GEM
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.13.0)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.114.0)
fastlane (2.116.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
@@ -93,15 +93,15 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
google-cloud-core (1.2.7)
google-cloud-core (1.3.0)
google-cloud-env (~> 1.0)
google-cloud-env (1.0.5)
faraday (~> 0.11)
google-cloud-storage (1.15.0)
google-cloud-storage (1.16.0)
digest-crc (~> 0.4)
google-api-client (~> 0.23)
google-cloud-core (~> 1.2)
googleauth (~> 0.6.2)
googleauth (>= 0.6.2, < 0.10.0)
googleauth (0.6.7)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
@@ -162,7 +162,7 @@ GEM
unf_ext (0.0.7.5)
unicode-display_width (1.4.1)
word_wrap (1.0.0)
xcodeproj (1.8.0)
xcodeproj (1.8.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)

View File

@@ -2527,7 +2527,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 175;
CURRENT_PROJECT_VERSION = 179;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
@@ -2579,7 +2579,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 175;
CURRENT_PROJECT_VERSION = 179;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;

View File

@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.16.0</string>
<string>1.16.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>175</string>
<string>179</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@@ -21,9 +21,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.16.0</string>
<string>1.16.2</string>
<key>CFBundleVersion</key>
<string>175</string>
<string>179</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View File

@@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.16.0</string>
<string>1.16.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>175</string>
<string>179</string>
</dict>
</plist>