Merge branch 'release-1.6'

This commit is contained in:
Elias Nahum 2018-01-26 19:29:15 -03:00
commit cd1a125a4e
No known key found for this signature in database
GPG key ID: E038DB71E0B61702
10 changed files with 42 additions and 68 deletions

View file

@ -106,7 +106,7 @@ android {
applicationId "com.mattermost.rnbeta"
minSdkVersion 21
targetSdkVersion 23
versionCode 80
versionCode 81
versionName "1.6.0"
multiDexEnabled true
ndk {

View file

@ -78,7 +78,7 @@ public class MainApplication extends NavigationApplication implements INotificat
@Override
public String getJSMainModuleName() {
return "index.android";
return "index";
}
@Override

View file

@ -1,11 +0,0 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {AppRegistry} from 'react-native';
/* eslint-disable no-unused-vars */
import Mattermost from 'app/mattermost';
import ShareExtension from 'share_extension/android';
AppRegistry.registerComponent('MattermostShare', () => ShareExtension);
const app = new Mattermost();

View file

@ -2,6 +2,13 @@
// See License.txt for license information.
/* eslint-disable no-unused-vars */
import {AppRegistry, Platform} from 'react-native';
import Mattermost from 'app/mattermost';
import ShareExtension from 'share_extension/android';
if (Platform.OS === 'android') {
AppRegistry.registerComponent('MattermostShare', () => ShareExtension);
}
const app = new Mattermost();

View file

@ -2400,7 +2400,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 80;
CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
@ -2449,7 +2449,7 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 80;
CURRENT_PROJECT_VERSION = 81;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;

View file

@ -36,36 +36,6 @@
return YES;
}
-(void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(nonnull NSString *)identifier completionHandler:(nonnull void (^)(void))completionHandler {
NSUserDefaults *bucket = [[NSUserDefaults alloc] initWithSuiteName: @"group.com.mattermost"];
NSString *credentialsString = [bucket objectForKey:@"credentials"];
NSData *credentialsData = [credentialsString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *credentials = [NSJSONSerialization JSONObjectWithData:credentialsData options:NSJSONReadingMutableContainers error:nil];
NSString *server = [credentials objectForKey:@"url"];
NSString *token = [credentials objectForKey:@"token"];
NSDictionary *post = [NSDictionary dictionaryWithObjectsAndKeys:@"user_id", [bucket objectForKey:@"currentUserId"], @"message", @"Shit fuck", @"channel_id", @"zw43c5ttrjyu9dg7jnudwuz6bw"];
NSData *postData = [NSJSONSerialization dataWithJSONObject:post options:NSJSONWritingPrettyPrinted error:nil];
NSString* postAsString = [[NSString alloc] initWithData:postData encoding:NSUTF8StringEncoding];
NSURL *createUrl = [NSURL URLWithString:[server stringByAppendingString:@"/api/v4/posts"]];
NSURLSessionConfiguration* config = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"backgroundSession-post"];
config.sharedContainerIdentifier = @"group.com.mattermost";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:createUrl cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:5.0];
[request setHTTPMethod:@"POST"];
[request setValue:[@"Bearer " stringByAppendingString:token] forHTTPHeaderField:@"Authorization"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[postAsString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLSession *createSession = [NSURLSession sessionWithConfiguration:config];
NSURLSessionDataTask *createTask = [createSession dataTaskWithRequest:request];
[createTask resume];
completionHandler();
}
// Required for orientation
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [Orientation getOrientation];

View file

@ -34,7 +34,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>80</string>
<string>81</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View file

@ -23,7 +23,7 @@
<key>CFBundleShortVersionString</key>
<string>1.6.0</string>
<key>CFBundleVersion</key>
<string>80</string>
<string>81</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View file

@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>80</string>
<string>81</string>
</dict>
</plist>

View file

@ -87,24 +87,29 @@ export default class ExtensionPost extends PureComponent {
</View>
</TouchableItem>
);
const headerRight = (
<TouchableItem
accessibilityComponentType='button'
accessibilityTraits='button'
borderless={true}
delayPressIn={0}
pressColorAndroid='rgba(0, 0, 0, .32)'
onPress={params.post ? params.post : emptyFunction}
>
<View style={styles.left}>
<PaperPlane
color={defalultTheme.sidebarHeaderTextColor}
height={20}
width={20}
/>
</View>
</TouchableItem>
);
let headerRight = null;
if (params.post) {
headerRight = (
<TouchableItem
accessibilityComponentType='button'
accessibilityTraits='button'
borderless={true}
delayPressIn={0}
pressColorAndroid='rgba(0, 0, 0, .32)'
onPress={params.post}
>
<View style={styles.left}>
<PaperPlane
color={defalultTheme.sidebarHeaderTextColor}
height={20}
width={20}
/>
</View>
</TouchableItem>
);
}
return {headerLeft, headerRight, title};
};
@ -130,8 +135,7 @@ export default class ExtensionPost extends PureComponent {
componentDidMount() {
this.props.navigation.setParams({
close: this.onClose,
post: this.onPost
close: this.onClose
});
this.auth();
}
@ -258,6 +262,10 @@ export default class ExtensionPost extends PureComponent {
const text = [];
const files = [];
this.props.navigation.setParams({
post: this.onPost
});
for (let i = 0; i < items.length; i++) {
const item = items[i];
switch (item.type) {