Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

Commit

Permalink
Added [SKSnap isOutgoing]
Browse files Browse the repository at this point in the history
  • Loading branch information
NSExceptional committed Dec 30, 2015
1 parent a3f99c3 commit 7b3f3a1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/SnapchatKit.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Example/SnapchatKit-OSX/SnapchatKit-OSX/main.m
Expand Up @@ -248,12 +248,6 @@ int main(int argc, const char * argv[]) {
// Get unread snaps
NSArray *unread = session.unread;
SKLog(@"%lu unread snaps: %@", unread.count, unread);


[[SKClient sharedClient] updateFeatureSettings:@{SKFeatureSettings.scrambleBestFriends: @YES, SKFeatureSettings.barcodeEnabled: @YES} completion:^(NSError *error) {
if (error)
NSLog(@"%@", error.localizedDescription);
}];
//
// SKStoryCollection *friend = [[SKClient sharedClient].currentSession.stories
// filteredOrderedSetUsingPredicate:[NSPredicate predicateWithFormat:@"%K BEGINSWITH %@", @"username", @"luke"]].firstObject;
Expand Down
2 changes: 2 additions & 0 deletions Pod/Classes/Model/SKSnap.h
Expand Up @@ -10,6 +10,7 @@
#import "SKThing.h"
@class SKBlob;

/** Not a counterpart of the \c SKSentSnap class. */
@interface SKSnap : SKThing

/** nil if snap is "outgoing". */
Expand All @@ -21,6 +22,7 @@
@property (nonatomic, readonly) NSString *conversationIdentifier;
@property (nonatomic, readonly) SKMediaKind mediaKind;
@property (nonatomic, readonly) SKSnapStatus status;
@property (nonatomic, readonly) BOOL isOutgoing;
@property (nonatomic, readonly) NSUInteger screenshots;
/** Integer time. _mediaTimer rounded down. 0 if snap is "outgoing". */
@property (nonatomic, readonly) NSUInteger timer;
Expand Down
8 changes: 7 additions & 1 deletion Pod/Classes/Model/SKSnap.m
Expand Up @@ -14,7 +14,13 @@ @implementation SKSnap

- (id)initWithDictionary:(NSDictionary *)json {
if (!json.allKeys.count) return nil;
return [super initWithDictionary:json];

self = [super initWithDictionary:json];
if (self) {
_isOutgoing = [_identifier hasSuffix:@"s"];
}

return self;
}

- (NSString *)description {
Expand Down
4 changes: 2 additions & 2 deletions Pod/Classes/Model/SKSnapResponse.h
Expand Up @@ -12,13 +12,13 @@
/** Passed to the completion of both of the \c -[SKClient sendSnap:...] methods. */
@interface SKSnapResponse : SKThing

/** An array of \c SKSentSnap objects. */
/** An array of \c SKSentSnap objects, not to be confused with outgoing \c SKSnap objects. */
@property (nonatomic, readonly) NSArray *sentSnaps;
@property (nonatomic, readonly) BOOL success;

@end

/** Used as part of the \c SKSnapResponse class. */
/** Used as part of the \c SKSnapResponse class; not a counterpart of \c SKSnap. */
@interface SKSentSnap : SKThing
@property (nonatomic, readonly) NSString *sender;
@property (nonatomic, readonly) NSString *identifier;
Expand Down
2 changes: 1 addition & 1 deletion SnapchatKit.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SnapchatKit"
s.version = "0.5.0"
s.version = "0.5.1"
s.summary = "An Objective-C implementation of the unofficial Snapchat API."
s.homepage = "https://github.com/ThePantsThief/SnapchatKit"
s.license = 'MIT'
Expand Down

0 comments on commit 7b3f3a1

Please sign in to comment.