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 0000000..cf0edb9 Binary files /dev/null and b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_20x20.png differ diff --git a/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_40x40.png b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_40x40.png new file mode 100644 index 0000000..25df719 Binary files /dev/null and b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_40x40.png differ diff --git a/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_60x60.png b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_60x60.png new file mode 100644 index 0000000..d48162c Binary files /dev/null and b/iGap/VIew/Assets.xcassets/Verified/IG_Verify.imageset/Verify_60x60.png differ diff --git a/iGap/VIew/Base.lproj/Main.storyboard b/iGap/VIew/Base.lproj/Main.storyboard index e9fcdfe..b1dcc0e 100644 --- a/iGap/VIew/Base.lproj/Main.storyboard +++ b/iGap/VIew/Base.lproj/Main.storyboard @@ -111,7 +111,7 @@ - + @@ -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 @@ + - +