From 5e521a81925386079513bfd322cf0212a2f08844 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 7 Dec 2021 14:12:48 +1100 Subject: [PATCH 01/15] fix the issue where no text will show along with a doc type attachment --- .../Content Views/DocumentView.swift | 18 ++++++--------- .../Message Cells/VisibleMessageCell.swift | 21 +++++++++++++++--- .../Session/File.imageset/Contents.json | 12 ++++++++++ .../Session/File.imageset/doc.pdf | Bin 0 -> 4310 bytes 4 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 Session/Meta/Images.xcassets/Session/File.imageset/Contents.json create mode 100644 Session/Meta/Images.xcassets/Session/File.imageset/doc.pdf diff --git a/Session/Conversations/Message Cells/Content Views/DocumentView.swift b/Session/Conversations/Message Cells/Content Views/DocumentView.swift index ff2b2e73d..372befc8c 100644 --- a/Session/Conversations/Message Cells/Content Views/DocumentView.swift +++ b/Session/Conversations/Message Cells/Content Views/DocumentView.swift @@ -4,8 +4,7 @@ final class DocumentView : UIView { private let textColor: UIColor // MARK: Settings - private static let iconSize: CGFloat = 24 - private static let iconImageViewSize: CGFloat = 40 + private static let iconImageViewSize: CGSize = CGSize(width: 26, height: 40) // MARK: Lifecycle init(viewItem: ConversationViewItem, textColor: UIColor) { @@ -26,26 +25,23 @@ final class DocumentView : UIView { private func setUpViewHierarchy() { guard let attachment = viewItem.attachmentStream ?? viewItem.attachmentPointer else { return } // Image view - let iconSize = DocumentView.iconSize - let icon = UIImage(named: "actionsheet_document_black")?.withTint(textColor)?.resizedImage(to: CGSize(width: iconSize, height: iconSize)) + let icon = UIImage(named: "File")?.withTint(textColor) let imageView = UIImageView(image: icon) imageView.contentMode = .center let iconImageViewSize = DocumentView.iconImageViewSize - imageView.set(.width, to: iconImageViewSize) - imageView.set(.height, to: iconImageViewSize) + imageView.set(.width, to: iconImageViewSize.width) + imageView.set(.height, to: iconImageViewSize.height) // Body label let titleLabel = UILabel() titleLabel.lineBreakMode = .byTruncatingTail titleLabel.text = attachment.sourceFilename ?? "File" titleLabel.textColor = textColor - titleLabel.font = .systemFont(ofSize: Values.mediumFontSize) + titleLabel.font = .systemFont(ofSize: Values.mediumFontSize, weight: .light) // Stack view let stackView = UIStackView(arrangedSubviews: [ imageView, titleLabel ]) stackView.axis = .horizontal - stackView.alignment = .center - stackView.isLayoutMarginsRelativeArrangement = true - stackView.layoutMargins = UIEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 12) + stackView.spacing = Values.verySmallSpacing addSubview(stackView) - stackView.pin(to: self, withInset: Values.smallSpacing) + stackView.pin(to: self) } } diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index fe529aa51..db69e60e7 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -362,7 +362,6 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { let maxMessageWidth = VisibleMessageCell.getMaxWidth(for: viewItem) let albumView = MediaAlbumView(mediaCache: cache, items: viewItem.mediaAlbumItems!, isOutgoing: isOutgoing, maxMessageWidth: maxMessageWidth) self.albumView = albumView - snContentView.addSubview(albumView) let size = getSize(for: viewItem) albumView.set(.width, to: size.width) albumView.set(.height, to: size.height) @@ -398,9 +397,25 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { Storage.shared.getContact(with: thread.contactSessionID())?.isTrusted != true { showMediaPlaceholder() } else { + let inset: CGFloat = 12 + let maxWidth = VisibleMessageCell.getMaxWidth(for: viewItem) - 2 * inset + // Stack view + let stackView = UIStackView(arrangedSubviews: []) + stackView.axis = .vertical + stackView.spacing = Values.smallSpacing + // Document view let documentView = DocumentView(viewItem: viewItem, textColor: bodyLabelTextColor) - snContentView.addSubview(documentView) - documentView.pin(to: snContentView) + stackView.addArrangedSubview(documentView) + // Body text view + if let message = viewItem.interaction as? TSMessage, let body = message.body, body.count > 0, + let delegate = delegate { // delegate should always be set at this point + let bodyTextView = VisibleMessageCell.getBodyTextView(for: viewItem, with: maxWidth, textColor: bodyLabelTextColor, searchText: delegate.lastSearchedText, delegate: self) + self.bodyTextView = bodyTextView + stackView.addArrangedSubview(bodyTextView) + } + // Constraints + snContentView.addSubview(stackView) + stackView.pin(to: snContentView, withInset: inset) } case .deletedMessage: let deletedMessageView = DeletedMessageView(viewItem: viewItem, textColor: bodyLabelTextColor) diff --git a/Session/Meta/Images.xcassets/Session/File.imageset/Contents.json b/Session/Meta/Images.xcassets/Session/File.imageset/Contents.json new file mode 100644 index 000000000..df41b260e --- /dev/null +++ b/Session/Meta/Images.xcassets/Session/File.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "doc.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Session/Meta/Images.xcassets/Session/File.imageset/doc.pdf b/Session/Meta/Images.xcassets/Session/File.imageset/doc.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4338f23a167302e52ad9bce56015c86851f4cd0b GIT binary patch literal 4310 zcmai&2{=^W|HmyO456}9Zn7lXEVila%OtWVYs`$XZ;i1h##Xj05vGvHz7<6@_DK9p zvL}QrSrgfp|M;%`{@>s4`JLxJ_nzl-KIe1pJ?Ha&p4aCJ8)#@rLZ#qf;nwLN(+l}) zPd>D^f#CoI@IX6*FJA_vwVYh>SRCc)io#axeXXk4^MSI2t4F!yKZEj_T|xTA&S#}wLx{GaVYEDk)?O)ej=x^;07 z#_ka#nN|7Vq>yWTW)I`5kZdDDjIXF!90VcxImyZIc~u53#N3}q8iLT$e>%+^-5DSS zhiS}OaR|lJD%@igsln;m)N)8uk&|a&*i(C*(j@ByL6-9>%eI{sD2sPAfRy zEol!HSw+r^u8o3z@h6is1E1MNJ-4?oRpZRK}yY!0Yoied!+H%H6qq+)F6z z6r4R|@;l+RV=+SAS#$Gcr~to-ty1|(mHh34%_$$g6}IN8!B3SOcKS6Y6}9-1$!1V+ zq!2A(ua?+jWM{j~TY^z35YF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65I7VHfm=WzqLho`cg@4@$OZWCE`PtH9}a5|h5!gK*44Ua=P zxngm@{Vp(e3cvygN`2(vfd`I`ic%|SyW4vJN2hSq*PtBgWwac|4uzFhz{uI#!(j+n sCT7}j4{>LHjQ{`u literal 0 HcmV?d00001 From 300f6f50cfd32548926fec27607407ea390455c1 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 7 Dec 2021 15:25:05 +1100 Subject: [PATCH 02/15] add size label for file type attachment --- .../Content Views/DocumentView.swift | 16 +++++++++++++--- .../Session/File.imageset/doc.pdf | Bin 4310 -> 4296 bytes SignalUtilitiesKit/Utilities/OWSFormat.m | 8 ++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Session/Conversations/Message Cells/Content Views/DocumentView.swift b/Session/Conversations/Message Cells/Content Views/DocumentView.swift index 372befc8c..5f0717ae6 100644 --- a/Session/Conversations/Message Cells/Content Views/DocumentView.swift +++ b/Session/Conversations/Message Cells/Content Views/DocumentView.swift @@ -4,7 +4,7 @@ final class DocumentView : UIView { private let textColor: UIColor // MARK: Settings - private static let iconImageViewSize: CGSize = CGSize(width: 26, height: 40) + private static let iconImageViewSize: CGSize = CGSize(width: 31, height: 40) // MARK: Lifecycle init(viewItem: ConversationViewItem, textColor: UIColor) { @@ -36,11 +36,21 @@ final class DocumentView : UIView { titleLabel.lineBreakMode = .byTruncatingTail titleLabel.text = attachment.sourceFilename ?? "File" titleLabel.textColor = textColor - titleLabel.font = .systemFont(ofSize: Values.mediumFontSize, weight: .light) + titleLabel.font = .systemFont(ofSize: Values.smallFontSize, weight: .light) + // Size label + let sizeLabel = UILabel() + sizeLabel.lineBreakMode = .byTruncatingTail + sizeLabel.text = OWSFormat.formatFileSize(UInt(attachment.byteCount)) + sizeLabel.textColor = textColor + sizeLabel.font = .systemFont(ofSize: Values.verySmallFontSize) + // Label stack view + let labelStackView = UIStackView(arrangedSubviews: [ titleLabel, sizeLabel ]) + labelStackView.axis = .vertical // Stack view - let stackView = UIStackView(arrangedSubviews: [ imageView, titleLabel ]) + let stackView = UIStackView(arrangedSubviews: [ imageView, labelStackView ]) stackView.axis = .horizontal stackView.spacing = Values.verySmallSpacing + stackView.alignment = .center addSubview(stackView) stackView.pin(to: self) } diff --git a/Session/Meta/Images.xcassets/Session/File.imageset/doc.pdf b/Session/Meta/Images.xcassets/Session/File.imageset/doc.pdf index 4338f23a167302e52ad9bce56015c86851f4cd0b..50b0bb95e305d5ec08a8abfe36b2e38bed9550be 100644 GIT binary patch delta 974 zcmcbnctUZ4eZ9G*f}I^#aY<2XVlGz&V`_+ZU$7(3o&CXISTk= zoa!jo@+-W*v`af8Wm0CU^2E%KK3i|N?ykAiS};ZOp-=CPO*szJAN89Wi-u12>GqK9 zv3Yjp0sFBGV?IZ@iL65NR%#b9Oe|UNW^%Dg*==K)-n)Vi%*96;*e{lBzjAI%J8#0$ zTXowSkFPy0+01yR$gRn*{!5M7Y6JbMPr}a~C8lXF48P+0vMug_RF>QBnW=q?0@ihX ze!#N6@jFw^Gp=J-{GMET@|7#=p~3kZGb6huO1{c!WMVCtdZer&WE+FY$F&P?n?;`G zW>gjYckjghXVpFLZ5yK0X1vtd$oH?ZVdu0PypA49nNQU!U8<8db-tC?V|iI0byhO< ztx1L8k*l0%_Oi}+__UHSp)|NP;&0Y*p0XXS2Br}YT9T}`pFVd)LM8l1;bwKYm1XmG zA9Kpx8-15;%@w80X~*A*9$N5A_~4ZcBdtzp=KrmZA^e-xy*!do$#ZHUqi-r_MnevF z_obamlD8RB4$AMHu|eyhc$E9fHxV8ReD%#qbBmR>z{ST zKK|VhYkX|y3fF)qQywxj?Oqshpt7@7b`8gsQtw>`G0XY=9HfI*d@ecm_{V+S^&bRY zUH|sfj{VV=^HN_5@>eIhnqBke{{Dt}RDYNeL?x`ks5=;#@FqH z>x<=LEl*zmxcYkPABp+<_gt*l)4SC^zyBkrMap5(Mz8aiPgmVLQO*(a{z7BHF{{SE zRTa+nk8l6@iCu+NW%Fi6<_>OFBNGK5d$7MrMi9#$S ZuO=3iR1~GAaT!~h8F8tqy863u0RR?;l%N0r delta 988 zcmX@1cujGFeZ8fzf}I^#aY<2XVlGz&V`_+J-)#q;J+DRoHkRzzTzQWB*%WpO4z&hh zg&F^uHBU`?Rulo8VP{SaFLECFO8UtGn;vq#Fjz?6+ijx=vT=85_Agj}cYsRp|;>cFa={&rm-z*WEa4 z?G2Z-R!=il9&bT2mYBT~oF6|>4Ypj6Q>G|9DkX-enD zw5TvAvANa-)p^fb-d(8o@iw|9x%DH@8iAi3j?t|w3NC3jv$o%Q^-rSph~omsW+R># zH<+|4nr^Ww+)$R!?4OZs_&r^!?C8w59SS)Tr{D1wt27H6i!?m?(6}>WwWV{G>-Viq z@-iU_cI$;4mjC?s{c)M}dx1k+uHV`$n&Q7BWW%nKHIELl)VHZHH~!f*tNvn8#+_&0 z%BilV^CnatEaOn0`b~a~@69Gh?tX$&ve|a;t}jdayzOdB$TjvP;X2b5zL#A$eCKXl za&ujeIM1ayH#8GZmnQiyEPiw&Y_E>80juN3;#A#QpBp<~%Xh#1tha*Y!3SslS8Me1 zUVQ#}-L$-7<@s5K948VkMoG)r917m{`|AM(Ke3gI=Omk~{nH{cr6+cs@~Z1ACjOf- zG0{DL$E!74_e;%>dZbt>fB*RVeRDq+*Zlp~`2AV(g@3I5_qY2$eiOgrr){zMGgAjQtD&WWk;&u+zWo};hK2^lQ3eL; zK%}Xl@0*|El30?epy6U=WME`yXk=h+09G&t!d$@s1QhZVxWEhpV>1h*$y@o= zg3Pc;nP7++SQ?vR7-4Q^j3H)WXf#<@z$QM)EIB1H)!ZW4EG^C0$kNm>*}&4$+%m<& o($L5vF)7)O%Z8v5g;+?=O)M&@C`wJ^GPX1~<5E?1^>^a}09Lk;@&Et; diff --git a/SignalUtilitiesKit/Utilities/OWSFormat.m b/SignalUtilitiesKit/Utilities/OWSFormat.m index effb40f4e..db48cb8c7 100644 --- a/SignalUtilitiesKit/Utilities/OWSFormat.m +++ b/SignalUtilitiesKit/Utilities/OWSFormat.m @@ -31,11 +31,11 @@ NS_ASSUME_NONNULL_BEGIN const unsigned long kOneKilobyte = 1024; const unsigned long kOneMegabyte = kOneKilobyte * kOneKilobyte; - if (fileSize > kOneMegabyte * 10) { - return [[formatter stringFromNumber:@((int)round(fileSize / (CGFloat)kOneMegabyte))] + if (fileSize > kOneMegabyte) { + return [[formatter stringFromNumber:@((double)lround(fileSize * 100 / (CGFloat)kOneMegabyte) / 100)] stringByAppendingString:@" MB"]; - } else if (fileSize > kOneKilobyte * 10) { - return [[formatter stringFromNumber:@((int)round(fileSize / (CGFloat)kOneKilobyte))] + } else if (fileSize > kOneKilobyte) { + return [[formatter stringFromNumber:@((double)lround(fileSize * 100 / (CGFloat)kOneKilobyte) / 100)] stringByAppendingString:@" KB"]; } else { return [NSString stringWithFormat:@"%lu Bytes", fileSize]; From 6225c12ced490b89685b952e3e7175f6e98f6c03 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 7 Dec 2021 15:53:58 +1100 Subject: [PATCH 03/15] minor improvement on pre-sending file page icon --- .../Session/FileLarge.imageset/Contents.json | 12 ++++++++++++ .../Session/FileLarge.imageset/doc_large.pdf | Bin 0 -> 4310 bytes .../MediaMessageView.swift | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 Session/Meta/Images.xcassets/Session/FileLarge.imageset/Contents.json create mode 100644 Session/Meta/Images.xcassets/Session/FileLarge.imageset/doc_large.pdf diff --git a/Session/Meta/Images.xcassets/Session/FileLarge.imageset/Contents.json b/Session/Meta/Images.xcassets/Session/FileLarge.imageset/Contents.json new file mode 100644 index 000000000..667dcde62 --- /dev/null +++ b/Session/Meta/Images.xcassets/Session/FileLarge.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "doc_large.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Session/Meta/Images.xcassets/Session/FileLarge.imageset/doc_large.pdf b/Session/Meta/Images.xcassets/Session/FileLarge.imageset/doc_large.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9dd80473784a71539430605998372fd618df65c GIT binary patch literal 4310 zcmai&2UHVVx5p_#ARt94f`}thL|PJRq}PD-BGMrt0YaA!iWDgVLAn%0dJ`!MDuQ&R z2$#?i6_DOL(vcUu*L(fm{oZl&dm7{*Y#CRlk&ZZV(k z^XMs)#$M;SZIy1t5gYS%E$6GE#zHObh3h6Q&9}Sqo|HjzvQ@*wCRZMy9-(e;Hr}w6 zAd4wf$WzLT|4xZy=TB9OSz*CYG)sP73x5;#8HH_u7bM{6xs#$@7vopQqB?Id-jEZL z7i`9GgS#8EqUXyok3(AFnC}l|$gWDO`iHQ>&{s@au;T-Pj3!zw2ynvULnD*u#G-_c zs+6$?*IuPao{!-#vTuJ4$=C^}8w+IfP>&|l%2lNKc8AYRUh;yz8eH$Pd`~m!l(&&ukw=mbojU*t|{&0JvHDqdmV{`{a>0oz{D$7c8fshjP01=`dv zEnfHxv6##T9w0R+nG;wvnJ|iN&l6*k*C>{JMiB#5V!sW+RYSb@t9mL}Q6M zHSdljjSRV(K5J3v%#yk5Hl+iHY&J8}vfMkI)*)@)hHR>fjD&&x11)jyh-Tw=9nmEf z_G!COn5^;y(^DhU>2EZe=ASenf}lzXuj7FR(s%*>ex9tacLcJBc;KE@Q*1$p%_J%D zP9<}@){;MjJ7}gdy>DrLWmRbo_V-z$6ewUPpJ?!te;HDemg%_mJzB1Zw+C!yt{Y3s ztb%U7w{rY=^W*sJp2_)7e8;)6u0B032S27rEsipMkM2v&UvzauIE5Ckul0pJW!?yO zT@s|2sB#e4|6VTpw1@9FJGnkighK?3aYp}@zl7dt(nEhsegj`uLbmH5ZGYa~FwPzT zj4-SR2Fbin{+y@jk-$8Gov^M%C!>Ft+BM@HskS;xwpe3wrl>w)kHc+ z!JsA&BjP}jEF*^1rAD)J=Q~?=NiNV4(-;vqOxW0f5PM1_14p&esi}pktra_~f`RCo zFZ}g7-0nj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_kFxU0w`rA#g-b?nD)MQL{v1BI+M3b2jYYBAVO35u5z-nda@C}amBO> z&IAYKOEX=*$at62%dKd)Z&W>eYIzbowJIoV_PApCv)k*LqE38itYxF|o$KruFJBs` zJBc{oR5YVex^4N+dj>R|P!oO_KiA4P7rkM=hdGJ^C5OBU=~YT@F^{lTD^+7unGDt3hxwjCu#+{O=%oII5Ik}jM`L`*ndgpu;~4c>YR+6)aLpczcg;_e|vwlYbRu- zHg6~I(EFPgh4R=YgfXKqlegQo;|i)zK>maz2;QA;97C~c&g-49hv{! zf%&1(*iN5WJGNe)%H{!UUw`&o zw&ZwlZ`h`&c6&K<*a~0q&^9KlN>S(}X}?UnnG9cq=ToUvSwxf|@VI^4sNc)&59^({ zD9dfp#zc9VLGGwypI*4m;vTGkzUmr`YKjuqCy4~BM}=Fs!g{odHM{DR1_;yT%# zpyRAV>+QCn|F=*hF zRrLV#U-)~<%fImVADngvgfuZ|EKGI~%8QD^&3FM_Po$fNA3%WhpM3A*!AoFtLbdBbn50C&Z}2sx8!!kA z3WY($AtItMVWcKPQWecUiMU2@nZS!zL zVjVGVKYthKWBo7yoKPRRxOf1kM@6WW)SPWxfYVbr?JE%uRSF{p#faHhqv0qtQbYtQ uApwPoi&@))GT{H;< Date: Wed, 8 Dec 2021 15:29:44 +1100 Subject: [PATCH 04/15] make avatar more clear --- .../Media Viewing & Editing/CropScaleImageViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session/Media Viewing & Editing/CropScaleImageViewController.swift b/Session/Media Viewing & Editing/CropScaleImageViewController.swift index c37bdef4b..7703f137a 100644 --- a/Session/Media Viewing & Editing/CropScaleImageViewController.swift +++ b/Session/Media Viewing & Editing/CropScaleImageViewController.swift @@ -42,7 +42,7 @@ import SignalUtilitiesKit // // TODO: We could make this a parameter. var dstSizePixels: CGSize { - return CGSize(width: 210, height: 210) + return CGSize(width: 640, height: 640) } var dstAspectRatio: CGFloat { return dstSizePixels.width / dstSizePixels.height From e24ae60d7170c865d651baaa3a47b1f5be8b0053 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 9 Dec 2021 13:55:17 +1100 Subject: [PATCH 05/15] fix duplicated disappearing message in closed groups --- .../Sending & Receiving/MessageSender.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SessionMessagingKit/Sending & Receiving/MessageSender.swift b/SessionMessagingKit/Sending & Receiving/MessageSender.swift index e9042b81f..fcb4f1a54 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageSender.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageSender.swift @@ -355,6 +355,10 @@ public final class MessageSender : NSObject { // Start the disappearing messages timer if needed OWSDisappearingMessagesJob.shared().startAnyExpiration(for: tsMessage, expirationStartedAt: NSDate.millisecondTimestamp(), transaction: transaction) } + // Prevent the same ExpirationTimerUpdate to be handled twice + if let message = message as? ExpirationTimerUpdate { + Storage.shared.addReceivedMessageTimestamp(message.sentTimestamp!, using: transaction) + } // Sync the message if: // • it's a visible message or an expiration timer update // • the destination was a contact @@ -362,11 +366,7 @@ public final class MessageSender : NSObject { let userPublicKey = getUserHexEncodedPublicKey() if case .contact(let publicKey) = destination, !isSyncMessage { if let message = message as? VisibleMessage { message.syncTarget = publicKey } - if let message = message as? ExpirationTimerUpdate { - message.syncTarget = publicKey - // Prevent the same ExpirationTimerUpdate to be handled twice - Storage.shared.addReceivedMessageTimestamp(message.sentTimestamp!, using: transaction) - } + if let message = message as? ExpirationTimerUpdate { message.syncTarget = publicKey } // FIXME: Make this a job sendToSnodeDestination(.contact(publicKey: userPublicKey), message: message, using: transaction, isSyncMessage: true).retainUntilComplete() } From bbccbe42c13a156c2339b4ff8b4765d0aef6651b Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Mon, 13 Dec 2021 15:51:42 +1100 Subject: [PATCH 06/15] copy / paste images directly --- .../ConversationVC+Interaction.swift | 10 ++++++++++ .../Input View/InputTextView.swift | 17 +++++++++++++++++ .../Conversations/Input View/InputView.swift | 5 +++++ .../SendMediaNavigationController.swift | 11 +++++++++++ 4 files changed, 43 insertions(+) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 809d9f165..5a56aab8e 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -49,6 +49,16 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc } // MARK: Attachments + func didPasteImageFromPasteboard(_ image: UIImage) { + guard let imageData = image.jpegData(compressionQuality: 1.0) else { return } + let dataSource = DataSourceValue.dataSource(with: imageData, utiType: kUTTypeJPEG as String) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium) + + let sendMediaNavController = SendMediaNavigationController.showingWithImage(attachment, delegate: self) + sendMediaNavController.modalPresentationStyle = .fullScreen + self.present(sendMediaNavController, animated: true, completion: nil) + } + func sendMediaNavDidCancel(_ sendMediaNavigationController: SendMediaNavigationController) { dismiss(animated: true, completion: nil) } diff --git a/Session/Conversations/Input View/InputTextView.swift b/Session/Conversations/Input View/InputTextView.swift index 57546e407..69c61da67 100644 --- a/Session/Conversations/Input View/InputTextView.swift +++ b/Session/Conversations/Input View/InputTextView.swift @@ -37,6 +37,22 @@ public final class InputTextView : UITextView, UITextViewDelegate { public required init?(coder: NSCoder) { preconditionFailure("Use init(delegate:) instead.") } + + public override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { + if action == #selector(paste(_:)) { + if let _ = UIPasteboard.general.image { + return true + } + } + return super.canPerformAction(action, withSender: sender) + } + + public override func paste(_ sender: Any?) { + if let image = UIPasteboard.general.image { + snDelegate?.didPasteImageFromPasteboard(self, image: image) + } + super.paste(sender) + } private func setUpViewHierarchy() { showsHorizontalScrollIndicator = false @@ -80,4 +96,5 @@ protocol InputTextViewDelegate : AnyObject { func inputTextViewDidChangeSize(_ inputTextView: InputTextView) func inputTextViewDidChangeContent(_ inputTextView: InputTextView) + func didPasteImageFromPasteboard(_ inputTextView: InputTextView, image: UIImage) } diff --git a/Session/Conversations/Input View/InputView.swift b/Session/Conversations/Input View/InputView.swift index 599af7599..9b78dc9e6 100644 --- a/Session/Conversations/Input View/InputView.swift +++ b/Session/Conversations/Input View/InputView.swift @@ -143,6 +143,10 @@ final class InputView : UIView, InputViewButtonDelegate, InputTextViewDelegate, autoGenerateLinkPreviewIfPossible() delegate?.inputTextViewDidChangeContent(inputTextView) } + + func didPasteImageFromPasteboard(_ inputTextView: InputTextView, image: UIImage) { + delegate?.didPasteImageFromPasteboard(image) + } // We want to show either a link preview or a quote draft, but never both at the same time. When trying to // generate a link preview, wait until we're sure that we'll be able to build a link preview from the given @@ -351,4 +355,5 @@ protocol InputViewDelegate : AnyObject, ExpandingAttachmentsButtonDelegate, Voic func handleQuoteViewCancelButtonTapped() func inputTextViewDidChangeContent(_ inputTextView: InputTextView) func handleMentionSelected(_ mention: Mention, from view: MentionSelectionView) + func didPasteImageFromPasteboard(_ image: UIImage) } diff --git a/Session/Media Viewing & Editing/SendMediaNavigationController.swift b/Session/Media Viewing & Editing/SendMediaNavigationController.swift index de975713e..ff49dc45c 100644 --- a/Session/Media Viewing & Editing/SendMediaNavigationController.swift +++ b/Session/Media Viewing & Editing/SendMediaNavigationController.swift @@ -58,6 +58,17 @@ class SendMediaNavigationController: OWSNavigationController { @objc public weak var sendMediaNavDelegate: SendMediaNavDelegate? + + @objc class func showingWithImage(_ attachment: SignalAttachment, delegate: SendMediaNavDelegate) -> SendMediaNavigationController { + let navController = SendMediaNavigationController() + navController.sendMediaNavDelegate = delegate + let approvalViewController = AttachmentApprovalViewController(mode: .modal, attachments: [ attachment ]) + approvalViewController.approvalDelegate = navController + approvalViewController.messageText = delegate.sendMediaNavInitialMessageText(navController) + navController.setViewControllers([approvalViewController], animated: false) + + return navController + } @objc public class func showingCameraFirst() -> SendMediaNavigationController { From d74af622bcbd95754ffe27b5bb52c9e3e568ab2e Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Mon, 13 Dec 2021 16:22:45 +1100 Subject: [PATCH 07/15] fix photos from original camera is rotated in the preview page --- .../Image Editing/ImageEditorCanvasView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorCanvasView.swift b/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorCanvasView.swift index 12fae43f5..92e4f93c1 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorCanvasView.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorCanvasView.swift @@ -166,7 +166,7 @@ public class ImageEditorCanvasView: UIView { // of code simplicity. We could modify the image layer's // transform to handle the normalization, which would // have perf benefits. - return srcImage + return srcImage.normalized() } // MARK: - Content From a356b080d0a0733eab8218be47c2b02ccfd45be6 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Mon, 13 Dec 2021 16:32:15 +1100 Subject: [PATCH 08/15] Do not show user details to prevent spam --- Session/Conversations/Message Cells/VisibleMessageCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index fe529aa51..9742f9955 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -468,6 +468,7 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { let location = gestureRecognizer.location(in: self) if profilePictureView.frame.contains(location) && VisibleMessageCell.shouldShowProfilePicture(for: viewItem) { guard let message = viewItem.interaction as? TSIncomingMessage else { return } + guard !message.isOpenGroupMessage else { return } // Do not show user details to prevent spam delegate?.showUserDetails(for: message.authorId) } else if replyButton.frame.contains(location) { UIImpactFeedbackGenerator(style: .heavy).impactOccurred() From 324c421b46681ee3ad676ca4e37b9241f884d1c0 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 14 Dec 2021 11:43:40 +1100 Subject: [PATCH 09/15] rough fix on video progress bar UI --- Session/Media Viewing & Editing/MediaDetailViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session/Media Viewing & Editing/MediaDetailViewController.m b/Session/Media Viewing & Editing/MediaDetailViewController.m index 1e19acaf4..446000b80 100644 --- a/Session/Media Viewing & Editing/MediaDetailViewController.m +++ b/Session/Media Viewing & Editing/MediaDetailViewController.m @@ -257,7 +257,7 @@ NS_ASSUME_NONNULL_BEGIN self.videoProgressBar = videoProgressBar; [self.view addSubview:videoProgressBar]; [videoProgressBar autoPinWidthToSuperview]; - [videoProgressBar autoPinEdge:ALEdgeTop toEdge:ALEdgeTop ofView:self.view withOffset:0.0f]; + [videoProgressBar autoPinEdgeToSuperviewSafeArea:ALEdgeTop]; CGFloat kVideoProgressBarHeight = 44; [videoProgressBar autoSetDimension:ALDimensionHeight toSize:kVideoProgressBarHeight]; From 5803eae134279d1765df83746dba2d1f95b60d12 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 14 Dec 2021 15:12:48 +1100 Subject: [PATCH 10/15] clean --- .../Conversations/ConversationVC+Interaction.swift | 6 +++--- .../SendMediaNavigationController.swift | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 5a56aab8e..61ff20d9f 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -54,9 +54,9 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc let dataSource = DataSourceValue.dataSource(with: imageData, utiType: kUTTypeJPEG as String) let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium) - let sendMediaNavController = SendMediaNavigationController.showingWithImage(attachment, delegate: self) - sendMediaNavController.modalPresentationStyle = .fullScreen - self.present(sendMediaNavController, animated: true, completion: nil) + let approvalVC = AttachmentApprovalViewController.wrappedInNavController(attachments: [ attachment ], approvalDelegate: self) + approvalVC.modalPresentationStyle = .fullScreen + self.present(approvalVC, animated: true, completion: nil) } func sendMediaNavDidCancel(_ sendMediaNavigationController: SendMediaNavigationController) { diff --git a/Session/Media Viewing & Editing/SendMediaNavigationController.swift b/Session/Media Viewing & Editing/SendMediaNavigationController.swift index ff49dc45c..de975713e 100644 --- a/Session/Media Viewing & Editing/SendMediaNavigationController.swift +++ b/Session/Media Viewing & Editing/SendMediaNavigationController.swift @@ -58,17 +58,6 @@ class SendMediaNavigationController: OWSNavigationController { @objc public weak var sendMediaNavDelegate: SendMediaNavDelegate? - - @objc class func showingWithImage(_ attachment: SignalAttachment, delegate: SendMediaNavDelegate) -> SendMediaNavigationController { - let navController = SendMediaNavigationController() - navController.sendMediaNavDelegate = delegate - let approvalViewController = AttachmentApprovalViewController(mode: .modal, attachments: [ attachment ]) - approvalViewController.approvalDelegate = navController - approvalViewController.messageText = delegate.sendMediaNavInitialMessageText(navController) - navController.setViewControllers([approvalViewController], animated: false) - - return navController - } @objc public class func showingCameraFirst() -> SendMediaNavigationController { From c5635a39ddcaca6e606e5b8428a665e090641808 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Tue, 14 Dec 2021 15:51:17 +1100 Subject: [PATCH 11/15] set nickname to a person that never talked to --- .../Settings/OWSConversationSettingsViewController.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/Settings/OWSConversationSettingsViewController.m b/Session/Conversations/Settings/OWSConversationSettingsViewController.m index b703a58ff..345a09bc5 100644 --- a/Session/Conversations/Settings/OWSConversationSettingsViewController.m +++ b/Session/Conversations/Settings/OWSConversationSettingsViewController.m @@ -1025,8 +1025,11 @@ CGFloat kIconViewLength = 24; - (void)saveName { if (![self.thread isKindOfClass:TSContactThread.class]) { return; } - SNContact *contact = [LKStorage.shared getContactWithSessionID:((TSContactThread *)self.thread).contactSessionID]; - if (contact == nil) { return; } + NSString *sessionID = ((TSContactThread *)self.thread).contactSessionID; + SNContact *contact = [LKStorage.shared getContactWithSessionID:sessionID]; + if (contact == nil) { + contact = [[SNContact alloc] initWithSessionID:sessionID]; + } NSString *text = [self.displayNameTextField.text stringByTrimmingCharactersInSet:NSCharacterSet.whitespaceAndNewlineCharacterSet]; contact.nickname = text.length > 0 ? text : nil; [LKStorage writeWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { From 9e373dc3d1dc8def96e6b54fdc3fc1437321f1e0 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Wed, 15 Dec 2021 16:32:45 +1100 Subject: [PATCH 12/15] do not show copy session id option when long press messages in open groups --- .../Conversations/Context Menu/ContextMenuVC+Action.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift index 0bc15e9ba..57d0168e6 100644 --- a/Session/Conversations/Context Menu/ContextMenuVC+Action.swift +++ b/Session/Conversations/Context Menu/ContextMenuVC+Action.swift @@ -56,7 +56,9 @@ extension ContextMenuVC { if isReplyingAllowed() { result.append(Action.reply(viewItem, delegate)) } result.append(Action.copy(viewItem, delegate)) let isGroup = viewItem.isGroupThread - if isGroup && viewItem.interaction is TSIncomingMessage { result.append(Action.copySessionID(viewItem, delegate)) } + if let message = viewItem.interaction as? TSIncomingMessage, isGroup, !message.isOpenGroupMessage { + result.append(Action.copySessionID(viewItem, delegate)) + } if !isGroup || viewItem.userCanDeleteGroupMessage { result.append(Action.delete(viewItem, delegate)) } if isGroup && viewItem.interaction is TSIncomingMessage && viewItem.userHasModerationPermission { result.append(Action.ban(viewItem, delegate)) @@ -69,7 +71,9 @@ extension ContextMenuVC { if viewItem.canCopyMedia() { result.append(Action.copy(viewItem, delegate)) } if viewItem.canSaveMedia() { result.append(Action.save(viewItem, delegate)) } let isGroup = viewItem.isGroupThread - if isGroup && viewItem.interaction is TSIncomingMessage { result.append(Action.copySessionID(viewItem, delegate)) } + if let message = viewItem.interaction as? TSIncomingMessage, isGroup, !message.isOpenGroupMessage { + result.append(Action.copySessionID(viewItem, delegate)) + } if !isGroup || viewItem.userCanDeleteGroupMessage { result.append(Action.delete(viewItem, delegate)) } if isGroup && viewItem.interaction is TSIncomingMessage && viewItem.userHasModerationPermission { result.append(Action.ban(viewItem, delegate)) From 19cb916fa15f23f499e7d9290af2f887ba2e841c Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Thu, 16 Dec 2021 13:28:28 +1100 Subject: [PATCH 13/15] update version & build number --- Session.xcodeproj/project.pbxproj | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index eb3fd9e22..31c99ef26 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5049,7 +5049,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5074,7 +5074,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5122,7 +5122,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5152,7 +5152,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5188,7 +5188,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5211,7 +5211,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -5262,7 +5262,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5290,7 +5290,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -6198,7 +6198,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6237,7 +6237,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; @@ -6269,7 +6269,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 312; + CURRENT_PROJECT_VERSION = 315; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6308,7 +6308,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.11.19; + MARKETING_VERSION = 1.11.20; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; PRODUCT_NAME = Session; From 5e9695d234460de2821b128622c19fd0016910ea Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Thu, 16 Dec 2021 16:22:44 +1100 Subject: [PATCH 14/15] disable typing indicators and read receipts by default --- Session/Meta/AppDelegate.m | 3 --- .../Typing Indicators/TypingIndicators.swift | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Session/Meta/AppDelegate.m b/Session/Meta/AppDelegate.m index cc8ffc692..000af7460 100644 --- a/Session/Meta/AppDelegate.m +++ b/Session/Meta/AppDelegate.m @@ -531,9 +531,6 @@ static NSTimeInterval launchStartedAt; // enables this feature [self.disappearingMessagesJob startIfNecessary]; - // For non-legacy users, read receipts are on by default. - [self.readReceiptManager setAreReadReceiptsEnabled:YES]; - [self startPollerIfNeeded]; [self startClosedGroupPoller]; [self startOpenGroupPollersIfNeeded]; diff --git a/SessionMessagingKit/Sending & Receiving/Typing Indicators/TypingIndicators.swift b/SessionMessagingKit/Sending & Receiving/Typing Indicators/TypingIndicators.swift index fe2bd3d1b..2639466db 100644 --- a/SessionMessagingKit/Sending & Receiving/Typing Indicators/TypingIndicators.swift +++ b/SessionMessagingKit/Sending & Receiving/Typing Indicators/TypingIndicators.swift @@ -63,7 +63,7 @@ public class TypingIndicatorsImpl : NSObject, TypingIndicators { } private func setup() { - _areTypingIndicatorsEnabled = OWSPrimaryStorage.shared().dbReadConnection.bool(forKey: kDatabaseKey_TypingIndicatorsEnabled, inCollection: kDatabaseCollection, defaultValue: true) + _areTypingIndicatorsEnabled = OWSPrimaryStorage.shared().dbReadConnection.bool(forKey: kDatabaseKey_TypingIndicatorsEnabled, inCollection: kDatabaseCollection, defaultValue: false) } // MARK: - From 7a22c9d32968f3e78ce937e9d47426b6072d93b3 Mon Sep 17 00:00:00 2001 From: Ryan Zhao Date: Thu, 16 Dec 2021 16:24:23 +1100 Subject: [PATCH 15/15] update build number --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 31c99ef26..97ce6a4b5 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5049,7 +5049,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5122,7 +5122,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5188,7 +5188,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5262,7 +5262,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6198,7 +6198,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6269,7 +6269,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 315; + CURRENT_PROJECT_VERSION = 316; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)",