SystemMessage.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // _____ _
  2. // |_ _| |_ _ _ ___ ___ _ __ __ _
  3. // | | | ' \| '_/ -_) -_) ' \/ _` |_
  4. // |_| |_||_|_| \___\___|_|_|_\__,_(_)
  5. //
  6. // Threema iOS Client
  7. // Copyright (c) 2013-2020 Threema GmbH
  8. //
  9. // This program is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU Affero General Public License, version 3,
  11. // as published by the Free Software Foundation.
  12. //
  13. // This program is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU Affero General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Affero General Public License
  19. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. #import <Foundation/Foundation.h>
  21. #import <CoreData/CoreData.h>
  22. #import "BaseMessage.h"
  23. // Note that maximum value is 16.
  24. enum {
  25. kSystemMessageRenameGroup = 1, // The admin has renamed the group
  26. kSystemMessageGroupMemberLeave = 2, // Another member has left the group
  27. kSystemMessageGroupMemberAdd = 3, // The admin has added a member to the group
  28. kSystemMessageGroupMemberForcedLeave = 4, // Another member was removed from the group
  29. kSystemMessageGroupSelfAdded = 5, // I was added to the group
  30. kSystemMessageGroupSelfRemoved = 6, // I was removed from the group
  31. kSystemMessageGroupSelfLeft = 16, // I have left the group
  32. kSystemMessageCallMissed = 7,
  33. kSystemMessageCallRejected = 8,
  34. kSystemMessageCallRejectedBusy = 9,
  35. kSystemMessageCallRejectedTimeout = 10,
  36. kSystemMessageCallEnded = 11,
  37. kSystemMessageCallRejectedDisabled = 12,
  38. kSystemMessageCallRejectedUnknown = 13,
  39. kSystemMessageContactOtherAppInfo = 14,
  40. kSystemMessageCallRejectedOffHours = 15
  41. };
  42. @interface SystemMessage : BaseMessage
  43. @property (nonatomic, retain) NSNumber * type;
  44. @property (nonatomic, retain) NSData * arg;
  45. - (NSString*)format;
  46. - (NSString *)callDetail;
  47. - (BOOL)isCallType;
  48. - (BOOL)haveCallTime;
  49. - (NSString *)callTime;
  50. @end