Skip to content

Commit a0f6747

Browse files
committed
Merge branch 'next' into devel
2 parents 111334d + b508107 commit a0f6747

File tree

13 files changed

+571
-348
lines changed

13 files changed

+571
-348
lines changed

TinodeSDK.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@
285285
hasScannedForEncodings = 0;
286286
knownRegions = (
287287
en,
288+
Base,
288289
);
289290
mainGroup = 0A431BD22244A0BE00A837F7;
290291
productRefGroup = 0A431BDD2244A0BE00A837F7 /* Products */;

Tinodios.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@
196196
B02F5C8A22679BC80079A97E /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; };
197197
B031BE542263075E004160AE /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
198198
B05ACEB222FDAB5200276713 /* ResetPasswordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetPasswordViewController.swift; sourceTree = "<group>"; };
199-
B0762A9F244EE94300385B65 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
200199
B079062423EEA0C90019ED75 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
200+
B093F50126C5BBF300FAA4E8 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
201+
B093F50426C5BD4200FAA4E8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
202+
B093F50526C5BD8800FAA4E8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
201203
B0941BC42487CEE100A891B7 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Main.strings; sourceTree = "<group>"; };
202204
B0941BC52487CEE100A891B7 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
203205
B0941BC62487CEE100A891B7 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -222,7 +224,6 @@
222224
B0CEF8DA26B603E3000028C2 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
223225
B0CEF8DB26B603E4000028C2 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
224226
B0CF83DD244DFB1C00E79D22 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
225-
B0CF83E1244E074A00E79D22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
226227
B0CF83E3244E074E00E79D22 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
227228
B0DF03162279F027000F9492 /* RoundImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundImageView.swift; sourceTree = "<group>"; };
228229
B0DF0318227C2517000F9492 /* MessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageView.swift; sourceTree = "<group>"; };
@@ -725,10 +726,10 @@
725726
children = (
726727
0A0380DC21B3CC8100A3FA0E /* Base */,
727728
B0CF83DD244DFB1C00E79D22 /* zh-Hans */,
728-
B0762A9F244EE94300385B65 /* en */,
729729
B0941BC42487CEE100A891B7 /* es */,
730730
B0CEF8D726B5EC21000028C2 /* zh-Hant */,
731731
B0CEF8D926B603E3000028C2 /* ru */,
732+
B093F50426C5BD4200FAA4E8 /* en */,
732733
);
733734
name = Main.storyboard;
734735
sourceTree = "<group>";
@@ -748,10 +749,11 @@
748749
B0CF83E2244E074A00E79D22 /* Localizable.strings */ = {
749750
isa = PBXVariantGroup;
750751
children = (
751-
B0CF83E1244E074A00E79D22 /* en */,
752752
B0CF83E3244E074E00E79D22 /* zh-Hans */,
753753
B0941BC62487CEE100A891B7 /* es */,
754754
B0CEF8DB26B603E4000028C2 /* ru */,
755+
B093F50126C5BBF300FAA4E8 /* zh-Hant */,
756+
B093F50526C5BD8800FAA4E8 /* en */,
755757
);
756758
name = Localizable.strings;
757759
sourceTree = "<group>";

Tinodios/Base.lproj/Main.storyboard

Lines changed: 229 additions & 179 deletions
Large diffs are not rendered by default.

Tinodios/TopicInfoViewController.swift

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import TinodiosDB
1111

1212
class TopicInfoViewController: UITableViewController {
1313

14-
// Number of rows in every section. '-1' means variable number of items
1514
private static let kSectionBasic = 0
15+
private static let kSectionBasicLastSeen = 2
1616

1717
private static let kSectionMute = 1
1818

@@ -42,6 +42,7 @@ class TopicInfoViewController: UITableViewController {
4242
@IBOutlet weak var loadAvatarButton: UIButton!
4343
@IBOutlet weak var mutedSwitch: UISwitch!
4444
@IBOutlet weak var topicIDLabel: UILabel!
45+
@IBOutlet weak var lastSeenTimestampLabel: UILabel!
4546

4647
@IBOutlet weak var actionMyPermissions: UITableViewCell!
4748
@IBOutlet weak var myPermissionsLabel: UILabel!
@@ -191,6 +192,20 @@ class TopicInfoViewController: UITableViewController {
191192
mutedSwitch.isOn = topic.isMuted
192193
let acs = topic.accessMode
193194

195+
if let ts = topic?.lastSeen?.when {
196+
var date: String
197+
if #available(iOS 13.0, *) {
198+
let formatter = RelativeDateTimeFormatter()
199+
formatter.unitsStyle = .short
200+
date = formatter.localizedString(for: ts, relativeTo: Date())
201+
} else {
202+
// Fallback on earlier versions
203+
date = RelativeDateFormatter.shared.shortDate(from: ts)
204+
}
205+
206+
self.lastSeenTimestampLabel?.text = date
207+
}
208+
194209
if self.topic.isGrpType {
195210
authUsersPermissionsLabel?.text = topic.defacs?.getAuth()
196211
anonUsersPermissionsLabel?.text = topic.defacs?.getAnon()
@@ -474,9 +489,9 @@ extension TopicInfoViewController {
474489
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
475490
if indexPath.section == TopicInfoViewController.kSectionMembers && indexPath.row != 0 {
476491
return 60
477-
}
478-
479-
if indexPath.section == TopicInfoViewController.kSectionActions {
492+
} else if indexPath.section == TopicInfoViewController.kSectionBasic && indexPath.row == TopicInfoViewController.kSectionBasicLastSeen && topic?.lastSeen == nil {
493+
return CGFloat.leastNonzeroMagnitude
494+
} else if indexPath.section == TopicInfoViewController.kSectionActions {
480495
if indexPath.row == TopicInfoViewController.kSectionActionsManageTags && (!(topic?.isGrpType ?? false) || !(topic?.isOwner ?? false)) {
481496
// P2P topic has no owner, hide [Manage Tags]
482497
return CGFloat.leastNonzeroMagnitude

Tinodios/en.lproj/Main.strings

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
/* Class = "UITableViewSection"; headerTitle = "Group Members"; ObjectID = "26s-2T-nI0"; */
1515
"26s-2T-nI0.headerTitle" = "Group Members";
1616

17-
/* Class = "UITableViewSection"; headerTitle = "Notifications"; ObjectID = "3gX-G0-wiF"; */
17+
/* */
1818
"3gX-G0-wiF.headerTitle" = "Notifications";
1919

20-
/* Class = "UIBarButtonItem"; title = "Item"; ObjectID = "3zN-CC-6bS"; */
21-
"3zN-CC-6bS.title" = "Item";
20+
/* Class = "UITableViewController"; title = "General Settings"; ObjectID = "4dd-0I-UFm"; */
21+
"4dd-0I-UFm.title" = "General Settings";
2222

2323
/* Class = "UILabel"; text = "Send typing notifications"; ObjectID = "4ll-eW-b8Z"; */
2424
"4ll-eW-b8Z.text" = "Send typing notifications";
@@ -107,6 +107,12 @@
107107
/* Class = "UIBarButtonItem"; title = "New Chat"; ObjectID = "LVG-dB-flA"; */
108108
"LVG-dB-flA.title" = "New Chat";
109109

110+
/* Class = "UILabel"; text = "Blocked contacts"; ObjectID = "Lh9-1X-ez1"; */
111+
"Lh9-1X-ez1.text" = "Blocked contacts";
112+
113+
/* Class = "UINavigationItem"; title = "Notifications"; ObjectID = "O9h-LB-2lW"; */
114+
"O9h-LB-2lW.title" = "Notifications";
115+
110116
/* Class = "UILabel"; text = "Content type:"; ObjectID = "OeG-Kx-gwG"; */
111117
"OeG-Kx-gwG.text" = "Content type:";
112118

@@ -116,6 +122,9 @@
116122
/* Class = "UITableViewController"; title = "Account Settings"; ObjectID = "Pnk-9m-ZVg"; */
117123
"Pnk-9m-ZVg.title" = "Account Settings";
118124

125+
/* Class = "UILabel"; text = "First and Last Name"; ObjectID = "PuQ-zO-4Of"; */
126+
"PuQ-zO-4Of.text" = "First and Last Name";
127+
119128
/* Class = "UILabel"; text = "Topic or user ID"; ObjectID = "RA0-dx-dSp"; */
120129
"RA0-dx-dSp.text" = "Topic or user ID";
121130

@@ -125,9 +134,15 @@
125134
/* Class = "UIButton"; normalTitle = "Sign up"; ObjectID = "Rv6-qQ-FqW"; */
126135
"Rv6-qQ-FqW.normalTitle" = "Sign up";
127136

137+
/* Class = "UIButton"; normalTitle = "Add Avatar"; ObjectID = "Svo-WC-LXa"; */
138+
"Svo-WC-LXa.normalTitle" = "Add Avatar";
139+
128140
/* Class = "UITabBarItem"; title = "By ID"; ObjectID = "T7l-iC-Rs6"; */
129141
"T7l-iC-Rs6.title" = "By ID";
130142

143+
/* Class = "UILabel"; text = "John Doe"; ObjectID = "TCK-gb-1BS"; */
144+
"TCK-gb-1BS.text" = "John Doe";
145+
131146
/* Class = "UILabel"; text = "Leave Group"; ObjectID = "TRR-fA-HKj"; */
132147
"TRR-fA-HKj.text" = "Leave Group";
133148

@@ -182,14 +197,20 @@
182197
/* Class = "UILabel"; text = "File name:"; ObjectID = "aA7-FA-fcf"; */
183198
"aA7-FA-fcf.text" = "File name:";
184199

200+
/* Class = "UILabel"; text = "Notifications"; ObjectID = "aCk-Z4-8m7"; */
201+
"aCk-Z4-8m7.text" = "Notifications";
202+
185203
/* Class = "UIButton"; normalTitle = "Confirm"; ObjectID = "aFc-MO-QyO"; */
186204
"aFc-MO-QyO.normalTitle" = "Confirm";
187205

188206
/* Class = "UILabel"; text = "N"; ObjectID = "aMv-to-Vu2"; */
189207
"aMv-to-Vu2.text" = "N";
190208

191-
/* Class = "UITextView"; text = "User name"; ObjectID = "bFa-Y7-bbT"; */
192-
"bFa-Y7-bbT.text" = "User name";
209+
/* Class = "UILabel"; text = "Last active"; ObjectID = "bEA-WA-uoH"; */
210+
"bEA-WA-uoH.text" = "Last active";
211+
212+
/* */
213+
"bFa-Y7-bbT.text" = "Username";
193214

194215
/* Class = "UILabel"; text = "N"; ObjectID = "bZv-2Q-BI9"; */
195216
"bZv-2Q-BI9.text" = "N";
@@ -200,6 +221,9 @@
200221
/* Class = "UILabel"; text = " MyUID"; ObjectID = "bvN-my-ZPi"; */
201222
"bvN-my-ZPi.text" = " MyUID";
202223

224+
/* Class = "UINavigationItem"; title = "Help and About"; ObjectID = "d7l-9Y-8mk"; */
225+
"d7l-9Y-8mk.title" = "Help and About";
226+
203227
/* Class = "UILabel"; text = "Manage"; ObjectID = "eHa-mE-ZbY"; */
204228
"eHa-mE-ZbY.text" = "Manage";
205229

@@ -212,6 +236,9 @@
212236
/* Class = "UINavigationItem"; title = "Archived chats"; ObjectID = "fP4-sa-3Wz"; */
213237
"fP4-sa-3Wz.title" = "Archived chats";
214238

239+
/* Class = "UILabel"; text = "Help and About"; ObjectID = "fPM-Ht-gZz"; */
240+
"fPM-Ht-gZz.text" = "Help and About";
241+
215242
/* Class = "UILabel"; text = "ALL USERS"; ObjectID = "ftJ-J6-tqx"; */
216243
"ftJ-J6-tqx.text" = "ALL USERS";
217244

@@ -227,8 +254,14 @@
227254
/* Class = "UILabel"; text = "Send read receipts"; ObjectID = "geh-gC-6qO"; */
228255
"geh-gC-6qO.text" = "Send read receipts";
229256

230-
/* Class = "UINavigationItem"; title = "New chat"; ObjectID = "hZA-k4-xku"; */
231-
"hZA-k4-xku.title" = "New chat";
257+
/* Class = "UINavigationItem"; title = "Blocked Contacts"; ObjectID = "hTR-e8-PeX"; */
258+
"hTR-e8-PeX.title" = "Blocked Contacts";
259+
260+
/* Class = "UINavigationItem"; title = "Personal"; ObjectID = "hUo-8f-ZiA"; */
261+
"hUo-8f-ZiA.title" = "Personal";
262+
263+
/* Class = "UINavigationItem"; title = "New Chat"; ObjectID = "hZA-k4-xku"; */
264+
"hZA-k4-xku.title" = "New Chat";
232265

233266
/* Class = "UIButton"; normalTitle = "Request"; ObjectID = "i0f-S8-O1v"; */
234267
"i0f-S8-O1v.normalTitle" = "Request";
@@ -266,6 +299,9 @@
266299
/* Class = "UILabel"; text = "N"; ObjectID = "mTa-Ke-dom"; */
267300
"mTa-Ke-dom.text" = "N";
268301

302+
/* Class = "UINavigationItem"; title = "Account and Security"; ObjectID = "mV4-Fq-kmc"; */
303+
"mV4-Fq-kmc.title" = "Account and Security";
304+
269305
/* Class = "UILabel"; text = "Size: "; ObjectID = "moa-6V-LhX"; */
270306
"moa-6V-LhX.text" = "Size: ";
271307

@@ -287,10 +323,10 @@
287323
/* Class = "UINavigationController"; title = "StartNavigationController"; ObjectID = "oPa-Qr-HlP"; */
288324
"oPa-Qr-HlP.title" = "StartNavigationController";
289325

290-
/* Class = "UILabel"; text = "TopicID"; ObjectID = "om5-K5-yRq"; */
326+
/* */
291327
"om5-K5-yRq.text" = "TopicID";
292328

293-
/* Class = "UITableViewSection"; headerTitle = "General"; ObjectID = "out-KF-2FK"; */
329+
/* */
294330
"out-KF-2FK.headerTitle" = "General";
295331

296332
/* Class = "UIButton"; normalTitle = "Forgot password?"; ObjectID = "q6T-TC-n42"; */
@@ -320,6 +356,9 @@
320356
/* Class = "UILabel"; text = "N"; ObjectID = "s6S-ku-F63"; */
321357
"s6S-ku-F63.text" = "N";
322358

359+
/* Class = "UILabel"; text = "This is a channel"; ObjectID = "skU-B7-Zed"; Note = "Label for channel switch"; */
360+
"skU-B7-Zed.text" = "This is a channel";
361+
323362
/* Class = "UILabel"; text = "John Doe"; ObjectID = "syF-Vp-vRc"; */
324363
"syF-Vp-vRc.text" = "John Doe";
325364

@@ -356,6 +395,12 @@
356395
/* Class = "UITextField"; placeholder = "First and last name"; ObjectID = "yKx-xt-rdn"; */
357396
"yKx-xt-rdn.placeholder" = "First and last name";
358397

398+
/* Class = "UILabel"; text = "Subtitle"; ObjectID = "yL1-ka-zNK"; */
399+
"yL1-ka-zNK.text" = "Subtitle";
400+
401+
/* Class = "UILabel"; text = "Account and Security"; ObjectID = "z08-iK-CeG"; */
402+
"z08-iK-CeG.text" = "Account and Security";
403+
359404
/* Class = "UILabel"; text = "Delete Group"; ObjectID = "z6C-JF-Mnb"; */
360405
"z6C-JF-Mnb.text" = "Delete Group";
361406

0 commit comments

Comments
 (0)