NCMessageFileParameter.m 950 B

12345678910111213141516171819202122232425262728
  1. /**
  2. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. #import "NCMessageFileParameter.h"
  6. #import "NextcloudTalk-Swift.h"
  7. @implementation NCMessageFileParameter
  8. - (instancetype)initWithDictionary:(NSDictionary *)parameterDict
  9. {
  10. self = [super initWithDictionary:parameterDict];
  11. if (self) {
  12. self.path = [parameterDict objectForKey:@"path"];
  13. self.mimetype = [parameterDict objectForKey:@"mimetype"];
  14. self.size = [[parameterDict objectForKey:@"size"] integerValue];
  15. self.previewAvailable = [[parameterDict objectForKey:@"preview-available"] boolValue];
  16. self.previewImageHeight = [[parameterDict objectForKey:@"preview-image-height"] intValue];
  17. self.width = [[parameterDict objectForKey:@"width"] intValue];
  18. self.height = [[parameterDict objectForKey:@"height"] intValue];
  19. }
  20. return self;
  21. }
  22. @end