2022-01-18 20:26:30 +04:00

66 lines
2.6 KiB
Objective-C

#import <WatchCommon/TGBridgeCommon.h>
#import <WatchCommon/TGBridgeImageMediaAttachment.h>
#import <WatchCommon/TGBridgeVideoMediaAttachment.h>
#import <WatchCommon/TGBridgeAudioMediaAttachment.h>
#import <WatchCommon/TGBridgeDocumentMediaAttachment.h>
#import <WatchCommon/TGBridgeLocationMediaAttachment.h>
#import <WatchCommon/TGBridgeContactMediaAttachment.h>
#import <WatchCommon/TGBridgeActionMediaAttachment.h>
#import <WatchCommon/TGBridgeReplyMessageMediaAttachment.h>
#import <WatchCommon/TGBridgeForwardedMessageMediaAttachment.h>
#import <WatchCommon/TGBridgeWebPageMediaAttachment.h>
#import <WatchCommon/TGBridgeMessageEntitiesAttachment.h>
#import <WatchCommon/TGBridgeUnsupportedMediaAttachment.h>
typedef enum {
TGBridgeTextCheckingResultTypeUndefined,
TGBridgeTextCheckingResultTypeBold,
TGBridgeTextCheckingResultTypeItalic,
TGBridgeTextCheckingResultTypeCode,
TGBridgeTextCheckingResultTypePre
} TGBridgeTextCheckingResultType;
@interface TGBridgeTextCheckingResult : NSObject
@property (nonatomic, assign) TGBridgeTextCheckingResultType type;
@property (nonatomic, assign) NSRange range;
@end
typedef NS_ENUM(NSUInteger, TGBridgeMessageDeliveryState) {
TGBridgeMessageDeliveryStateDelivered = 0,
TGBridgeMessageDeliveryStatePending = 1,
TGBridgeMessageDeliveryStateFailed = 2
};
@interface TGBridgeMessage : NSObject <NSCoding>
@property (nonatomic) int32_t identifier;
@property (nonatomic) NSTimeInterval date;
@property (nonatomic) int64_t randomId;
@property (nonatomic) bool unread;
@property (nonatomic) bool deliveryError;
@property (nonatomic) TGBridgeMessageDeliveryState deliveryState;
@property (nonatomic) bool outgoing;
@property (nonatomic) int64_t fromUid;
@property (nonatomic) int64_t toUid;
@property (nonatomic) int64_t cid;
@property (nonatomic, strong) NSString *text;
@property (nonatomic, strong) NSArray *media;
@property (nonatomic) bool forceReply;
- (NSArray<NSNumber *> *)involvedUserIds;
- (NSArray *)textCheckingResults;
+ (instancetype)temporaryNewMessageForText:(NSString *)text userId:(int32_t)userId;
+ (instancetype)temporaryNewMessageForText:(NSString *)text userId:(int32_t)userId replyToMessage:(TGBridgeMessage *)replyToMessage;
+ (instancetype)temporaryNewMessageForSticker:(TGBridgeDocumentMediaAttachment *)sticker userId:(int32_t)userId;
+ (instancetype)temporaryNewMessageForLocation:(TGBridgeLocationMediaAttachment *)location userId:(int32_t)userId;
+ (instancetype)temporaryNewMessageForAudioWithDuration:(int32_t)duration userId:(int32_t)userId localAudioId:(int64_t)localAudioId;
@end
extern NSString *const TGBridgeMessageKey;
extern NSString *const TGBridgeMessagesArrayKey;