diff --git a/Podfile.lock b/Podfile.lock index 8de01668..046279ba 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -52,7 +52,7 @@ DEPENDENCIES: EXTERNAL SOURCES: MZFayeClient: - :path: ../CatchLib-iOS/MZFayeClient/ + :path: "../CatchLib-iOS/MZFayeClient/" SPEC CHECKSUMS: 1PasswordExtension: 676a216461ffa9189db66541b5a2465e10ae4743 @@ -77,4 +77,4 @@ SPEC CHECKSUMS: SocketRocket: ee0b5c34182d37bb4f1f8d628bbe737718126daa TPKeyboardAvoiding: 614ebec846ec28b83d548769297fa5fb56468904 -COCOAPODS: 0.38.2 +COCOAPODS: 0.39.0 diff --git a/Yep.xcodeproj/project.pbxproj b/Yep.xcodeproj/project.pbxproj index 1ba195c2..4a048c22 100644 --- a/Yep.xcodeproj/project.pbxproj +++ b/Yep.xcodeproj/project.pbxproj @@ -292,7 +292,7 @@ 848806B41B7B4E2E000C5424 /* Show.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 848806B31B7B4E2E000C5424 /* Show.storyboard */; }; 848806B61B7B4F53000C5424 /* ShowViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848806B51B7B4F53000C5424 /* ShowViewController.swift */; }; 84C959891B731FD20017D3ED /* ChatBaseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84C959881B731FD20017D3ED /* ChatBaseCell.swift */; }; - B00500D7E943DDD27CF9C562 /* Pods_Yep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3146F0F60F2A38BC6E0FA66 /* Pods_Yep.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + B00500D7E943DDD27CF9C562 /* Pods_Yep.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3146F0F60F2A38BC6E0FA66 /* Pods_Yep.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ diff --git a/Yep/Info.plist b/Yep/Info.plist index 25286722..8bdc6bc4 100644 --- a/Yep/Info.plist +++ b/Yep/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 126 + 127 Fabric APIKey diff --git a/Yep/Services/YepService.swift b/Yep/Services/YepService.swift index 3e70c27b..055f5b53 100644 --- a/Yep/Services/YepService.swift +++ b/Yep/Services/YepService.swift @@ -1275,6 +1275,20 @@ func friendships(completion completion: [JSONDictionary] -> Void) { // MARK: - Groups +func groupShareLinkWithGroupID(groupID: String, failureHandler: ((Reason, String?) -> Void)?, completion: JSONDictionary -> Void) { + let parse: JSONDictionary -> JSONDictionary? = { data in + return data + } + + let resource = authJsonResource(path: "/api/v1/circles/\(groupID)/share", method: .POST, requestParameters: [:], parse: parse) + + if let failureHandler = failureHandler { + apiRequest({_ in}, baseURL: baseURL, resource: resource, failure: failureHandler, completion: completion) + } else { + apiRequest({_ in}, baseURL: baseURL, resource: resource, failure: defaultFailureHandler, completion: completion) + } +} + func groupWithGroupID(groupID groupID: String, failureHandler: ((Reason, String?) -> Void)?, completion: JSONDictionary -> Void) { let parse: JSONDictionary -> JSONDictionary? = { data in diff --git a/Yep/ViewControllers/Conversation/ConversationViewController.swift b/Yep/ViewControllers/Conversation/ConversationViewController.swift index 6e4a5240..2591fc37 100644 --- a/Yep/ViewControllers/Conversation/ConversationViewController.swift +++ b/Yep/ViewControllers/Conversation/ConversationViewController.swift @@ -504,12 +504,18 @@ class ConversationViewController: BaseViewController { joinGroup(groupID: groupID, failureHandler: nil, completion: { println("joined group: \(groupID)") + + groupShareLinkWithGroupID(groupID, failureHandler: { (reason, error) -> Void in + + }, completion: { (link) -> Void in + print(link) + }) syncMessages() - dispatch_async(dispatch_get_main_queue()) { - FayeService.sharedManager.subscribeGroup(groupID: groupID) - } + + FayeService.sharedManager.subscribeGroup(groupID: groupID) + }) } @@ -672,7 +678,9 @@ class ConversationViewController: BaseViewController { // 进来时就尽快标记已读 - batchMarkMessagesAsReaded(updateOlderMessagesIfNeeded: true) + delay(0.5) { [weak self] in + self?.batchMarkMessagesAsReaded(updateOlderMessagesIfNeeded: true) + } // MARK: Notify Typing diff --git a/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift b/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift index fb78a623..e2ce48f7 100644 --- a/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift +++ b/Yep/ViewControllers/FeedConversations/FeedConversationsViewController.swift @@ -36,8 +36,10 @@ class FeedConversationsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - title = NSLocalizedString("Joined Feeds", comment: "") + title = NSLocalizedString("Feeds", comment: "") +// navigationItem.backBarButtonItem?.title = NSLocalizedString("Feeds", comment: "") + realm = try! Realm() feedConversationsTableView.registerNib(UINib(nibName: feedConversationCellID, bundle: nil), forCellReuseIdentifier: feedConversationCellID)