This repository was archived by the owner on Jun 7, 2020. It is now read-only.
File tree 6 files changed +29
-12
lines changed
Subscriptions/SubscriptionsList
Rocket.Chat.ShareExtension 6 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 17
17
<key >CFBundlePackageType </key >
18
18
<string >XPC! </string >
19
19
<key >CFBundleShortVersionString </key >
20
- <string >3.3.0 </string >
20
+ <string >3.3.1 </string >
21
21
<key >CFBundleVersion </key >
22
- <string >236 </string >
22
+ <string >237 </string >
23
23
<key >ITSEncryptionExportComplianceCode </key >
24
24
<string ></string >
25
25
<key >NSExtension </key >
Original file line number Diff line number Diff line change @@ -63,14 +63,24 @@ final class MessagesViewController: RocketChatViewController {
63
63
var unmanagedSubscription : UnmanagedSubscription ?
64
64
var subscription : Subscription ! {
65
65
didSet {
66
- let sub : Subscription ? = subscription
67
- let unmanaged = sub? . unmanaged
66
+ guard let subscription = subscription else { return }
67
+
68
+ if subscription. rid. isEmpty {
69
+ subscription. fetchRoomIdentifier ( { [ weak self] ( subscription) in
70
+ self ? . subscription = subscription
71
+ self ? . chatTitleView? . subscription = subscription? . unmanaged
72
+ } )
73
+
74
+ return
75
+ }
76
+
77
+ let unmanaged = subscription. unmanaged
68
78
69
79
viewModel. onRequestingDataChanged = { [ weak self] requesting in
70
80
self ? . chatTitleView? . updateConnectionState ( isRequestingMessages: requesting == . initialRequest)
71
81
}
72
82
73
- viewModel. subscription = sub
83
+ viewModel. subscription = subscription
74
84
viewSubscriptionModel. subscription = unmanaged
75
85
unmanagedSubscription = unmanaged
76
86
Original file line number Diff line number Diff line change @@ -508,18 +508,17 @@ extension SubscriptionsViewController: UITableViewDelegate {
508
508
return
509
509
}
510
510
511
+ controller. subscription = subscription
512
+
511
513
// When using iPads, we override the detail controller creating
512
514
// a new instance.
513
515
if parent? . parent? . traitCollection. horizontalSizeClass == . compact {
514
516
guard navigationController? . topViewController == self else {
515
517
return
516
518
}
517
519
518
- controller. subscription = subscription
519
520
navigationController? . pushViewController ( controller, animated: true )
520
521
} else {
521
- controller. subscription = subscription
522
-
523
522
let nav = BaseNavigationController ( rootViewController: controller)
524
523
splitViewController? . showDetailViewController ( nav, sender: self )
525
524
}
Original file line number Diff line number Diff line change 206
206
<key >CFBundlePackageType </key >
207
207
<string >APPL </string >
208
208
<key >CFBundleShortVersionString </key >
209
- <string >3.3.0 </string >
209
+ <string >3.3.1 </string >
210
210
<key >CFBundleSignature </key >
211
211
<string >???? </string >
212
212
<key >CFBundleURLTypes </key >
222
222
</dict >
223
223
</array >
224
224
<key >CFBundleVersion </key >
225
- <string >236 </string >
225
+ <string >237 </string >
226
226
<key >Fabric </key >
227
227
<dict >
228
228
<key >APIKey </key >
Original file line number Diff line number Diff line change @@ -130,6 +130,10 @@ final class Subscription: BaseModel {
130
130
static func find( rid: String , realm: Realm ? = Realm . current) -> Subscription ? {
131
131
return realm? . objects ( Subscription . self) . filter ( " rid == ' \( rid) ' " ) . first
132
132
}
133
+
134
+ static func find( name: String , realm: Realm ? = Realm . current) -> Subscription ? {
135
+ return realm? . objects ( Subscription . self) . filter ( " name == ' \( name) ' " ) . first
136
+ }
133
137
}
134
138
135
139
final class RoomRoles : Object {
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ extension Subscription {
51
51
private func fetchDirectMessageIdentifier( _ completion: @escaping MessageCompletionObject < Subscription > ) {
52
52
guard let identifier = self . identifier else { return }
53
53
54
+ let name = self . name
55
+
54
56
SubscriptionManager . createDirectMessage ( name, completion: { ( response) in
55
57
guard !response. isError ( ) else { return }
56
58
guard let rid = response. result [ " result " ] [ " rid " ] . string else { return }
@@ -72,8 +74,10 @@ extension Subscription {
72
74
}
73
75
}
74
76
} , completion: {
75
- if let subscription = Subscription . find ( rid: rid) {
76
- completion ( subscription)
77
+ DispatchQueue . main. async {
78
+ if let subscription = Subscription . find ( name: name) {
79
+ completion ( subscription)
80
+ }
77
81
}
78
82
} )
79
83
} )
You can’t perform that action at this time.
0 commit comments