From 76fcdf85caa904399c212a7d3b026407080dcf03 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 13 May 2018 12:23:34 +0430 Subject: [PATCH 01/27] Fix - Channel Forward fix channel forward crash --- .../Chat Screen/Controller/IGMessageViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index cba65a9..265b2af 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -871,13 +871,12 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG message.type = .text } message.repliedTo = selectedMessageToReply - message.forwardedFrom = selectedMessageToForwardToThisRoom - message.roomId = self.room!.id let detachedMessage = message.detach() IGFactory.shared.saveNewlyWriitenMessageToDatabase(detachedMessage) + message.forwardedFrom = selectedMessageToForwardToThisRoom // Hint: if use this line before "saveNewlyWriitenMessageToDatabase" app will be crashed IGMessageSender.defaultSender.send(message: message, to: room!) self.inputBarSendButton.isHidden = true From 03580db596bbdcb40422a7f8b0b884df1b8af0de Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 13 May 2018 14:35:25 +0430 Subject: [PATCH 02/27] Debugging - Open UserProfile From Look And Find --- .../Look And Find/IGLookAndFind.swift | 2 +- .../IGSettingTableViewController.swift | 3 +- iGap/VIew/Base.lproj/Main.storyboard | 13 +- iGap/VIew/IGSettingStoryboard.storyboard | 123 +++++------------- 4 files changed, 44 insertions(+), 97 deletions(-) diff --git a/iGap/Controller/View Controllers/Look And Find/IGLookAndFind.swift b/iGap/Controller/View Controllers/Look And Find/IGLookAndFind.swift index 6dc8f6e..f589988 100644 --- a/iGap/Controller/View Controllers/Look And Find/IGLookAndFind.swift +++ b/iGap/Controller/View Controllers/Look And Find/IGLookAndFind.swift @@ -128,7 +128,7 @@ class IGLookAndFind: UIViewController, UITableViewDataSource, UITableViewDelegat private func openUserProfile(searchResult: IGRealmClientSearchUsername){ let user = searchResult.user let room = searchResult.room - let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil) + let storyboard : UIStoryboard = UIStoryboard(name: "profile", bundle: nil) let destinationVC = storyboard.instantiateViewController(withIdentifier: "IGRegistredUserInfoTableViewController") as! IGRegistredUserInfoTableViewController destinationVC.user = user destinationVC.previousRoomId = 0 diff --git a/iGap/Controller/View Controllers/Setting/IGSettingTableViewController.swift b/iGap/Controller/View Controllers/Setting/IGSettingTableViewController.swift index 2363e7a..5b570d5 100644 --- a/iGap/Controller/View Controllers/Setting/IGSettingTableViewController.swift +++ b/iGap/Controller/View Controllers/Setting/IGSettingTableViewController.swift @@ -209,9 +209,8 @@ class IGSettingTableViewController: UITableViewController , NVActivityIndicatorV } } - + self.scheduledTimerWithTimeInterval() } - scheduledTimerWithTimeInterval() } func scheduledTimerWithTimeInterval(){ // Scheduling timer to Call the function **Countdown** with the interval of 1 seconds diff --git a/iGap/VIew/Base.lproj/Main.storyboard b/iGap/VIew/Base.lproj/Main.storyboard index ec71103..9f6d1cb 100644 --- a/iGap/VIew/Base.lproj/Main.storyboard +++ b/iGap/VIew/Base.lproj/Main.storyboard @@ -111,7 +111,7 @@ - + @@ -482,11 +482,11 @@ - + - + @@ -904,7 +904,7 @@ - + @@ -964,7 +964,7 @@ - + @@ -1005,7 +1005,7 @@ - + @@ -1410,7 +1410,6 @@ - diff --git a/iGap/VIew/IGSettingStoryboard.storyboard b/iGap/VIew/IGSettingStoryboard.storyboard index 096541f..4f91b51 100644 --- a/iGap/VIew/IGSettingStoryboard.storyboard +++ b/iGap/VIew/IGSettingStoryboard.storyboard @@ -1,19 +1,16 @@ - + - + - - HelveticaNeue - iGap-Fontico @@ -27,12 +24,12 @@ - + - + @@ -40,7 +37,7 @@ + + + @@ -825,8 +878,10 @@ + + @@ -862,8 +917,10 @@ + + @@ -871,7 +928,7 @@ - + @@ -1410,6 +1467,7 @@ + From eeec4c144acf2e83191d4c5dab06eec40aaaedbf Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 11:05:53 +0430 Subject: [PATCH 17/27] Improvement (Pin) - Pin Log Message --- .../Controller/IGMessageViewController.swift | 62 +--------------- .../View/IGMessageLogCollectionViewCell.swift | 11 ++- iGap/Model/Objects/IGRoomMessage.swift | 70 +++++++++++++++++++ iGap/Model/Objects/IGRoomMessageLog.swift | 5 ++ 4 files changed, 83 insertions(+), 65 deletions(-) diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index 461b290..f1816b6 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -789,7 +789,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG DispatchQueue.main.async { if let groupPinMessage = protoResponse as? IGPGroupPinMessageResponse { if groupPinMessage.hasIgpPinnedMessage { - self.txtPinnedMessage.text = self.detectPinMessageProto(message: groupPinMessage.igpPinnedMessage) + self.txtPinnedMessage.text = IGRoomMessage.detectPinMessageProto(message: groupPinMessage.igpPinnedMessage) self.pinnedMessageView.isHidden = false } else { self.pinnedMessageView.isHidden = true @@ -834,7 +834,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG DispatchQueue.main.async { if let channelPinMessage = protoResponse as? IGPChannelPinMessageResponse { if channelPinMessage.hasIgpPinnedMessage { - self.txtPinnedMessage.text = self.detectPinMessageProto(message: channelPinMessage.igpPinnedMessage) + self.txtPinnedMessage.text = IGRoomMessage.detectPinMessageProto(message: channelPinMessage.igpPinnedMessage) self.pinnedMessageView.isHidden = false } else { self.pinnedMessageView.isHidden = true @@ -2129,68 +2129,12 @@ extension IGMessageViewController: GrowingTextViewDelegate { func managePinnedMessage(){ if room?.pinMessage != nil && room?.pinMessage?.id != room?.deletedPinMessageId { - txtPinnedMessage.text = detectPinMessage() + txtPinnedMessage.text = IGRoomMessage.detectPinMessage(message: (room?.pinMessage)!) pinnedMessageView.isHidden = false } else { pinnedMessageView.isHidden = true } } - - func detectPinMessage() -> String{ - - let messageType = room?.pinMessage?.type - let pinText = "is pinned" - - if messageType == .text { - return (room?.pinMessage?.message)! - } else if messageType == .image || messageType == .imageAndText { - return "image \(pinText)" - } else if messageType == .video || messageType == .videoAndText { - return "video \(pinText)" - } else if messageType == .gif || messageType == .gifAndText { - return "gif \(pinText)" - } else if messageType == .audio || messageType == .audioAndText { - return "audio \(pinText)" - } else if messageType == .file || messageType == .fileAndText { - return "file \(pinText)" - } else if messageType == .contact { - return "contact \(pinText)" - } else if messageType == .voice { - return "voice \(pinText)" - } else if messageType == .location { - return "location \(pinText)" - } - - return "unknown pinned message" - } - - func detectPinMessageProto(message: IGPRoomMessage) -> String{ - - let messageType = message.igpMessageType - let pinText = "is pinned" - - if messageType == .text { - return message.igpMessage - } else if messageType == .image || messageType == .imageText { - return "image \(pinText)" - } else if messageType == .video || messageType == .videoText { - return "video \(pinText)" - } else if messageType == .gif || messageType == .gifText { - return "gif \(pinText)" - } else if messageType == .audio || messageType == .audioText { - return "audio \(pinText)" - } else if messageType == .file || messageType == .fileText { - return "file \(pinText)" - } else if messageType == .contact { - return "contact \(pinText)" - } else if messageType == .voice { - return "voice \(pinText)" - } else if messageType == .location { - return "location \(pinText)" - } - - return "unknown pinned message" - } } //MARK: - AVAudioRecorderDelegate diff --git a/iGap/Libraries/Chat Screen/View/IGMessageLogCollectionViewCell.swift b/iGap/Libraries/Chat Screen/View/IGMessageLogCollectionViewCell.swift index cc918f3..2374015 100644 --- a/iGap/Libraries/Chat Screen/View/IGMessageLogCollectionViewCell.swift +++ b/iGap/Libraries/Chat Screen/View/IGMessageLogCollectionViewCell.swift @@ -47,13 +47,12 @@ class IGMessageLogCollectionViewCell: IGMessageGeneralCollectionViewCell { override func setMessage(_ message: IGRoomMessage, isIncommingMessage: Bool, shouldShowAvatar: Bool, messageSizes: RoomMessageCalculatedSize, isPreviousMessageFromSameSender: Bool, isNextMessageFromSameSender: Bool) { - self.logLabel.textColor = UIColor.white - - self.logLabel.text = IGRoomMessageLog.textForLogMessage(message) - - //self.logLabel.text = IGRoomMessageLog. //bodyString - + if message.log?.type == .pinnedMessage { + self.logLabel.text = IGRoomMessage.detectPinMessage(message: message) + } else { + self.logLabel.text = IGRoomMessageLog.textForLogMessage(message) + } self.labelBackgrondView.layer.cornerRadius = 12.0 } diff --git a/iGap/Model/Objects/IGRoomMessage.swift b/iGap/Model/Objects/IGRoomMessage.swift index a11286f..c7e2223 100644 --- a/iGap/Model/Objects/IGRoomMessage.swift +++ b/iGap/Model/Objects/IGRoomMessage.swift @@ -242,6 +242,76 @@ class IGRoomMessage: Object { return "\(prefix)\(messageID)_\(roomID)" } + internal static func detectPinMessage(message: IGRoomMessage) -> String{ + + var messageType = message.type + if let reply = message.repliedTo { + messageType = reply.type + } + let pinText = "is pinned" + + if messageType == .text { + if let reply = message.repliedTo { + return "'\(reply.message!)' \(pinText)" + } + return "'\(message.message!)' \(pinText)" + } else if messageType == .image || messageType == .imageAndText { + return "'image' \(pinText)" + } else if messageType == .video || messageType == .videoAndText { + return "'video' \(pinText)" + } else if messageType == .gif || messageType == .gifAndText { + return "'gif' \(pinText)" + } else if messageType == .audio || messageType == .audioAndText { + return "'audio' \(pinText)" + } else if messageType == .file || messageType == .fileAndText { + return "'file' \(pinText)" + } else if messageType == .contact { + return "'contact' \(pinText)" + } else if messageType == .voice { + return "'voice' \(pinText)" + } else if messageType == .location { + return "'location' \(pinText)" + } + + return "'unknown' pinned message" + } + + internal static func detectPinMessageProto(message: IGPRoomMessage) -> String{ + + var messageType = message.igpMessageType + let pinText = "is pinned" + + if message.hasIgpReplyTo { + messageType = message.igpReplyTo.igpMessageType + } + + if messageType == .text { + if message.hasIgpReplyTo { + return "'\(message.igpReplyTo.igpMessage)' \(pinText)" + } + return "'\(message.igpMessage)' \(pinText)" + + } else if messageType == .image || messageType == .imageText { + return "'image' \(pinText)" + } else if messageType == .video || messageType == .videoText { + return "'video' \(pinText)" + } else if messageType == .gif || messageType == .gifText { + return "'gif' \(pinText)" + } else if messageType == .audio || messageType == .audioText { + return "'audio' \(pinText)" + } else if messageType == .file || messageType == .fileText { + return "'file' \(pinText)" + } else if messageType == .contact { + return "'contact' \(pinText)" + } else if messageType == .voice { + return "'voice' \(pinText)" + } else if messageType == .location { + return "'location' \(pinText)" + } + + return "'unknown' pinned message" + } + //detach from current realm func detach() -> IGRoomMessage { let detachedMessage = IGRoomMessage(value: self) diff --git a/iGap/Model/Objects/IGRoomMessageLog.swift b/iGap/Model/Objects/IGRoomMessageLog.swift index 2a6324c..6d65be6 100644 --- a/iGap/Model/Objects/IGRoomMessageLog.swift +++ b/iGap/Model/Objects/IGRoomMessageLog.swift @@ -28,6 +28,7 @@ class IGRoomMessageLog: Object { case missedVideoCall case missedScreenShare case missedSecretChat + case pinnedMessage } enum ExtraType: Int { @@ -136,6 +137,8 @@ class IGRoomMessageLog: Object { }else { bodyString = "Missed secret chat" } + case .pinnedMessage: + bodyString = IGRoomMessage.detectPinMessage(message: message) } if let target = message.log?.targetUser { @@ -189,6 +192,8 @@ class IGRoomMessageLog: Object { self.type = .missedSecretChat case .missedScreenShare: self.type = .missedScreenShare + case .pinnedMessage: + self.type = .pinnedMessage default: break } From b343c241c8c6734216d620fa3c78c496f068b3d7 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 11:23:16 +0430 Subject: [PATCH 18/27] Fix - Contact Import --- .../Chat Screen/Controller/IGMessageViewController.swift | 2 +- iGap/Model/Managers/IGContactManager.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index f1816b6..565718b 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -411,7 +411,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG } } - let predicate = NSPredicate(format: "roomId = %lld AND id >= %lld AND isDeleted == false", self.room!.id, lastId) + let predicate = NSPredicate(format: "roomId = %lld AND id >= %lld AND isDeleted == false AND id != %lld", self.room!.id, lastId, 0) let messages = try! Realm().objects(IGRoomMessage.self).filter(predicate).sorted(by: sortProperties) DispatchQueue.main.async { diff --git a/iGap/Model/Managers/IGContactManager.swift b/iGap/Model/Managers/IGContactManager.swift index 61c418d..b9be80a 100644 --- a/iGap/Model/Managers/IGContactManager.swift +++ b/iGap/Model/Managers/IGContactManager.swift @@ -93,6 +93,9 @@ class IGContactManager: NSObject { } func sendContactsToServer() { + if contactsStructChunk.count == 0 { + return + } contactIndex = 0 contactsStructChunk = contactsStruct.chunks(CONTACT_IMPORT_LIMIT) sendContact(phoneContacts: contactsStructChunk[0]) From 9eee22413158afa364751f946dd9080ced3e14e7 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 11:24:47 +0430 Subject: [PATCH 19/27] App Increase Version --- iGap/Supporting FIles/Info.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iGap/Supporting FIles/Info.plist b/iGap/Supporting FIles/Info.plist index 09bc130..6a44717 100644 --- a/iGap/Supporting FIles/Info.plist +++ b/iGap/Supporting FIles/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.5 + 0.4.6 CFBundleVersion - 460 + 461 Fabric APIKey From 5c625ad3778409a18cfb4af9a7476c1a5d465da9 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 14:41:42 +0430 Subject: [PATCH 20/27] Improvement - RandomId added randomId at send message --- iGap/General/IGGlobal.swift | 4 ++++ iGap/Model/AppDelegate/AppDelegate.swift | 6 ++++-- iGap/Model/Objects/IGRoomMessage.swift | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/iGap/General/IGGlobal.swift b/iGap/General/IGGlobal.swift index b72630a..ea4cac5 100644 --- a/iGap/General/IGGlobal.swift +++ b/iGap/General/IGGlobal.swift @@ -44,6 +44,10 @@ class IGGlobal { return randomString } + public class func randomId() -> Int64 { + return Int64(arc4random()) + (Int64(arc4random()) << 32) + } + /* if device is iPad return "alert" style otherwise will be returned "actionSheet" style */ public class func detectAlertStyle() -> UIAlertControllerStyle{ if UIDevice.current.userInterfaceIdiom == .phone { diff --git a/iGap/Model/AppDelegate/AppDelegate.swift b/iGap/Model/AppDelegate/AppDelegate.swift index 74a7636..87b1562 100644 --- a/iGap/Model/AppDelegate/AppDelegate.swift +++ b/iGap/Model/AppDelegate/AppDelegate.swift @@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // // _ = try! Realm() let config = Realm.Configuration( - schemaVersion: 13, + schemaVersion: 14, // Set the block which will be called automatically when opening a Realm with // a schema version lower than the one set above @@ -64,7 +64,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } else if (oldSchemaVersion < 12) { //version 0.3.2 build 455 } else if (oldSchemaVersion < 13) { - //version 0.4.5 build 460 + //version 0.4.6 build 461 + } else if (oldSchemaVersion < 14) { + //version 0.4.7 build 462 } }) Realm.Configuration.defaultConfiguration = config diff --git a/iGap/Model/Objects/IGRoomMessage.swift b/iGap/Model/Objects/IGRoomMessage.swift index c7e2223..d097b5f 100644 --- a/iGap/Model/Objects/IGRoomMessage.swift +++ b/iGap/Model/Objects/IGRoomMessage.swift @@ -47,6 +47,7 @@ class IGRoomMessage: Object { @objc dynamic var typeRaw: IGRoomMessageType.RawValue = IGRoomMessageType.unknown.rawValue @objc dynamic var statusRaw: IGRoomMessageStatus.RawValue = IGRoomMessageStatus.unknown.rawValue @objc dynamic var temporaryId: String? + @objc dynamic var randomId: Int64 = -1 var status: IGRoomMessageStatus { get { @@ -209,6 +210,8 @@ class IGRoomMessage: Object { if igpMessage.igpPreviousMessageID != 0 { self.previuosMessageUID = igpMessage.igpPreviousMessageID } + + self.randomId = igpMessage.igpRandomID } //used when sending a message @@ -224,6 +227,7 @@ class IGRoomMessage: Object { self.status = IGRoomMessageStatus.sending self.temporaryId = IGGlobal.randomString(length: 64) self.primaryKeyId = IGGlobal.randomString(length: 64) + self.randomId = IGGlobal.randomId() let predicate = NSPredicate(format: "id = %lld", IGAppManager.sharedManager.userID()!) let realm = try! Realm() if let userInDb = realm.objects(IGRegisteredUser.self).filter(predicate).first { From 8354656de57d8f139b9d6eaecdf9843386aea739 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 15:25:47 +0430 Subject: [PATCH 21/27] Fix simple change for register phone number --- ...IGRegistrationStepPhoneViewController.swift | 18 ++++++------------ iGap/VIew/Register.storyboard | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/iGap/Controller/View Controllers/Splash and Register/IGRegistrationStepPhoneViewController.swift b/iGap/Controller/View Controllers/Splash and Register/IGRegistrationStepPhoneViewController.swift index 1d089e8..9a17fcf 100644 --- a/iGap/Controller/View Controllers/Splash and Register/IGRegistrationStepPhoneViewController.swift +++ b/iGap/Controller/View Controllers/Splash and Register/IGRegistrationStepPhoneViewController.swift @@ -162,12 +162,13 @@ class IGRegistrationStepPhoneViewController: UIViewController { let phone = phoneNumberField.text if phone != nil && phone != "" { phoneSpaceLess = phone?.replacingOccurrences(of: " ", with: "") + phoneSpaceLess = phoneSpaceLess?.replacingOccurrences(of: "_", with: "") } if phoneSpaceLess != nil && phoneSpaceLess != "" && Int64(phoneSpaceLess!) != nil{ if IGGlobal.matches(for: (selectedCountry?.codeRegex)!, in: phoneSpaceLess!) { let countryCode = String(Int((self.selectedCountry?.countryCode)!)) - let fullPhone = "+" + countryCode + " " + phone! + let fullPhone = "+" + countryCode + " " + (phone?.replacingOccurrences(of: "_", with: ""))! let alertVC = UIAlertController(title: "Is this correct",message: "Is this phone correct:\n"+fullPhone,preferredStyle: .alert) let yes = UIAlertAction(title: "Yes", style: .cancel, handler: { (action) in self.hud = MBProgressHUD.showAdded(to: self.view, animated: true) @@ -189,15 +190,8 @@ class IGRegistrationStepPhoneViewController: UIViewController { } } let alertVC = UIAlertController(title: "Invalid Phone", message: "Please enter a valid phone number", preferredStyle: .alert) - let ok = UIAlertAction(title: "OK", style: .default, handler: { (action) in - - }) - - alertVC.addAction(ok) - self.present(alertVC, animated: true, completion: { - - }) - //self.performSegue(withIdentifier: "showRegistration", sender: self) + alertVC.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) + self.present(alertVC, animated: true, completion: nil) } } @@ -336,9 +330,9 @@ class IGRegistrationStepPhoneViewController: UIViewController { destination.delayBeforeSendingAgaing = self.registrationResponse?.resendDelay destination.username = self.registrationResponse?.username destination.verificationMethod = self.registrationResponse?.verificationMethod - destination.phone = phoneNumberField.text + destination.phone = phoneNumberField.text?.replacingOccurrences(of: "_", with: "") destination.selectedCountry = self.selectedCountry - let fullPhone = "+"+String(Int((self.selectedCountry?.countryCode)!))+" "+phoneNumberField.text! + let fullPhone = "+"+String(Int((self.selectedCountry?.countryCode)!))+" "+phoneNumberField.text!.replacingOccurrences(of: "_", with: "") destination.phoneNumber = fullPhone } } diff --git a/iGap/VIew/Register.storyboard b/iGap/VIew/Register.storyboard index 8d31522..f16e01c 100644 --- a/iGap/VIew/Register.storyboard +++ b/iGap/VIew/Register.storyboard @@ -74,7 +74,7 @@ - + From c92718cdbab4bad8f08375063cbee936140ce7b8 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Sun, 27 May 2018 15:41:58 +0430 Subject: [PATCH 22/27] Fix don't send update status when user is message sender --- .../IGRecentsTableViewController.swift | 2 +- .../Controller/IGMessageViewController.swift | 2 +- .../IGChatRoomListTableViewCell.swift | 36 ------------------- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/iGap/Controller/View Controllers/Tabbar Sub Controllers/IGRecentsTableViewController.swift b/iGap/Controller/View Controllers/Tabbar Sub Controllers/IGRecentsTableViewController.swift index 2f3e650..e979cad 100644 --- a/iGap/Controller/View Controllers/Tabbar Sub Controllers/IGRecentsTableViewController.swift +++ b/iGap/Controller/View Controllers/Tabbar Sub Controllers/IGRecentsTableViewController.swift @@ -1235,7 +1235,7 @@ extension IGRecentsTableViewController { } private func sendSeenForReceivedMessage(roomId: Int64, roomType: IGRoom.IGType, message: IGPRoomMessage, status: IGPRoomMessageStatus) { - if message.igpStatus == status || (message.igpStatus == .seen && status == .delivered) { + if message.igpAuthor.igpHash == IGAppManager.sharedManager.authorHash() || message.igpStatus == status || (message.igpStatus == .seen && status == .delivered) { return } diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index 565718b..8ac4b44 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -596,7 +596,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG } private func sendSeenForMessage(_ message: IGRoomMessage) { - if message.status == .seen { + if message.authorHash == IGAppManager.sharedManager.authorHash() || message.status == .seen { return } switch self.room!.type { diff --git a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift index a8023e3..47f5459 100644 --- a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift +++ b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift @@ -221,7 +221,6 @@ class IGChatRoomListTableViewCell: MGSwipeTableCell { deliveryStateImageView.isHidden = true unreadCountLabel.isHidden = false unreadCountLabel.text = "\(room.unreadCount)" - // self.sendDeliveredMessage() let labelFrame = unreadCountLabel.textRect(forBounds: CGRect(x: 0, y: 0, width: CGFloat.greatestFiniteMagnitude, height: 18.0) , limitedToNumberOfLines: 1) lastMessageStatusContainerViewWidthConstraint.constant = max(lastMessageStatusContainerViewWidthConstraintDefault, labelFrame.size.width + 8) } else { @@ -335,39 +334,4 @@ class IGChatRoomListTableViewCell: MGSwipeTableCell { self.lastMessageLabel.text = "" } } - func sendDeliveredMessage(){ - if let message = self.room?.lastMessage{ - switch self.room!.type { - case .chat: - IGChatUpdateStatusRequest.Generator.generate(roomID: self.room!.id, messageID: message.id, status: .delivered).success({ (responseProto) in - switch responseProto { - case let response as IGPChatUpdateStatusResponse: - IGChatUpdateStatusRequest.Handler.interpret(response: response) - default: - break - } - }).error({ (errorCode, waitTime) in - - }).send() - case .group: - IGGroupUpdateStatusRequest.Generator.generate(roomID: self.room!.id, messageID: message.id, status: .delivered).success({ (responseProto) in - switch responseProto { - case let response as IGPGroupUpdateStatusResponse: - IGGroupUpdateStatusRequest.Handler.interpret(response: response) - default: - break - } - }).error({ (errorCode, waitTime) in - - }).send() - break - case .channel: - IGChannelGetMessagesStatsRequest.Generator.generate(messages: [message], room: self.room!).success({ (responseProto) in - - }).error({ (errorCode, waitTime) in - - }).send() - } - } - } } From 123cf27888c21e9d0f4956709aac3fcfac1fbf0f Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Mon, 28 May 2018 10:49:09 +0430 Subject: [PATCH 23/27] Fix - Save To Gallery add new security option for save photo to gallery --- iGap/Supporting FIles/Info.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iGap/Supporting FIles/Info.plist b/iGap/Supporting FIles/Info.plist index 6a44717..f066874 100644 --- a/iGap/Supporting FIles/Info.plist +++ b/iGap/Supporting FIles/Info.plist @@ -41,6 +41,8 @@ NSAllowsArbitraryLoads + NSPhotoLibraryAddUsageDescription + $(PRODUCT_NAME) needs to access your gallery for save this photo NSCameraUsageDescription iGap needs to access your Camera. It has access to take photos and send to others. Note that you can not access this if you do not want to take a photo. From 27a86c72daa1010e2c2492fce35971e9e4dc704e Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Mon, 28 May 2018 13:38:09 +0430 Subject: [PATCH 24/27] Improvement - Pin Question --- .../Controller/IGMessageViewController.swift | 39 +++++++++++++------ iGap/Model/Managers/IGContactManager.swift | 4 +- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index 8ac4b44..5e2ca1b 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -777,7 +777,8 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG func groupPin(messageId: Int64 = 0){ var message = "Are you sure unpin this message?" - var title = "Unpin" + var title = "Unpin For All Users" + var titleMe = "Unpin Just For Me" if messageId != 0 { message = "Are you sure pin this message?" title = "Pin" @@ -812,9 +813,18 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG }).send() }) + + let unpinJustForMe = UIAlertAction(title: titleMe, style: .default, handler: { (action) in + self.pinnedMessageView.isHidden = true + IGFactory.shared.roomPinMessage(roomId: (self.room?.id)!) + }) + let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) alertC.addAction(unpin) + if messageId == 0 { + alertC.addAction(unpinJustForMe) + } alertC.addAction(cancel) self.present(alertC, animated: true, completion: nil) } @@ -823,6 +833,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG var message = "Are you sure unpin this message?" var title = "Unpin" + var titleMe = "Unpin Just For Me" if messageId != 0 { message = "Are you sure pin this message?" title = "Pin" @@ -857,9 +868,18 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG }).send() }) + + let unpinJustForMe = UIAlertAction(title: titleMe, style: .default, handler: { (action) in + self.pinnedMessageView.isHidden = true + IGFactory.shared.roomPinMessage(roomId: (self.room?.id)!) + }) + let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) alertC.addAction(unpin) + if messageId == 0 { + alertC.addAction(unpinJustForMe) + } alertC.addAction(cancel) self.present(alertC, animated: true, completion: nil) } @@ -879,18 +899,13 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG } @IBAction func didTapOnPinClose(_ sender: UIButton) { - if room?.pinMessage?.authorHash == IGAppManager.sharedManager.authorHash() { - if groupPinGranted() { - self.groupPin() - return - } else if channelPinGranted() { - self.channelPin() - return - } + if groupPinGranted() { + self.groupPin() + return + } else if channelPinGranted() { + self.channelPin() + return } - - pinnedMessageView.isHidden = true - IGFactory.shared.roomPinMessage(roomId: (room?.id)!) } //MARK: IBActions diff --git a/iGap/Model/Managers/IGContactManager.swift b/iGap/Model/Managers/IGContactManager.swift index b9be80a..6e6ae3b 100644 --- a/iGap/Model/Managers/IGContactManager.swift +++ b/iGap/Model/Managers/IGContactManager.swift @@ -93,11 +93,11 @@ class IGContactManager: NSObject { } func sendContactsToServer() { + contactIndex = 0 + contactsStructChunk = contactsStruct.chunks(CONTACT_IMPORT_LIMIT) if contactsStructChunk.count == 0 { return } - contactIndex = 0 - contactsStructChunk = contactsStruct.chunks(CONTACT_IMPORT_LIMIT) sendContact(phoneContacts: contactsStructChunk[0]) contactIndex += 1 } From 474ad025d0a9616efa11b82653a52819847973b2 Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Tue, 29 May 2018 10:26:45 +0430 Subject: [PATCH 25/27] Fix - Empty Message avoid from show empty message in view --- .../Chat Screen/Controller/IGMessageViewController.swift | 6 +++--- iGap/Model/Factories/IGFactory.swift | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift index 5e2ca1b..85422a5 100644 --- a/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift +++ b/iGap/Libraries/Chat Screen/Controller/IGMessageViewController.swift @@ -374,7 +374,7 @@ class IGMessageViewController: UIViewController, DidSelectLocationDelegate , UIG func findAllMessages(isHistory: Bool = false) -> Results!{ if lastId == 0 { - let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false", self.room!.id) + let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false AND id != %lld", self.room!.id, 0) allMessages = try! Realm().objects(IGRoomMessage.self).filter(predicate).sorted(by: sortProperties) let messageCount = allMessages.count @@ -1937,7 +1937,7 @@ extension IGMessageViewController: UICollectionViewDelegateFlowLayout { if (messages!.count < 20 && lowerAllow) { // HINT: this number(20) should set lower than getMessageLimit(25) for work correct lowerAllow = false - let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false", self.room!.id) + let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false AND id != %lld", self.room!.id, 0) messages = try! Realm().objects(IGRoomMessage.self).filter(predicate).sorted(by: sortProperties) updateObserver() @@ -1974,7 +1974,7 @@ extension IGMessageViewController: UICollectionViewDelegateFlowLayout { let predicate = NSPredicate(format: "roomId = %lld", self.room!.id) if let message = try! Realm().objects(IGRoomMessage.self).filter(predicate).sorted(by: sortProperties).last { if isFirstHistory { - let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false", self.room!.id) + let predicate = NSPredicate(format: "roomId = %lld AND isDeleted == false AND id != %lld", self.room!.id, 0) messages = try! Realm().objects(IGRoomMessage.self).filter(predicate).sorted(by: sortProperties) updateObserver() DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { diff --git a/iGap/Model/Factories/IGFactory.swift b/iGap/Model/Factories/IGFactory.swift index 21b2483..5e09a1a 100644 --- a/iGap/Model/Factories/IGFactory.swift +++ b/iGap/Model/Factories/IGFactory.swift @@ -752,7 +752,6 @@ class IGFactory: NSObject { let task = IGFactoryTask() task.task = { IGDatabaseManager.shared.perfrmOnDatabaseThread { - print(" ======> setting needs to fetch before message") let predicate = NSPredicate(format: "id = %lld AND roomId = %lld", messageId, roomId) if let messageInDb = IGDatabaseManager.shared.realm.objects(IGRoomMessage.self).filter(predicate).first { try! IGDatabaseManager.shared.realm.write { From 2e13d0f49feecda4e68e4022db79e8edafa6abaa Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Tue, 29 May 2018 16:56:40 +0430 Subject: [PATCH 26/27] Minore Improvement --- iGap.xcodeproj/project.pbxproj | 22 ++++++++++++------- .../GoogleService-Info.plist | 0 .../Info.plist | 6 ++--- .../iGap-Bridging-Header.h | 0 4 files changed, 17 insertions(+), 11 deletions(-) rename iGap/{Supporting FIles => SupportingFiles}/GoogleService-Info.plist (100%) rename iGap/{Supporting FIles => SupportingFiles}/Info.plist (98%) rename iGap/{Supporting FIles => SupportingFiles}/iGap-Bridging-Header.h (100%) diff --git a/iGap.xcodeproj/project.pbxproj b/iGap.xcodeproj/project.pbxproj index 336290a..d8ebba6 100644 --- a/iGap.xcodeproj/project.pbxproj +++ b/iGap.xcodeproj/project.pbxproj @@ -130,6 +130,7 @@ FA11E28A1DE8A8A900A2F87C /* IGAttachmentManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA11E2891DE8A8A900A2F87C /* IGAttachmentManager.swift */; }; FA11E28D1DE99BF400A2F87C /* IGFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA11E28C1DE99BF400A2F87C /* IGFactory.swift */; }; FA1C449C1DC716A20016C346 /* IGCountry.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1C449B1DC716A20016C346 /* IGCountry.swift */; }; + FA27F74020BD77ED00EC6A97 /* api.key in Sources */ = {isa = PBXBuildFile; fileRef = FA27F73F20BD77ED00EC6A97 /* api.key */; }; FA3306361F445A570096031A /* IRANSans.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FA3306351F445A570096031A /* IRANSans.ttf */; }; FA33063B1F445AE80096031A /* IRANSans_Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FA3306371F445AE80096031A /* IRANSans_Bold.ttf */; }; FA33063C1F445AE80096031A /* IRANSans_Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FA3306381F445AE80096031A /* IRANSans_Light.ttf */; }; @@ -449,6 +450,8 @@ FA11E2891DE8A8A900A2F87C /* IGAttachmentManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGAttachmentManager.swift; sourceTree = ""; }; FA11E28C1DE99BF400A2F87C /* IGFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGFactory.swift; sourceTree = ""; }; FA1C449B1DC716A20016C346 /* IGCountry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGCountry.swift; sourceTree = ""; }; + FA27F73F20BD77ED00EC6A97 /* api.key */ = {isa = PBXFileReference; lastKnownFileType = text; path = api.key; sourceTree = ""; }; + FA27F74120BD780300EC6A97 /* secret.key */ = {isa = PBXFileReference; lastKnownFileType = text; path = secret.key; sourceTree = ""; }; FA3306351F445A570096031A /* IRANSans.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = IRANSans.ttf; sourceTree = ""; }; FA3306371F445AE80096031A /* IRANSans_Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = IRANSans_Bold.ttf; sourceTree = ""; }; FA3306381F445AE80096031A /* IRANSans_Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = IRANSans_Light.ttf; sourceTree = ""; }; @@ -1363,7 +1366,7 @@ FAF7960C1DAA39660030509B /* Model */, FAF795FF1DAA392F0030509B /* VIew */, FAF7960B1DAA39660030509B /* Controller */, - FAF796081DAA39460030509B /* Supporting FIles */, + FAF796081DAA39460030509B /* SupportingFiles */, ); path = iGap; sourceTree = ""; @@ -1384,15 +1387,17 @@ path = VIew; sourceTree = ""; }; - FAF796081DAA39460030509B /* Supporting FIles */ = { + FAF796081DAA39460030509B /* SupportingFiles */ = { isa = PBXGroup; children = ( FA752C321E1EC571008694C6 /* iGap.entitlements */, FAF796091DAA39460030509B /* Info.plist */, FA5097D21DEDA18000A44699 /* iGap-Bridging-Header.h */, FAF8BFE91E34AF00002AF525 /* GoogleService-Info.plist */, + FA27F74120BD780300EC6A97 /* secret.key */, + FA27F73F20BD77ED00EC6A97 /* api.key */, ); - path = "Supporting FIles"; + path = SupportingFiles; sourceTree = ""; }; FAF7960B1DAA39660030509B /* Controller */ = { @@ -1589,7 +1594,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "./Fabric.framework/run a8bb9474c4f59357347dbd3fd5707ca541e2a740 73c66be76fb6cd1becc07ca6b9a77d9dd134ff35089fe7aa02dbfa33ad57b654"; + shellScript = "apiKey=$(sed -n '1p' < ./iGap/SupportingFiles/api.key)\nsecretKey=$(sed -n '2p' < ./iGap/SupportingFiles/secret.key)\n\n/usr/libexec/PlistBuddy -c \"Set :Fabric:APIKey $apiKey\" ./iGap/SupportingFiles/Info.plist\n\n\"./Fabric.framework/run\" $apiKey $secretKey"; }; FADF684C1DB2607B00DC5038 /* [RS] Set Build Number */ = { isa = PBXShellScriptBuildPhase; @@ -1810,6 +1815,7 @@ FA8D056D20739C96007861E7 /* IGSettingAddContactViewController.swift in Sources */, FAD580941DDC5C4E00A242DE /* IGMessageCollectionViewCell.swift in Sources */, FA8204382025C97300A795D5 /* ImageCell.swift in Sources */, + FA27F74020BD77ED00EC6A97 /* api.key in Sources */, FA927E002028416300DF7145 /* VideoCell.swift in Sources */, FA0953561E1B97700043ED3F /* IGSettingChatTableViewController.swift in Sources */, FAD5808F1DDC5C1900A242DE /* IGMessageGeneralCollectionViewCell.swift in Sources */, @@ -2037,7 +2043,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", "$(PROJECT_DIR)", ); - INFOPLIST_FILE = "iGap/Supporting FIles/Info.plist"; + INFOPLIST_FILE = iGap/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; ONLY_ACTIVE_ARCH = NO; @@ -2045,7 +2051,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "iGap/Supporting FIles/iGap-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "iGap/SupportingFiles/iGap-Bridging-Header.h"; SWIFT_VERSION = 3.0; }; name = Debug; @@ -2065,7 +2071,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", "$(PROJECT_DIR)", ); - INFOPLIST_FILE = "iGap/Supporting FIles/Info.plist"; + INFOPLIST_FILE = iGap/SupportingFiles/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = "$(inherited)"; @@ -2073,7 +2079,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "iGap/Supporting FIles/iGap-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "iGap/SupportingFiles/iGap-Bridging-Header.h"; SWIFT_VERSION = 3.0; }; name = Release; diff --git a/iGap/Supporting FIles/GoogleService-Info.plist b/iGap/SupportingFiles/GoogleService-Info.plist similarity index 100% rename from iGap/Supporting FIles/GoogleService-Info.plist rename to iGap/SupportingFiles/GoogleService-Info.plist diff --git a/iGap/Supporting FIles/Info.plist b/iGap/SupportingFiles/Info.plist similarity index 98% rename from iGap/Supporting FIles/Info.plist rename to iGap/SupportingFiles/Info.plist index f066874..0468895 100644 --- a/iGap/Supporting FIles/Info.plist +++ b/iGap/SupportingFiles/Info.plist @@ -21,7 +21,7 @@ Fabric APIKey - a8bb9474c4f59357347dbd3fd5707ca541e2a740 + a8bb9474c4f59357347dbd3fd5707ca541e2a749 Kits @@ -41,8 +41,6 @@ NSAllowsArbitraryLoads - NSPhotoLibraryAddUsageDescription - $(PRODUCT_NAME) needs to access your gallery for save this photo NSCameraUsageDescription iGap needs to access your Camera. It has access to take photos and send to others. Note that you can not access this if you do not want to take a photo. @@ -54,6 +52,8 @@ This access is that perhaps you are sending your position to someone else or usi NSMicrophoneUsageDescription iGap needs to access your Microphone. It has access to record your voice, you want to record your voice and send it to another. + NSPhotoLibraryAddUsageDescription + $(PRODUCT_NAME) needs to access your gallery for save this photo NSPhotoLibraryUsageDescription iGap needs to access your Photo-Library. This is the option to choose a photo from your gallery and send it to someone else. diff --git a/iGap/Supporting FIles/iGap-Bridging-Header.h b/iGap/SupportingFiles/iGap-Bridging-Header.h similarity index 100% rename from iGap/Supporting FIles/iGap-Bridging-Header.h rename to iGap/SupportingFiles/iGap-Bridging-Header.h From d278b47bd009b0ac25922e3f3949826050631cfd Mon Sep 17 00:00:00 2001 From: saeedrooyekhat Date: Wed, 30 May 2018 18:01:02 +0430 Subject: [PATCH 27/27] Improvement - Verified Room --- Cartfile | 2 +- Cartfile.resolved | 6 +-- .../IGNavigationItem.swift | 40 ++++++++++++++++++ .../IGChannelInfoTableViewController.swift | 9 +++- iGap/Model/AppDelegate/AppDelegate.swift | 4 +- iGap/Model/Objects/IGChannelRoom.swift | 3 ++ iGap/Model/Objects/IGRegisteredUser.swift | 4 ++ iGap/SupportingFiles/Info.plist | 6 +-- .../Assets.xcassets/Verified/Contents.json | 6 +++ .../Verified/IG_Verify.imageset/Contents.json | 23 ++++++++++ .../IG_Verify.imageset/Verify_20x20.png | Bin 0 -> 18241 bytes .../IG_Verify.imageset/Verify_40x40.png | Bin 0 -> 18742 bytes .../IG_Verify.imageset/Verify_60x60.png | Bin 0 -> 18756 bytes iGap/VIew/Base.lproj/Main.storyboard | 13 +++--- .../IGChatRoomListTableViewCell.swift | 18 ++++++++ .../IGChatRoomListTableViewCell.xib | 39 +++++++++++------ iGap/VIew/profile.storyboard | 40 +++++++++--------- 17 files changed, 164 insertions(+), 49 deletions(-) create mode 100644 iGap/VIew/Assets.xcassets/Verified/Contents.json create mode 100644 iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Contents.json create mode 100644 iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_20x20.png create mode 100644 iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_40x40.png create mode 100644 iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_60x60.png diff --git a/Cartfile b/Cartfile index 3869dff..d8bf5e6 100644 --- a/Cartfile +++ b/Cartfile @@ -19,4 +19,4 @@ github "RooyeKhat-Media/ALCameraViewController" "3.0.3" github "RooyeKhat-Media/INSPhotoGallery" "1.2.5-a" github "RooyeKhat-Media/Starscream" "3.0.4-a" github "RooyeKhat-Media/DBAttachmentPickerController" "1.1.4-a" -github "RooyeKhat-Media/IGProtoBuffLibrary" "Build78" +github "RooyeKhat-Media/IGProtoBuffLibrary" "Build80" diff --git a/Cartfile.resolved b/Cartfile.resolved index d30e99c..e4b3190 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -5,7 +5,7 @@ github "ReactiveX/RxSwift" "4.1.2" github "RooyeKhat-Media/ALCameraViewController" "3.0.3" github "RooyeKhat-Media/DBAttachmentPickerController" "1.1.4-a" github "RooyeKhat-Media/Gifu" "v3.0.0-a" -github "RooyeKhat-Media/IGProtoBuffLibrary" "Build78" +github "RooyeKhat-Media/IGProtoBuffLibrary" "Build80" github "RooyeKhat-Media/INSPhotoGallery" "1.2.5-a" github "RooyeKhat-Media/Starscream" "3.0.4-a" github "RooyeKhat-Media/swift-protobuf" "1.0.3-iGap" @@ -18,5 +18,5 @@ github "evgenyneu/Cosmos" "15.0.0" github "facebook/pop" "1.0.10" github "jdg/MBProgressHUD" "1.1.0" github "krzyzanowskim/CryptoSwift" "0.7.2" -github "ninjaprox/NVActivityIndicatorView" "4.2.0" -github "realm/realm-cocoa" "v3.5.0" +github "ninjaprox/NVActivityIndicatorView" "4.2.1" +github "realm/realm-cocoa" "v3.6.0" diff --git a/iGap/Controller/Custom Master Controllers/NavigationController/IGNavigationItem.swift b/iGap/Controller/Custom Master Controllers/NavigationController/IGNavigationItem.swift index 9d0974a..3b8eb10 100644 --- a/iGap/Controller/Custom Master Controllers/NavigationController/IGNavigationItem.swift +++ b/iGap/Controller/Custom Master Controllers/NavigationController/IGNavigationItem.swift @@ -436,6 +436,10 @@ class IGNavigationItem: UINavigationItem { make.leading.equalTo(self.centerViewContainer!.snp.leading).offset(5) } + let verifiedFrame = CGRect(x: 20, y: 5, width: 25, height: 25) + let imgVerified = UIImageView(frame: verifiedFrame) + imgVerified.image = UIImage(named:"IG_Verify") + if room.mute == .mute { let muteFrame = CGRect(x: 20, y: 5, width: 25, height: 25) let imgMute = UIImageView(frame: muteFrame) @@ -449,6 +453,26 @@ class IGNavigationItem: UINavigationItem { make.top.equalTo(self.centerViewMainLabel!.snp.top).offset(3) make.right.equalTo(self.centerViewMainLabel!.snp.right).offset(20) } + + if isVerified(room: room) { + self.centerViewContainer!.addSubview(imgVerified) + imgVerified.snp.makeConstraints { (make) in + make.width.equalTo(20) + make.height.equalTo(20) + make.top.equalTo(self.centerViewMainLabel!.snp.top).offset(3) + make.right.equalTo(imgMute.snp.right).offset(25) + } + } + } else { + if isVerified(room: room) { + self.centerViewContainer!.addSubview(imgVerified) + imgVerified.snp.makeConstraints { (make) in + make.width.equalTo(20) + make.height.equalTo(20) + make.top.equalTo(self.centerViewMainLabel!.snp.top).offset(3) + make.right.equalTo(self.centerViewMainLabel!.snp.right).offset(25) + } + } } if let peer = room.chatRoom?.peer { @@ -462,6 +486,22 @@ class IGNavigationItem: UINavigationItem { } } + private func isVerified(room: IGRoom) -> Bool { + var verified = false + if room.type == .chat { + if let user = room.chatRoom?.peer { + if user.isVerified { + verified = true + } + } + } else if room.type == .channel { + if (room.channelRoom?.isVerified)! { + verified = true + } + } + return verified + } + private func setLastSeenLabelForUser(_ user: IGRegisteredUser , room : IGRoom) { if isCloud(room: room){ diff --git a/iGap/Controller/View Controllers/Channel and Group Info/IGChannelInfoTableViewController.swift b/iGap/Controller/View Controllers/Channel and Group Info/IGChannelInfoTableViewController.swift index 84d1916..5b32611 100644 --- a/iGap/Controller/View Controllers/Channel and Group Info/IGChannelInfoTableViewController.swift +++ b/iGap/Controller/View Controllers/Channel and Group Info/IGChannelInfoTableViewController.swift @@ -45,7 +45,8 @@ class IGChannelInfoTableViewController: UITableViewController , UIGestureRecogni @IBOutlet weak var allMemberCell: UITableViewCell! @IBOutlet weak var channelLinkCell: UITableViewCell! @IBOutlet weak var adminAndModeratorCell: UITableViewCell! - + @IBOutlet weak var imgVerified: UIImageView! + var selectedChannel : IGChannelRoom? private let disposeBag = DisposeBag() var room : IGRoom? @@ -701,6 +702,12 @@ class IGChannelInfoTableViewController: UITableViewController , UIGestureRecogni return } + if (room?.channelRoom?.isVerified)! { + imgVerified.isHidden = false + } else { + imgVerified.isHidden = true + } + channelNameLabelTitle.text = room?.title channelNameLabel.text = room?.title ChannelDescriptionLabel.text = room?.channelRoom?.roomDescription diff --git a/iGap/Model/AppDelegate/AppDelegate.swift b/iGap/Model/AppDelegate/AppDelegate.swift index 87b1562..85c3f18 100644 --- a/iGap/Model/AppDelegate/AppDelegate.swift +++ b/iGap/Model/AppDelegate/AppDelegate.swift @@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // // _ = try! Realm() let config = Realm.Configuration( - schemaVersion: 14, + schemaVersion: 15, // Set the block which will be called automatically when opening a Realm with // a schema version lower than the one set above @@ -67,6 +67,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //version 0.4.6 build 461 } else if (oldSchemaVersion < 14) { //version 0.4.7 build 462 + } else if (oldSchemaVersion < 15) { + //version 0.4.8 build 463 } }) Realm.Configuration.defaultConfiguration = config diff --git a/iGap/Model/Objects/IGChannelRoom.swift b/iGap/Model/Objects/IGChannelRoom.swift index dc5a043..87652ab 100644 --- a/iGap/Model/Objects/IGChannelRoom.swift +++ b/iGap/Model/Objects/IGChannelRoom.swift @@ -102,6 +102,7 @@ class IGChannelRoom: Object { @objc dynamic var privateExtra: IGChannelPrivateExtra? @objc dynamic var publicExtra: IGChannelPublicExtra? @objc dynamic var isSignature: Bool = false + @objc dynamic var isVerified: Bool = false //MARK: ignored properties var type: IGType { get { @@ -173,6 +174,8 @@ class IGChannelRoom: Object { if igpChannelRoom.hasIgpPublicExtra{ self.publicExtra = IGChannelPublicExtra(igpPublicExtra: igpChannelRoom.igpPublicExtra, id: id) } + + self.isVerified = igpChannelRoom.igpVerified } diff --git a/iGap/Model/Objects/IGRegisteredUser.swift b/iGap/Model/Objects/IGRegisteredUser.swift index 8daec2c..b6abd84 100644 --- a/iGap/Model/Objects/IGRegisteredUser.swift +++ b/iGap/Model/Objects/IGRegisteredUser.swift @@ -46,7 +46,9 @@ class IGRegisteredUser: Object { @objc dynamic var isMutual: Bool = false //current user have this user in his/her contacts @objc dynamic var isInContacts: Bool = false @objc dynamic var isBlocked: Bool = false + @objc dynamic var isVerified: Bool = false @objc dynamic var lastSeenStatusRaw: IGLastSeenStatus.RawValue = IGLastSeenStatus.longTimeAgo.rawValue + //ignored properties var lastSeenStatus: IGLastSeenStatus { get { @@ -133,6 +135,8 @@ class IGRegisteredUser: Object { if igpUser.hasIgpAvatar{ self.avatar = IGAvatar(igpAvatar: igpUser.igpAvatar)//.detach() } + + self.isVerified = igpUser.igpVerified } //detach from current realm diff --git a/iGap/SupportingFiles/Info.plist b/iGap/SupportingFiles/Info.plist index 0468895..4234424 100644 --- a/iGap/SupportingFiles/Info.plist +++ b/iGap/SupportingFiles/Info.plist @@ -15,13 +15,13 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4.6 + 0.4.8 CFBundleVersion - 461 + 463 Fabric APIKey - a8bb9474c4f59357347dbd3fd5707ca541e2a749 + a8bb9474c4f59357347dbd3fd5707ca541e2a740 Kits diff --git a/iGap/VIew/Assets.xcassets/Verified/Contents.json b/iGap/VIew/Assets.xcassets/Verified/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/iGap/VIew/Assets.xcassets/Verified/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Contents.json b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Contents.json new file mode 100644 index 0000000..1ee5007 --- /dev/null +++ b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Verify_20x20.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Verify_40x40.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Verify_60x60.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_20x20.png b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_20x20.png new file mode 100644 index 0000000000000000000000000000000000000000..cf0edb9bc1fc85b6c701986159aef8ee4a56c700 GIT binary patch literal 18241 zcmeI3c{G&o`^O(CWUo+24O);{G0ZeZj6JfAjI$zX|b>H(mbI!BFb(Nih ztcENA016KF*6zY@m9e*sl<@QK9a;*)ubCWsZyo^1%^7=30O<$k0f4LvlR$8F^=I?h zJbyL^;y@rkI9xWJ8AtyH(u`<#)EVFyRbAZ>U|SlXV*Abu_jXy4a*u(K zR9Z2vY!SvL+D8T&EbZk5TcFqIFn5^>nmmo1z5-Sonx>A5HdcB%a1#KslT?MH9T*O2 zR4i(2L?@IgZh*e3k{Z?V^XnYxZYtoc0Dx!w$mS74c!@^Ta;d1Gkt2)yr~9v$%ic7& zi(ag>;vA6O``BxMGsec|@Sd_qkGi|M9y(sO@*!XMiWp(kZm9Me4*WL~_hs%%18z(oo=&(6RgvB51@|g z?6BIae`RsYDD`=V;b%#FhY4_cBVHmr33_53Me^gyrOG6J_47dhcvsG@xvM858RZ}I ztVuBX#$wnmdod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.png new file mode 100644 index 0000000000000000000000000000000000000000..d48162c3aa1adc4a66ca5422e7b238100e061db5 GIT binary patch literal 18756 zcmeI3c{J2t{QuvReb<5{KDJ6SX2vqiG}e(NWY1_dW;0o4Vwj;%GL$7gB%z43%9@B0 z3KcDusAP>SNkyMXlgKB7#7bZCVv{b>zInE7KD@K%oagRkQ?sYr)VJfN^k~=>@>p92A;fMF{$su(XsS`!0 zGF8MT=5|5wUIABEO$D_^E13-|;MgVDRAbGWpcArMOdW~d@p=HrOps!Yc6^r6C|=Om z2#+fj-wl3slYd^>!=rz0uql^n3;@q*AK2p}+J~%MYw)wW{cIh3_3v%YuWmXjbkL*gMZCq#Rgw7_`A5pPtvt#w>MQykmhFu*ON|}ZIX48pm2{NXkP;O;!YgT2kUi`7+O`|Bmj(+Q>q`U3G#$`hCgqj&%ZUA zwa8opgc7Ze?gfBdW~!Rb_lu3{1OdP-lc`>4BKN*}rA8J1>T15OYLOXt_(4b; zu}U3LAdkZsl{i6}6Njdhsx5h!#i%OYi(28JY@MKM33EK`tmtAXKW5;!1QEHz{CdL1 zyMR{MOhknR>=?7i!QioI3A*f}-l~JCCi;epgl*#KKPxJ#Jmt|7xTec=-et^9RYGuHx~U>o z!Nd|{gW1w%c~Nn-s?O35Aw40UgAO(8loKynUs-#7>BrkEJ+xqv7)uS6)@AX_A(H!| z(6{wemqnws)|DMuVs-hPbIY<8^A=x6m0^wSG#$%TDv9?x@Loj%h+`Ux8}1$&NFTU0 zpgkZrpft8!INif|@3|?bJ~hYtdp64sN)GA_@)M40nYf%yb?m-)+IgvN{5I44)1{7= z93n3+*9k~PG=xiAS)b28lk{knr;O($`O-_;^`+fO3R_Yhy0$zRws@KHlIJ~LR4hU& zye^8QCY!cWU?oYGzVgy>n+vj!Vr1)_p?a{_$A?ZxoS?X1)JxU>mP)uUoU}Po07y*=SSOP~UK-q4k7rngQ&o)==6|+S9b2tM1zv+cZiqmR=)R6%A~=;5J%X;d^Ks z!tFf9W!uhT^ZfMuH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ay!7T&QRHT)h`t*I*wxwL`h-&Upn zFCuu)vTMC<$>o$@e8+yiYvL8mXV=9}?)CQ4g%&bC5P99LPYY}a>c|@leJ5D0TpA}Z zR;XdG7kz<$R=Q}jf`ZcZRSsi?Z;I(&cMk-(i0g0jJ@sLns$NqVHL^bG$f(k%R}P?2 zPf)M8RBygC@XQgktF_^iSy%6?av|wP`M&%1VVH??3^%^12+gc?gRVdd<@hg z-eW{=DSP99h!yu-X_jlyVc>>K<+c@Z#<{no$6t@H-8Fso2{s1l(>D>kix(5>M11I@ z7J#a~qbG3$sSqQqQ3X>u5jd{anzg&chG=MLSs(g0=*G;5lF{tAB^?tQwqCBdW7PrG z52`_WV%KH@!|b+P85S2Q^zEAIyKyJJmuqX5)Tc2TJlAyhX#U$iq2bjY zwv3jD1rcrBH^T{Q^1TN>zE5dLJ*^ws0CKtzD{I3WWSakQRn-z3{nC=Hsn(>L&{kgf zxN1tl(|3i_NA5}dMQeHTju!bqruXgq*n0(7n$YyjJE|S1*J4TF+Xp6ZUBa<4%;zo5 z(WH>zvWM|cgL<+p7UPK6{=oE;nF+NUos^4t=sI^_cU7r!_-;Z`r9#iOqJ*K&kE?AR%MV8uo9%X!>OC(F z>~aKUh#lSSb?zkeF~3Io_^=?4-L&nnOX|C8E3odnJNGjQ!bGjG!o(!=rMV5{omFxl z4j=Z7Y2aOw99^otl&Kk~aGlBI3zk~>7*(q=gHOAxrjG(RE)8BFe5p^61H? kA0?(|E|mmHy?qB{-<&D7*4p!K;bwHJO - + @@ -961,7 +961,7 @@ - + @@ -1021,7 +1021,7 @@ - + @@ -1062,7 +1062,7 @@ - + @@ -1467,9 +1467,8 @@ - - - + + diff --git a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift index 47f5459..e550cdb 100644 --- a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift +++ b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.swift @@ -39,6 +39,7 @@ class IGChatRoomListTableViewCell: MGSwipeTableCell { @IBOutlet weak var roomTypeIndicatorImageView: UIImageView! @IBOutlet weak var roomTitleLabelLeftConstraint: NSLayoutConstraint! @IBOutlet weak var imgMute: UIImageView! + @IBOutlet weak var imgVerified: UIImageView! let currentLoggedInUserID = IGAppManager.sharedManager.userID() @@ -146,12 +147,29 @@ class IGChatRoomListTableViewCell: MGSwipeTableCell { case .chat: roomTypeIndicatorImageView.image = nil roomTitleLabelLeftConstraint.constant = 16 + + if let user = room.chatRoom?.peer { + if user.isVerified { + imgVerified.isHidden = false + } else { + imgVerified.isHidden = true + } + } + case .group: roomTypeIndicatorImageView.image = UIImage(named: "IG_Chat_List_Type_Group") roomTitleLabelLeftConstraint.constant = 36 + imgVerified.isHidden = true + case .channel: roomTypeIndicatorImageView.image = UIImage(named: "IG_Chat_List_Type_Channel") roomTitleLabelLeftConstraint.constant = 36 + + if (room.channelRoom?.isVerified)! { + imgVerified.isHidden = false + } else { + imgVerified.isHidden = true + } } if room.mute == IGRoom.IGRoomMute.mute { diff --git a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.xib b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.xib index e346c6b..2118626 100644 --- a/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.xib +++ b/iGap/VIew/ReusableViews/Chat List Cell/IGChatRoomListTableViewCell.xib @@ -1,11 +1,11 @@ - + - + @@ -27,17 +27,8 @@ - + + + + + + + + + + - + @@ -120,6 +129,7 @@ + @@ -132,4 +142,7 @@ + + + diff --git a/iGap/VIew/profile.storyboard b/iGap/VIew/profile.storyboard index 1743944..68485b1 100644 --- a/iGap/VIew/profile.storyboard +++ b/iGap/VIew/profile.storyboard @@ -1,20 +1,15 @@ - + - + - - - HelveticaNeue - - @@ -380,15 +375,24 @@ - @@ -1490,9 +1495,7 @@ - - - + @@ -1979,12 +1982,8 @@ - - - - - - + + @@ -2977,10 +2976,11 @@ + - +