2015-11-20 13:12:37 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2015-11-26 15:47:24 +00:00
|
|
|
#import "RoomSettingsViewController.h"
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-12-15 12:14:37 +00:00
|
|
|
#import <Photos/Photos.h>
|
|
|
|
#import <MediaPlayer/MediaPlayer.h>
|
|
|
|
|
2015-11-20 13:12:37 +00:00
|
|
|
#import "TableViewCellWithLabelAndTextField.h"
|
|
|
|
#import "TableViewCellWithLabelAndLargeTextView.h"
|
2015-12-15 09:46:34 +00:00
|
|
|
#import "TableViewCellWithLabelAndMXKImageView.h"
|
2015-12-15 17:17:20 +00:00
|
|
|
#import "TableViewCellWithLabelAndSwitch.h"
|
2015-12-15 09:46:34 +00:00
|
|
|
|
2015-11-20 14:06:48 +00:00
|
|
|
#import "TableViewCellSeparator.h"
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-11-20 16:52:16 +00:00
|
|
|
#import "RageShakeManager.h"
|
|
|
|
|
2015-11-26 17:04:03 +00:00
|
|
|
#import "VectorDesignValues.h"
|
|
|
|
|
2015-12-15 09:46:34 +00:00
|
|
|
#import "AvatarGenerator.h"
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
#import "MXRoom+Vector.h"
|
|
|
|
|
2015-11-20 13:12:37 +00:00
|
|
|
#define ROOM_SECTION 0
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
#define ROOM_SECTION_PHOTO 0
|
|
|
|
#define ROOM_SECTION_NAME 1
|
|
|
|
#define ROOM_SECTION_TOPIC 2
|
2015-12-16 09:28:58 +00:00
|
|
|
#define ROOM_SECTION_PRIV_PUB 3
|
|
|
|
#define ROOM_SECTION_MUTE_NOTIFICATIONS 4
|
|
|
|
#define ROOM_SECTION_COUNT 5
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2016-04-19 13:28:15 +00:00
|
|
|
#define ROOM_TOPIC_CELL_HEIGHT 124
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-11-26 15:47:24 +00:00
|
|
|
@interface RoomSettingsViewController ()
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
|
|
|
// updated user data
|
2015-11-27 13:02:37 +00:00
|
|
|
NSMutableDictionary<NSString*, id> *updatedItemsDict;
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
// active items
|
2015-11-20 13:12:37 +00:00
|
|
|
UITextView* topicTextView;
|
|
|
|
UITextField* nameTextField;
|
2015-11-20 16:07:45 +00:00
|
|
|
|
|
|
|
// pending http operation
|
|
|
|
MXHTTPOperation* pendingOperation;
|
2015-11-27 14:16:16 +00:00
|
|
|
|
|
|
|
// the updating spinner
|
|
|
|
UIActivityIndicatorView* updatingSpinner;
|
|
|
|
|
|
|
|
MXKAlert *currentAlert;
|
2015-12-15 12:14:37 +00:00
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
// listen to more events than the mother class
|
|
|
|
id extraEventsListener;
|
|
|
|
|
2015-12-15 12:14:37 +00:00
|
|
|
// picker
|
|
|
|
MediaPickerViewController* mediaPicker;
|
2015-12-15 17:17:20 +00:00
|
|
|
|
|
|
|
// switches
|
|
|
|
UISwitch *roomNotifSwitch;
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
2015-11-26 15:47:24 +00:00
|
|
|
@implementation RoomSettingsViewController
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
- (UINavigationItem*) getNavigationItem
|
2015-11-26 17:23:50 +00:00
|
|
|
{
|
|
|
|
// this viewController can be displayed
|
|
|
|
// 1- with a "standard" push mode
|
|
|
|
// 2- within a segmentedViewController i.e. inside another viewcontroller
|
|
|
|
// so, we need to use the parent controller when it is required.
|
|
|
|
UIViewController* topViewController = (self.parentViewController) ? self.parentViewController : self;
|
2015-11-27 13:02:37 +00:00
|
|
|
|
|
|
|
return topViewController.navigationItem;
|
|
|
|
}
|
|
|
|
|
2015-12-02 07:32:39 +00:00
|
|
|
- (void)setNavBarButtons
|
2015-11-27 13:02:37 +00:00
|
|
|
{
|
|
|
|
[self getNavigationItem].rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(onSave:)];
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = ([self getUpdatedItemsDict].count != 0);
|
|
|
|
[self getNavigationItem].leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)];
|
2015-11-26 17:23:50 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 13:12:37 +00:00
|
|
|
- (void)viewDidLoad
|
|
|
|
{
|
|
|
|
[super viewDidLoad];
|
|
|
|
|
2016-02-10 21:12:17 +00:00
|
|
|
// Setup `MXKViewControllerHandling` properties
|
|
|
|
self.defaultBarTintColor = kVectorNavBarTintColor;
|
|
|
|
self.enableBarTintColorStatusChange = NO;
|
|
|
|
self.rageShakeManager = [RageShakeManager sharedManager];
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
// TODO use a color panel
|
|
|
|
// not an hard coded one.
|
2015-11-20 13:12:37 +00:00
|
|
|
CGFloat item = (242.0f / 255.0);
|
|
|
|
|
|
|
|
self.tableView.backgroundColor = [UIColor colorWithRed:item green:item blue:item alpha:item];
|
|
|
|
self.tableView.separatorColor = [UIColor clearColor];
|
2015-11-20 16:52:16 +00:00
|
|
|
|
2015-12-02 07:32:39 +00:00
|
|
|
[self setNavBarButtons];
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 16:42:29 +00:00
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
|
{
|
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didMXSessionStateChange:) name:kMXSessionStateDidChangeNotification object:nil];
|
2015-12-15 17:17:20 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateRules:) name:kMXNotificationCenterDidUpdateRules object:nil];
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didAccountUserInfoDidChange:) name:kMXKAccountUserInfoDidChangeNotification object:nil];
|
2015-11-20 16:42:29 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 14:20:15 +00:00
|
|
|
- (void)viewWillDisappear:(BOOL)animated
|
|
|
|
{
|
|
|
|
[super viewWillDisappear:animated];
|
|
|
|
|
|
|
|
[self dismissFirstResponder];
|
2015-11-20 16:42:29 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXSessionStateDidChangeNotification object:nil];
|
2015-12-15 17:17:20 +00:00
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXNotificationCenterDidUpdateRules object:nil];
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXKAccountUserInfoDidChangeNotification object:nil];
|
2015-11-20 14:20:15 +00:00
|
|
|
}
|
|
|
|
|
2015-11-27 08:59:51 +00:00
|
|
|
// this method is called when the viewcontroller is displayed inside another one.
|
|
|
|
- (void)didMoveToParentViewController:(nullable UIViewController *)parent
|
|
|
|
{
|
|
|
|
[super didMoveToParentViewController:parent];
|
2015-12-02 07:32:39 +00:00
|
|
|
[self setNavBarButtons];
|
2015-11-27 08:59:51 +00:00
|
|
|
}
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
- (void)destroy
|
|
|
|
{
|
|
|
|
self.navigationItem.rightBarButtonItem.enabled = NO;
|
|
|
|
|
|
|
|
if (pendingOperation)
|
|
|
|
{
|
|
|
|
[pendingOperation cancel];
|
|
|
|
pendingOperation = nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
[super destroy];
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - private
|
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
- (NSMutableDictionary*)getUpdatedItemsDict
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
if (!updatedItemsDict)
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
updatedItemsDict = [[NSMutableDictionary alloc] init];
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
return updatedItemsDict;
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
2015-11-20 14:20:15 +00:00
|
|
|
|
|
|
|
- (void)dismissFirstResponder
|
|
|
|
{
|
|
|
|
if ([topicTextView isFirstResponder])
|
|
|
|
{
|
|
|
|
[topicTextView resignFirstResponder];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ([nameTextField isFirstResponder])
|
|
|
|
{
|
|
|
|
[nameTextField resignFirstResponder];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
- (void)showUpdatingSpinner
|
|
|
|
{
|
2015-12-15 17:17:20 +00:00
|
|
|
if (!updatingSpinner)
|
|
|
|
{
|
|
|
|
self.tableView.userInteractionEnabled = NO;
|
|
|
|
|
|
|
|
// Add a spinner
|
|
|
|
updatingSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
|
|
|
|
updatingSpinner.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);
|
|
|
|
updatingSpinner.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1.0];
|
|
|
|
updatingSpinner.hidesWhenStopped = NO;
|
|
|
|
[updatingSpinner startAnimating];
|
|
|
|
updatingSpinner.center = self.view.center;
|
|
|
|
[self.view addSubview:updatingSpinner];
|
|
|
|
}
|
2015-11-20 16:07:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)hideUpdatingSpinner
|
|
|
|
{
|
2015-11-27 14:16:16 +00:00
|
|
|
self.tableView.userInteractionEnabled = YES;
|
|
|
|
|
|
|
|
if (updatingSpinner)
|
|
|
|
{
|
|
|
|
[updatingSpinner removeFromSuperview];
|
|
|
|
updatingSpinner = nil;
|
|
|
|
}
|
2015-11-20 16:07:45 +00:00
|
|
|
}
|
2015-11-20 14:20:15 +00:00
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
#pragma mark - actions
|
2015-11-20 13:12:37 +00:00
|
|
|
|
|
|
|
- (void)textViewDidChange:(UITextView *)textView
|
|
|
|
{
|
|
|
|
// avoid nil pointer
|
2015-11-20 16:07:45 +00:00
|
|
|
NSString* text = (textView.text) ? textView.text : @"";
|
2015-11-20 13:12:37 +00:00
|
|
|
|
|
|
|
if (topicTextView == textView)
|
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
NSMutableDictionary* dict = [self getUpdatedItemsDict];
|
|
|
|
|
|
|
|
if ([text isEqualToString:mxRoomState.topic])
|
|
|
|
{
|
|
|
|
[dict removeObjectForKey:@"ROOM_SECTION_TOPIC"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[dict setObject:text forKey:@"ROOM_SECTION_TOPIC"];
|
|
|
|
}
|
|
|
|
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = (dict.count != 0);
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)onTextFieldUpdate:(UITextField*)textField
|
|
|
|
{
|
|
|
|
// avoid nil pointer
|
2015-11-20 16:07:45 +00:00
|
|
|
NSString* text = (textField.text) ? textField.text : @"";
|
2015-11-20 13:12:37 +00:00
|
|
|
|
|
|
|
if (nameTextField == textField)
|
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
NSMutableDictionary* dict = [self getUpdatedItemsDict];
|
|
|
|
|
|
|
|
if ([text isEqualToString:mxRoomState.name])
|
|
|
|
{
|
|
|
|
[dict removeObjectForKey:@"ROOM_SECTION_NAME"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[dict setObject:text forKey:@"ROOM_SECTION_NAME"];
|
|
|
|
}
|
|
|
|
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = (dict.count != 0);
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-20 16:42:29 +00:00
|
|
|
- (void)didMXSessionStateChange:(NSNotification *)notif
|
|
|
|
{
|
|
|
|
// Check this is our Matrix session that has changed
|
|
|
|
if (notif.object == self.session)
|
|
|
|
{
|
|
|
|
// refresh when the session sync is done.
|
|
|
|
if (MXSessionStateRunning == self.session.state)
|
|
|
|
{
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
- (void)didUpdateRules:(NSNotification *)notif
|
|
|
|
{
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)didAccountUserInfoDidChange:(NSNotification *)notif
|
|
|
|
{
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
- (IBAction)onCancel:(id)sender
|
|
|
|
{
|
2015-12-15 17:17:20 +00:00
|
|
|
// if there are some updated fields
|
|
|
|
if (updatedItemsDict && (updatedItemsDict.count > 0))
|
|
|
|
{
|
|
|
|
// ensure that the user understands that the updates will be lost if
|
|
|
|
MXKAlert* alert = [[MXKAlert alloc] initWithTitle:nil message:NSLocalizedStringFromTable(@"room_details_with_updates", @"Vector", nil) style:MXKAlertStyleAlert];
|
|
|
|
|
|
|
|
[alert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleCancel handler:^(MXKAlert *alert) {
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
}];
|
|
|
|
|
|
|
|
[alert addActionWithTitle:NSLocalizedStringFromTable(@"save", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
|
|
|
[self onSave:nil];
|
|
|
|
}];
|
|
|
|
|
|
|
|
[alert showInViewController:self];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
}
|
2015-11-27 13:02:37 +00:00
|
|
|
}
|
|
|
|
|
2015-11-27 14:16:16 +00:00
|
|
|
- (void)onSaveFailed:(NSString*)message withKey:(NSString*)key
|
|
|
|
{
|
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
|
|
|
|
|
currentAlert = [[MXKAlert alloc] initWithTitle:nil
|
|
|
|
message:message
|
|
|
|
style:MXKAlertStyleAlert];
|
|
|
|
|
|
|
|
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
|
|
|
|
style:MXKAlertActionStyleCancel
|
|
|
|
handler:^(MXKAlert *alert) {
|
|
|
|
|
|
|
|
// save anything else
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
[strongSelf->updatedItemsDict removeObjectForKey:key];
|
|
|
|
strongSelf->currentAlert = nil;
|
|
|
|
[strongSelf onSave:nil];
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"retry", @"Vector", nil)
|
|
|
|
style:MXKAlertActionStyleDefault
|
|
|
|
handler:^(MXKAlert *alert) {
|
|
|
|
|
|
|
|
// try again
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
strongSelf->currentAlert = nil;
|
|
|
|
[strongSelf onSave:nil];
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
[currentAlert showInViewController:self];
|
|
|
|
}
|
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
- (IBAction)onSave:(id)sender
|
2015-11-20 16:07:45 +00:00
|
|
|
{
|
2015-12-15 17:17:20 +00:00
|
|
|
[self showUpdatingSpinner];
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
// check if there is some update
|
2015-11-27 13:02:37 +00:00
|
|
|
if (mxRoomState && updatedItemsDict && (updatedItemsDict.count > 0))
|
2015-11-20 16:07:45 +00:00
|
|
|
{
|
2015-12-15 12:14:37 +00:00
|
|
|
if ([updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO"])
|
|
|
|
{
|
|
|
|
// Retrieve the current picture and make sure its orientation is up
|
|
|
|
UIImage *updatedPicture = [MXKTools forceImageOrientationUp:[updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO"]];
|
|
|
|
|
|
|
|
// Upload picture
|
|
|
|
MXKMediaLoader *uploader = [MXKMediaManager prepareUploaderWithMatrixSession:mxRoom.mxSession initialRange:0 andRange:1.0];
|
|
|
|
|
|
|
|
[uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url)
|
|
|
|
{
|
|
|
|
[updatedItemsDict removeObjectForKey:@"ROOM_SECTION_PHOTO"];
|
|
|
|
[updatedItemsDict setObject:url forKey:@"ROOM_SECTION_PHOTO_URL"];
|
|
|
|
|
|
|
|
[self onSave:nil];
|
|
|
|
} failure:^(NSError *error)
|
|
|
|
{
|
2016-02-11 10:29:33 +00:00
|
|
|
NSLog(@"[RoomSettingsViewController] Failed to upload image");
|
2015-12-15 12:14:37 +00:00
|
|
|
[updatedItemsDict removeObjectForKey:@"ROOM_SECTION_PHOTO"];
|
|
|
|
[self onSave:nil];
|
|
|
|
}];
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ([updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO_URL"])
|
|
|
|
{
|
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
|
|
|
|
|
NSString* photoUrl = [updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO_URL"];
|
|
|
|
|
|
|
|
[mxRoom setAvatar:photoUrl success:^{
|
|
|
|
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
[strongSelf->updatedItemsDict removeObjectForKey:@"ROOM_SECTION_PHOTO_URL"];
|
|
|
|
[strongSelf onSave:nil];
|
|
|
|
|
|
|
|
} failure:^(NSError *error) {
|
|
|
|
|
2016-02-11 10:29:33 +00:00
|
|
|
NSLog(@"[RoomSettingsViewController] Failed to update the room avatar");
|
2015-12-15 12:14:37 +00:00
|
|
|
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
[strongSelf->updatedItemsDict removeObjectForKey:@"ROOM_SECTION_PHOTO_URL"];
|
|
|
|
[strongSelf onSave:nil];
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
// has a new room name
|
2015-11-27 13:02:37 +00:00
|
|
|
if ([updatedItemsDict objectForKey:@"ROOM_SECTION_NAME"])
|
2015-11-20 16:07:45 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
NSString* newName = [updatedItemsDict objectForKey:@"ROOM_SECTION_NAME"];
|
2015-11-20 16:07:45 +00:00
|
|
|
|
|
|
|
if (![newName isEqualToString:mxRoomState.name])
|
|
|
|
{
|
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
|
|
|
|
|
pendingOperation = [mxRoom setName:newName success:^{
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
|
|
|
|
strongSelf->pendingOperation = nil;
|
2015-11-27 13:02:37 +00:00
|
|
|
[strongSelf->updatedItemsDict removeObjectForKey:@"ROOM_SECTION_NAME"];
|
|
|
|
[strongSelf onSave:nil];
|
2015-11-20 16:07:45 +00:00
|
|
|
|
|
|
|
} failure:^(NSError *error) {
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
|
|
|
|
strongSelf->pendingOperation = nil;
|
2015-11-27 14:16:16 +00:00
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
|
|
[strongSelf onSaveFailed:NSLocalizedStringFromTable(@"room_details_fail_to_update_room_name", @"Vector", nil) withKey:@"ROOM_SECTION_NAME"];
|
|
|
|
|
|
|
|
});
|
2015-11-20 16:07:45 +00:00
|
|
|
|
2016-02-11 10:29:33 +00:00
|
|
|
NSLog(@"[onDone] Rename room failed");
|
2015-11-20 16:07:45 +00:00
|
|
|
}];
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// has a new room topic
|
2015-11-27 13:02:37 +00:00
|
|
|
if ([updatedItemsDict objectForKey:@"ROOM_SECTION_TOPIC"])
|
2015-11-20 16:07:45 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
NSString* newTopic = [updatedItemsDict objectForKey:@"ROOM_SECTION_TOPIC"];
|
2015-11-20 16:07:45 +00:00
|
|
|
|
|
|
|
if (![newTopic isEqualToString:mxRoomState.topic])
|
|
|
|
{
|
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
|
|
|
|
|
pendingOperation = [mxRoom setTopic:newTopic success:^{
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
|
|
|
|
|
|
|
strongSelf->pendingOperation = nil;
|
2015-11-27 13:02:37 +00:00
|
|
|
[strongSelf->updatedItemsDict removeObjectForKey:@"ROOM_SECTION_TOPIC"];
|
|
|
|
[strongSelf onSave:nil];
|
2015-11-20 16:07:45 +00:00
|
|
|
|
|
|
|
} failure:^(NSError *error) {
|
|
|
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
2015-11-27 14:16:16 +00:00
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
strongSelf->pendingOperation = nil;
|
2015-11-27 14:16:16 +00:00
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
|
|
[strongSelf onSaveFailed:NSLocalizedStringFromTable(@"room_details_fail_to_update_topic", @"Vector", nil) withKey:@"ROOM_SECTION_TOPIC"];
|
|
|
|
|
|
|
|
});
|
2015-11-20 16:07:45 +00:00
|
|
|
|
2016-02-11 10:29:33 +00:00
|
|
|
NSLog(@"[onDone] Rename topic failed");
|
2015-11-20 16:07:45 +00:00
|
|
|
}];
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
if ([updatedItemsDict objectForKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"])
|
|
|
|
{
|
2016-03-18 16:56:59 +00:00
|
|
|
[mxRoom setMute:roomNotifSwitch.on completion:nil];
|
2015-12-15 17:17:20 +00:00
|
|
|
[updatedItemsDict removeObjectForKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"];
|
|
|
|
[self onSave:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = (updatedItemsDict.count != 0);
|
|
|
|
|
2015-11-20 16:07:45 +00:00
|
|
|
[self hideUpdatingSpinner];
|
|
|
|
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
}
|
|
|
|
|
2015-11-20 13:12:37 +00:00
|
|
|
#pragma mark - UITableViewDataSource
|
|
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
|
|
|
{
|
|
|
|
if (section == ROOM_SECTION)
|
|
|
|
{
|
2015-11-20 14:06:48 +00:00
|
|
|
// add separators
|
|
|
|
return ROOM_SECTION_COUNT * 2 + 1;
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
|
|
|
{
|
|
|
|
return 33.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UITableViewHeaderFooterView *)headerViewForSection:(NSInteger)section
|
|
|
|
{
|
|
|
|
UITableViewHeaderFooterView *header = [[UITableViewHeaderFooterView alloc] initWithFrame:CGRectMake(0, 0, 10, 33)];
|
|
|
|
|
|
|
|
header.backgroundColor = [UIColor redColor];
|
|
|
|
|
|
|
|
return header;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
|
{
|
|
|
|
if (indexPath.section == ROOM_SECTION)
|
|
|
|
{
|
2015-11-20 14:06:48 +00:00
|
|
|
NSInteger row = indexPath.row;
|
|
|
|
|
|
|
|
// is a separator ?
|
|
|
|
if ((row % 2) == 0)
|
|
|
|
{
|
|
|
|
return 1.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
// retrieve row as a ROOM_SECTION_XX index
|
|
|
|
row = (row - 1) / 2;
|
|
|
|
|
|
|
|
if (row == ROOM_SECTION_TOPIC)
|
|
|
|
{
|
|
|
|
return ROOM_TOPIC_CELL_HEIGHT;
|
|
|
|
}
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return [super tableView:tableView heightForRowAtIndexPath:indexPath];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
|
{
|
2015-11-20 14:06:48 +00:00
|
|
|
NSInteger row = indexPath.row;
|
2015-11-20 13:12:37 +00:00
|
|
|
UITableViewCell* cell = nil;
|
|
|
|
|
|
|
|
// general settings
|
|
|
|
if (indexPath.section == ROOM_SECTION)
|
|
|
|
{
|
2015-11-20 14:06:48 +00:00
|
|
|
if ((row % 2) == 0)
|
|
|
|
{
|
|
|
|
UITableViewCell* sepCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellSeparator defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!sepCell)
|
|
|
|
{
|
|
|
|
sepCell = [[TableViewCellSeparator alloc] init];
|
|
|
|
}
|
|
|
|
|
|
|
|
// the borders are drawn in dark grey
|
|
|
|
sepCell.contentView.backgroundColor = ((row == 0) || (row == ROOM_SECTION_COUNT * 2)) ? [UIColor darkGrayColor] : [UIColor lightGrayColor];
|
|
|
|
|
|
|
|
return sepCell;
|
|
|
|
}
|
|
|
|
|
|
|
|
// retrieve row as a ROOM_SECTION_XX index
|
|
|
|
row = (row - 1) / 2;
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
if (row == ROOM_SECTION_MUTE_NOTIFICATIONS)
|
|
|
|
{
|
|
|
|
TableViewCellWithLabelAndSwitch *roomNotifCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellWithLabelAndSwitch defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!roomNotifCell)
|
|
|
|
{
|
|
|
|
roomNotifCell = [[TableViewCellWithLabelAndSwitch alloc] init];
|
|
|
|
[roomNotifCell.mxkSwitch addTarget:self action:@selector(onSwitchUpdate:) forControlEvents:UIControlEventValueChanged];
|
2016-02-05 14:21:00 +00:00
|
|
|
roomNotifCell.mxkSwitch.onTintColor = kVectorColorGreen;
|
2015-12-15 17:17:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
roomNotifCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_mute_notifs", @"Vector", nil);
|
|
|
|
roomNotifSwitch = roomNotifCell.mxkSwitch;
|
|
|
|
|
|
|
|
if (updatedItemsDict && [updatedItemsDict objectForKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"])
|
|
|
|
{
|
|
|
|
roomNotifSwitch.on = ((NSNumber*)[updatedItemsDict objectForKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"]).boolValue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-18 16:56:59 +00:00
|
|
|
roomNotifSwitch.on = mxRoom.isMute;
|
2015-12-15 17:17:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cell = roomNotifCell;
|
|
|
|
}
|
|
|
|
else if (row == ROOM_SECTION_PHOTO)
|
2015-12-15 09:46:34 +00:00
|
|
|
{
|
|
|
|
TableViewCellWithLabelAndMXKImageView *roomPhotoCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellWithLabelAndMXKImageView defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!roomPhotoCell)
|
|
|
|
{
|
|
|
|
roomPhotoCell = [[TableViewCellWithLabelAndMXKImageView alloc] init];
|
2015-12-15 12:14:37 +00:00
|
|
|
|
|
|
|
// tap on avatar to update it
|
|
|
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onRoomAvatarTap:)];
|
|
|
|
[roomPhotoCell.mxkImageView addGestureRecognizer:tap];
|
2015-12-15 09:46:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
roomPhotoCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_photo", @"Vector", nil);
|
|
|
|
|
|
|
|
if (updatedItemsDict && [updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO"])
|
|
|
|
{
|
|
|
|
roomPhotoCell.mxkImageView.image = (UIImage*)[updatedItemsDict objectForKey:@"ROOM_SECTION_PHOTO"];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-12-16 09:28:58 +00:00
|
|
|
[mxRoom setRoomAvatarImageIn:roomPhotoCell.mxkImageView];
|
2015-12-17 10:56:06 +00:00
|
|
|
roomPhotoCell.mxkImageView.alpha = mxRoom.isModerator ? 1.0f : 0.5f;
|
2015-12-15 09:46:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[roomPhotoCell.mxkImageView.layer setCornerRadius:roomPhotoCell.mxkImageView.frame.size.width / 2];
|
|
|
|
roomPhotoCell.mxkImageView.clipsToBounds = YES;
|
2015-12-17 10:56:06 +00:00
|
|
|
roomPhotoCell.userInteractionEnabled = mxRoom.isModerator;
|
2015-12-15 09:46:34 +00:00
|
|
|
|
|
|
|
cell = roomPhotoCell;
|
|
|
|
}
|
|
|
|
else if (row == ROOM_SECTION_TOPIC)
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
|
|
|
TableViewCellWithLabelAndLargeTextView *roomTopicCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellWithLabelAndLargeTextView defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!roomTopicCell)
|
|
|
|
{
|
|
|
|
roomTopicCell = [[TableViewCellWithLabelAndLargeTextView alloc] init];
|
|
|
|
|
|
|
|
// define the cell height
|
|
|
|
CGRect frame = roomTopicCell.frame;
|
|
|
|
frame.size.height = ROOM_TOPIC_CELL_HEIGHT;
|
|
|
|
roomTopicCell.frame = frame;
|
|
|
|
}
|
|
|
|
|
|
|
|
roomTopicCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_topic", @"Vector", nil);
|
|
|
|
topicTextView = roomTopicCell.mxkTextView;
|
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
if (updatedItemsDict && [updatedItemsDict objectForKey:@"ROOM_SECTION_TOPIC"])
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
roomTopicCell.mxkTextView.text = (NSString*)[updatedItemsDict objectForKey:@"ROOM_SECTION_TOPIC"];
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
roomTopicCell.mxkTextView.text = mxRoomState.topic;
|
|
|
|
}
|
2015-11-27 14:16:16 +00:00
|
|
|
|
2016-02-05 14:21:00 +00:00
|
|
|
roomTopicCell.mxkTextView.tintColor = kVectorColorGreen;
|
2016-04-19 13:28:15 +00:00
|
|
|
roomTopicCell.mxkTextView.font = [UIFont systemFontOfSize:16];
|
|
|
|
roomTopicCell.mxkTextView.bounces = NO;
|
2015-11-20 13:12:37 +00:00
|
|
|
roomTopicCell.mxkTextView.delegate = self;
|
|
|
|
|
2016-04-19 13:28:15 +00:00
|
|
|
// disable the edition if the user cannot update it
|
2015-12-17 10:56:06 +00:00
|
|
|
roomTopicCell.mxkTextView.editable = mxRoom.isModerator;
|
2016-02-05 14:21:00 +00:00
|
|
|
roomTopicCell.mxkTextView.textColor = kVectorTextColorGray;
|
2015-11-20 13:12:37 +00:00
|
|
|
|
|
|
|
cell = roomTopicCell;
|
|
|
|
}
|
2015-11-20 14:06:48 +00:00
|
|
|
else if (row == ROOM_SECTION_NAME)
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
|
|
|
TableViewCellWithLabelAndTextField *roomNameCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellWithLabelAndTextField defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!roomNameCell)
|
|
|
|
{
|
|
|
|
roomNameCell = [[TableViewCellWithLabelAndTextField alloc] init];
|
|
|
|
}
|
|
|
|
|
|
|
|
roomNameCell.mxkLabel.text = NSLocalizedStringFromTable(@"room_details_room_name", @"Vector", nil);
|
|
|
|
roomNameCell.mxkTextField.userInteractionEnabled = YES;
|
2016-02-05 14:21:00 +00:00
|
|
|
roomNameCell.mxkTextField.tintColor = kVectorColorGreen;
|
2015-11-20 13:12:37 +00:00
|
|
|
|
2015-11-27 13:02:37 +00:00
|
|
|
if (updatedItemsDict && [updatedItemsDict objectForKey:@"ROOM_SECTION_NAME"])
|
2015-11-20 13:12:37 +00:00
|
|
|
{
|
2015-11-27 13:02:37 +00:00
|
|
|
roomNameCell.mxkTextField.text = (NSString*)[updatedItemsDict objectForKey:@"ROOM_SECTION_NAME"];
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
roomNameCell.mxkTextField.text = mxRoomState.name;
|
|
|
|
}
|
|
|
|
roomNameCell.accessoryType = UITableViewCellAccessoryNone;
|
|
|
|
|
|
|
|
cell = roomNameCell;
|
|
|
|
nameTextField = roomNameCell.mxkTextField;
|
|
|
|
|
|
|
|
// disable the edition if the user cannoy update it
|
2015-12-17 10:56:06 +00:00
|
|
|
roomNameCell.editable = mxRoom.isModerator;
|
2016-02-05 14:21:00 +00:00
|
|
|
roomNameCell.mxkTextField.textColor = kVectorTextColorGray;
|
2015-11-20 13:12:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Add a "textFieldDidChange" notification method to the text field control.
|
|
|
|
[roomNameCell.mxkTextField addTarget:self action:@selector(onTextFieldUpdate:) forControlEvents:UIControlEventEditingChanged];
|
|
|
|
}
|
2015-12-16 09:28:58 +00:00
|
|
|
else if (row == ROOM_SECTION_PRIV_PUB)
|
|
|
|
{
|
|
|
|
TableViewCellWithLabelAndTextField *privPublicCell = [tableView dequeueReusableCellWithIdentifier:[TableViewCellWithLabelAndTextField defaultReuseIdentifier]];
|
|
|
|
|
|
|
|
if (!privPublicCell)
|
|
|
|
{
|
|
|
|
privPublicCell = [[TableViewCellWithLabelAndTextField alloc] init];
|
|
|
|
}
|
|
|
|
|
|
|
|
privPublicCell.mxkTextField.userInteractionEnabled = NO;
|
|
|
|
privPublicCell.mxkTextField.text = @"";
|
|
|
|
privPublicCell.mxkLabel.text = mxRoom.state.isPublic ? NSLocalizedStringFromTable(@"room_details_room_is_public", @"Vector", nil) : NSLocalizedStringFromTable(@"room_details_room_is_private", @"Vector", nil);
|
|
|
|
|
|
|
|
cell = privPublicCell;
|
|
|
|
}
|
2015-11-20 13:12:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
|
{
|
|
|
|
if (self.tableView == aTableView)
|
|
|
|
{
|
2015-11-20 14:20:15 +00:00
|
|
|
[self dismissFirstResponder];
|
2015-12-15 12:14:37 +00:00
|
|
|
|
|
|
|
if (indexPath.section == ROOM_SECTION)
|
|
|
|
{
|
|
|
|
NSUInteger row = indexPath.row;
|
|
|
|
|
|
|
|
// the even views are the line separator
|
|
|
|
if ((row % 2) == 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// retrieve row as a ROOM_SECTION_XX index
|
|
|
|
row = (row - 1) / 2;
|
|
|
|
|
|
|
|
if (row == ROOM_SECTION_PHOTO)
|
|
|
|
{
|
|
|
|
[self onRoomAvatarTap:nil];
|
|
|
|
}
|
|
|
|
}
|
2015-11-20 14:20:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-15 12:14:37 +00:00
|
|
|
#pragma mark - MediaPickerViewController Delegate
|
|
|
|
|
|
|
|
- (void)dismissMediaPicker
|
|
|
|
{
|
|
|
|
if (mediaPicker)
|
|
|
|
{
|
|
|
|
[mediaPicker withdrawViewControllerAnimated:YES completion:nil];
|
|
|
|
mediaPicker = nil;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectImage:(UIImage*)image withURL:(NSURL *)imageURL
|
|
|
|
{
|
|
|
|
[self dismissMediaPicker];
|
|
|
|
|
|
|
|
if (image)
|
|
|
|
{
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = YES;
|
|
|
|
|
|
|
|
NSMutableDictionary* dict = [self getUpdatedItemsDict];
|
|
|
|
[dict setObject:image forKey:@"ROOM_SECTION_PHOTO"];
|
|
|
|
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-19 17:59:40 +00:00
|
|
|
- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectVideo:(NSURL*)videoURL
|
2015-12-15 12:14:37 +00:00
|
|
|
{
|
|
|
|
// this method should not be called
|
|
|
|
[self dismissMediaPicker];
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - actions
|
|
|
|
|
|
|
|
- (void)onRoomAvatarTap:(UITapGestureRecognizer *)recognizer
|
|
|
|
{
|
|
|
|
mediaPicker = [MediaPickerViewController mediaPickerViewController];
|
|
|
|
mediaPicker.mediaTypes = @[(NSString *)kUTTypeImage];
|
|
|
|
mediaPicker.delegate = self;
|
|
|
|
UINavigationController *navigationController = [UINavigationController new];
|
|
|
|
[navigationController pushViewController:mediaPicker animated:NO];
|
|
|
|
|
|
|
|
[self presentViewController:navigationController animated:YES completion:nil];
|
|
|
|
}
|
|
|
|
|
2015-12-15 17:17:20 +00:00
|
|
|
- (void)onSwitchUpdate:(UISwitch*)uiSwitch
|
|
|
|
{
|
|
|
|
if (uiSwitch == roomNotifSwitch)
|
|
|
|
{
|
|
|
|
NSMutableDictionary* dict = [self getUpdatedItemsDict];
|
|
|
|
|
2016-03-18 16:56:59 +00:00
|
|
|
if (roomNotifSwitch.on == mxRoom.isMute)
|
2015-12-15 17:17:20 +00:00
|
|
|
{
|
2016-03-18 16:56:59 +00:00
|
|
|
[dict removeObjectForKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"];
|
2015-12-15 17:17:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
[dict setObject:[NSNumber numberWithBool:roomNotifSwitch.on] forKey:@"ROOM_SECTION_MUTE_NOTIFICATIONS"];
|
|
|
|
}
|
|
|
|
|
|
|
|
[self getNavigationItem].rightBarButtonItem.enabled = (dict.count != 0);
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
2015-12-15 12:14:37 +00:00
|
|
|
|
2015-11-20 13:12:37 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
|