forked from Ivasoft/mattermost-mobile
Compare commits
6 Commits
v1.16.0
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bff06f3ab2 | ||
|
|
b942d24cdc | ||
|
|
d65e1b3b5d | ||
|
|
753a1b52ce | ||
|
|
4e83c1f944 | ||
|
|
50082e327b |
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ export default class MarkdownLink extends PureComponent {
|
||||
|
||||
static defaultProps = {
|
||||
onPermalinkPress: () => true,
|
||||
serverURL: '',
|
||||
siteURL: '',
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
|
||||
@@ -184,7 +184,7 @@ export default class PostBodyAdditionalContent extends PureComponent {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
if (!openGraphData) {
|
||||
if (!openGraphData && metadata) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ export default class PostListBase extends PureComponent {
|
||||
onLoadMoreUp: () => true,
|
||||
renderFooter: () => null,
|
||||
refreshing: false,
|
||||
serverURL: '',
|
||||
siteURL: '',
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
|
||||
@@ -44,7 +44,7 @@ export default class Reactions extends PureComponent {
|
||||
|
||||
componentDidMount() {
|
||||
const {actions, postId, reactions} = this.props;
|
||||
if (reactions) {
|
||||
if (!reactions) {
|
||||
actions.getReactionsForPost(postId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user