1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-04 02:17:51 +01:00
Telegram/Watch/Bridge/TGBridgeMessage.h
2016-02-25 01:03:51 +01:00

81 lines
2.9 KiB
Objective-C

#import "TGBridgeCommon.h"
#import "TGBridgeImageMediaAttachment.h"
#import "TGBridgeVideoMediaAttachment.h"
#import "TGBridgeAudioMediaAttachment.h"
#import "TGBridgeDocumentMediaAttachment.h"
#import "TGBridgeLocationMediaAttachment.h"
#import "TGBridgeContactMediaAttachment.h"
#import "TGBridgeActionMediaAttachment.h"
#import "TGBridgeReplyMessageMediaAttachment.h"
#import "TGBridgeForwardedMessageMediaAttachment.h"
#import "TGBridgeWebPageMediaAttachment.h"
#import "TGBridgeMessageEntitiesAttachment.h"
#import "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 enum {
TGBridgeMessageDeliveryStateDelivered = 0,
TGBridgeMessageDeliveryStatePending = 1,
TGBridgeMessageDeliveryStateFailed = 2
} TGBridgeMessageDeliveryState;
@interface TGBridgeMessage : NSObject <NSCoding>
{
int32_t _identifier;
NSTimeInterval _date;
int64_t _randomId;
bool _unread;
bool _outgoing;
bool _deliveryError;
TGBridgeMessageDeliveryState _deliveryState;
int64_t _fromUid;
int64_t _toUid;
int64_t _cid;
NSString *_text;
NSArray *_media;
bool _forceReply;
}
@property (nonatomic, readonly) int32_t identifier;
@property (nonatomic, readonly) NSTimeInterval date;
@property (nonatomic, readonly) int64_t randomId;
@property (nonatomic, readonly) bool unread;
@property (nonatomic, readonly) bool deliveryError;
@property (nonatomic, readonly) TGBridgeMessageDeliveryState deliveryState;
@property (nonatomic, readonly) bool outgoing;
@property (nonatomic, readonly) int64_t fromUid;
@property (nonatomic, readonly) int64_t toUid;
@property (nonatomic, readonly) int64_t cid;
@property (nonatomic, readonly) NSString *text;
@property (nonatomic, readonly) NSArray *media;
@property (nonatomic, readonly) bool forceReply;
- (NSIndexSet *)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;