Skip to content

Commit

Permalink
Merge pull request #1276 from planetary-social/remove-community-pubs
Browse files Browse the repository at this point in the history
Remove community pubs
  • Loading branch information
mplorentz authored Jun 17, 2024
2 parents ff917d9 + d14e186 commit 212da93
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 124 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ We define "Noteworthy changes" as 1) user-facing features or bugfixes 2) signifi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Remove topical pubs that are shutting down. See %1ao9SOiYKIOyPaqgWBJXXMngpiDyS/GJVIVkqg0Y1PU=.sha256

## [2.1.1] 2023-09-23

- Add timestamps back to message cards
Expand Down
4 changes: 0 additions & 4 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
<string>This app allows you to select photos to share with friends or use as your profile image.</string>
<key>PLAliasServers</key>
<string>$(PLANETARY_COMMUNITY_ALIAS_SERVERS)</string>
<key>PLCommunities</key>
<string>$(COMMUNITIES)</string>
<key>PLConstellation</key>
<string>$(CONSTELLATION)</string>
<key>PLDefaultNetworkKey</key>
Expand All @@ -94,8 +92,6 @@
<string>$(PLANETARY_SYSTEM_PUBS)</string>
<key>PLTestAliasServers</key>
<string>$(TEST_PLANETARY_COMMUNITY_ALIAS_SERVERS)</string>
<key>PLTestNetworkCommunities</key>
<string>$(TEST_NETWORK_COMMUNITIES)</string>
<key>PLTestNetworkPubs</key>
<string>$(TEST_NETWORK_PUBS)</string>
<key>PLTestingNetworkHMAC</key>
Expand Down
11 changes: 0 additions & 11 deletions Source/App/AppConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,6 @@ class AppConfiguration: NSObject, NSCoding, Identifiable, @unchecked Sendable {
}
}

var communityPubs: [Star] {
switch ssbNetwork {
case Environment.Networks.mainNet:
return Environment.PlanetarySystem.communityPubs
case Environment.Networks.test:
return Environment.TestNetwork.communityPubs
default:
return []
}
}

var communityAliasServers: [Room] {
switch ssbNetwork {
case Environment.Networks.mainNet:
Expand Down
2 changes: 1 addition & 1 deletion Source/Bot/Operations/JoinPlanetarySystemOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class JoinPlanetarySystemOperation: AsynchronousOperation {
private var internalQueue: OperationQueue

/// Minimum number of Planetary's pubs that should be followng the user for them to be considered in the system.
static let minNumberOfStars = 3
static let minNumberOfStars = 2

let userDefaults = UserDefaults.standard

Expand Down
8 changes: 0 additions & 8 deletions Source/Configs/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ struct Environment {
Environment.value(for: "PLPlanetarySystem").split(separator: " ").map { Star(invite: String($0)) }
}()

static let communityPubs: [Star] = {
Environment.value(for: "PLCommunities").split(separator: " ").map { Star(invite: String($0)) }
}()

static let planetaryIdentity: Identity = {
Environment.value(for: "PLPlanetaryIdentity")
}()
Expand All @@ -49,10 +45,6 @@ struct Environment {
Environment.value(for: "PLTestNetworkPubs").split(separator: " ").map { Star(invite: String($0)) }
}()

static let communityPubs: [Star] = {
Environment.value(for: "PLTestNetworkCommunities").split(separator: " ").map { Star(invite: String($0)) }
}()

static let communityAliasServers: [Room] = {
parseCommunityServers(environmentKey: "PLTestAliasServers")
}()
Expand Down
27 changes: 2 additions & 25 deletions Source/Configs/Planetary.debug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,14 @@ SWIFT_OBJC_BRIDGING_HEADER = ${PROJECT_DIR}/Source/GoBot/GoBotBridge.h

// If you change any invitations here you should track them here too: https://github.com/planetary-social/infrastructure/wiki/Pub-Invitation-Tracking

PUB_ONE = one.planetary.pub:8008:@CIlwTOK+m6v1hT2zUVOCJvvZq7KE/65ErN6yA2yrURY=.ed25519~3Ht0U0ZcO7UaiVann2wPTOr3rDM3GjmTyswjx7Mh5K4=
PUB_TWO = two.planetary.pub:8008:@7jJ7oou5pKKuyKvIlI5tl3ncjEXmZcbm3TvKqQetJIo=.ed25519~l7SxAVayKsu96TzNCDIkOWMiUA1LDGtSV06vfq93FmY=
PUB_THREE = three.planetary.pub:8008:@LQ8HBiEinU5FiXGaZH9JYFGBGdsB99mepBdh/Smq3VI=.ed25519~3BmUblybJ1RDWErRZAv/dHSKLd2Hx+H8xCWD9+TDwjQ=
PUB_FOUR = four.planetary.pub:8008:@5KDK98cjIQ8bPoBkvp7bCwBXoQMlWpdIbCFyXER8Lbw=.ed25519~e9ZRXEw0RSTE6FX8jOwWV7yfMRDsAZkzlhCRbVMBUEc=
PUB_ONE = one.planetary.pub:8008:@CIlwTOK+m6v1hT2zUVOCJvvZq7KE/65ErN6yA2yrURY=.ed25519~gkPjmojoEv5xNRcCl/BzF1reod2pnh+ciS1E+Tr6XOc=
PUB_TWO = two.planetary.pub:8008:@7jJ7oou5pKKuyKvIlI5tl3ncjEXmZcbm3TvKqQetJIo=.ed25519~hLsEIUnGlGhZ02p946sdGA5DkeGLYZU67Of4kFtrEdc=

PLANETARY_SYSTEM_PUBS = ${PUB_ONE} ${PUB_TWO} ${PUB_THREE}
// ${PUB_FOUR} - disabled due to being down - nov 5th 2022 - rabble

TEST_PUB_ONE = dev.planetary.pub:8008:@IzuvGuH1r29Gjg4aBq+C0ke1b5t+Tk9tmSZfZIB9XFE=.ed25519~C7roPCA8eU59HvstGS/sGV06cGUYD26Tm/J8jtUo2jw=
TEST_PUB_TWO = 167.99.36.26:8008:@zOTzL5j6Ox4pFhyj01eVoD3phCvnPJQNixtC3XbDniE=.ed25519~WVAtPG3sk8tbKKxd0k8RYjaKVKnJeLefNjBALvoCrGo=
TEST_NETWORK_PUBS = ${TEST_PUB_ONE}
TEST_NETWORK_COMMUNITIES = ${TEST_PUB_TWO}

CRYPTO = crypto.planetary.pub:8008:@CBaNGA3MPZHPKo4gvrZsTCCV3DUgydmPnwK0UDRRbqQ=.ed25519~yrRA7UQNPJfFP5/cyo3kmFidfAWX6SEa8Rq4DHqsfNo=
FLOSS = floss.planetary.pub:8008:@uHqyTLo/JwapDh+ryXKe0VyBMS7eqt0YEKwvUathiS8=.ed25519~vr3cPOGE5DgCCsxlinLRlFK6E6D0pWVWHv0DpEY314A=
FREESOCIAL = pub.freesocial.co:8008:@ofYKOy2p9wsaxV73GqgOyh6C6nRGFM5FyciQyxwBd6A=.ed25519~ye9Z808S3KPQsV0MWr1HL0/Sh8boSEwW+ZK+8x85u9w=
SCUTTLEUS = scuttle.us:8008:@WqcuCOIpLtXFRw/9vOAQJti8avTZ9vxT9rKrPo8qG6o=.ed25519~/ZUi9Chpl0g1kuWSrmehq2EwMQeV0Pd+8xw8XhWuhLE=
PORRO = porro.club:8008:@qAFzUyH1dISX93LnQTllaAtudH79i/ht0crIUgAKTm8=.ed25519~0xqpvDaEWFjHKMjUsGRGgWMjeGBSYYYPXqX0nVyi1Hc=
GARDENING = gardening.planetary.pub:8008:@1ZA2K/bPs41o4EJ1gAVVNGGj0WAB6laJC2AOJbdBrmM=.ed25519~YXJJxmyAxsAnUyn1b5CWURNkIg/T/kQlgN+eYq4EjJE=
POETRY = poetry.planetary.pub:8008:@FBH3fASAJ3aJtzHL7nDg86HiuCjAKSljzXAIhlZqnFw=.ed25519~wu3Fahw7RcC++h/IGFncltVLwanontMtObeRB8EBSFQ=
FUNGI = fungi.planetary.pub:8008:@ULtTfklxd39BtkQs97OwKRm1vncQHc/foySwTPErkwg=.ed25519~Z+Qguco1LSgWACi+zcaJFmS9Ek06dqPOFa473c+a+hU=
COOKING = cooking.planetary.pub:8008:@8oxL9ddFp+y+EJx4HfYsnHKUUlscH0bgng4QJn1g5dQ=.ed25519~GeGYfdnNBBxT4785EiuHITVIA5SyQyge3hlNtF79ZcM=
QUEER = queer.family:8008:@nnAMmrhLfy54wkYSgAZWK4fBg/b/83YjilPk5JfNzXM=.ed25519~kxCY33m5QNMnLbJ0pkHHUaWdRyANTlS4gaISXN2D3x0=

ESPANOL = espanol.planetary.pub:8008:@KpZ49dSM+wr73t8peJQWBLjAlENLG9yLdVBNv7PgatI=.ed25519~s7GLx7uJSllwh4HVB0v7DOY4f9YO1kPw7RvjGDnXe7I=
RUSSIAN = russian-language.planetary.pub:8008:@EmJzXv/EZrAuGS1UNpH07AVz908sGckRaX38BxVgA+0=.ed25519~Sq5cxugjyL3r2VdV2uoT4nG6fqMiws5f9xivqu12oQI=
UKRAINIAN = ukrainian-language.planetary.pub:8008:@pDcdMNVFSDW43XAcsU4WHumId54h4mQi5y8z9FDGyqM=.ed25519~y9Ac9XkzNBHkwaIwxQijXxchVj4QgmPm8VKLBP+2Dag=
FRENCH = francaise.planetary.pub:8008:@yzbJcRdC7BGLumJohjlySD7zwgVgR8udpFzAUK5/ptw=.ed25519~i34wbWgr+bsIdf0uLTABxekybDJEZu8EBPEg9FrN90w=
CHINESE = chinese-language.planetary.pub:8008:@L1LEmI49J3lzKUy6XPkh9/6ci+Cc8JlUIGg8inzWaVo=.ed25519~LMWjK1qWd0MryvrkrMhSY746OuhRMf94tzQuZ+HdVQk=

COMMUNITIES = ${CRYPTO} ${FLOSS} ${FREESOCIAL} ${SCUTTLEUS} ${PORRO} ${GARDENING} ${POETRY} ${FUNGI} ${COOKING} ${QUEER} ${ESPANOL} ${RUSSIAN} ${UKRAINIAN} ${CHINESE} ${FRENCH}

PLANETARY = @l1sGqWeCZRA99gN+t9sI6+UOzGcHq3KhLQUYEwb4DCo=.ed25519
PLANETARY_SYSTEM = ${PLANETARY}
Expand Down
30 changes: 3 additions & 27 deletions Source/Configs/Planetary.release.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,20 @@ SWIFT_OBJC_BRIDGING_HEADER = ${PROJECT_DIR}/Source/GoBot/GoBotBridge.h

// If you change any invitations here you should track them here too: https://github.com/planetary-social/infrastructure/wiki/Pub-Invitation-Tracking

PUB_ONE = one.planetary.pub:8008:@CIlwTOK+m6v1hT2zUVOCJvvZq7KE/65ErN6yA2yrURY=.ed25519~3Ht0U0ZcO7UaiVann2wPTOr3rDM3GjmTyswjx7Mh5K4=
PUB_TWO = two.planetary.pub:8008:@7jJ7oou5pKKuyKvIlI5tl3ncjEXmZcbm3TvKqQetJIo=.ed25519~l7SxAVayKsu96TzNCDIkOWMiUA1LDGtSV06vfq93FmY=
PUB_THREE = three.planetary.pub:8008:@LQ8HBiEinU5FiXGaZH9JYFGBGdsB99mepBdh/Smq3VI=.ed25519~3BmUblybJ1RDWErRZAv/dHSKLd2Hx+H8xCWD9+TDwjQ=
PUB_FOUR = four.planetary.pub:8008:@5KDK98cjIQ8bPoBkvp7bCwBXoQMlWpdIbCFyXER8Lbw=.ed25519~e9ZRXEw0RSTE6FX8jOwWV7yfMRDsAZkzlhCRbVMBUEc=
PUB_ONE = one.planetary.pub:8008:@CIlwTOK+m6v1hT2zUVOCJvvZq7KE/65ErN6yA2yrURY=.ed25519~gkPjmojoEv5xNRcCl/BzF1reod2pnh+ciS1E+Tr6XOc=
PUB_TWO = two.planetary.pub:8008:@7jJ7oou5pKKuyKvIlI5tl3ncjEXmZcbm3TvKqQetJIo=.ed25519~hLsEIUnGlGhZ02p946sdGA5DkeGLYZU67Of4kFtrEdc=

PLANETARY_SYSTEM_PUBS = ${PUB_ONE} ${PUB_TWO} ${PUB_THREE}
// ${PUB_FOUR} - disabled due to being down - nov 5th 2022 - rabble

TEST_PUB_ONE = dev.planetary.pub:8008:@IzuvGuH1r29Gjg4aBq+C0ke1b5t+Tk9tmSZfZIB9XFE=.ed25519~C7roPCA8eU59HvstGS/sGV06cGUYD26Tm/J8jtUo2jw=
TEST_PUB_TWO = 167.99.36.26:8008:@zOTzL5j6Ox4pFhyj01eVoD3phCvnPJQNixtC3XbDniE=.ed25519~WVAtPG3sk8tbKKxd0k8RYjaKVKnJeLefNjBALvoCrGo=
TEST_NETWORK_PUBS = ${TEST_PUB_ONE}
TEST_NETWORK_COMMUNITIES = ${TEST_PUB_TWO}

CRYPTO = crypto.planetary.pub:8008:@CBaNGA3MPZHPKo4gvrZsTCCV3DUgydmPnwK0UDRRbqQ=.ed25519~yrRA7UQNPJfFP5/cyo3kmFidfAWX6SEa8Rq4DHqsfNo=
FLOSS = floss.planetary.pub:8008:@uHqyTLo/JwapDh+ryXKe0VyBMS7eqt0YEKwvUathiS8=.ed25519~vr3cPOGE5DgCCsxlinLRlFK6E6D0pWVWHv0DpEY314A=
FREESOCIAL = pub.freesocial.co:8008:@ofYKOy2p9wsaxV73GqgOyh6C6nRGFM5FyciQyxwBd6A=.ed25519~ye9Z808S3KPQsV0MWr1HL0/Sh8boSEwW+ZK+8x85u9w=
SCUTTLEUS = scuttle.us:8008:@WqcuCOIpLtXFRw/9vOAQJti8avTZ9vxT9rKrPo8qG6o=.ed25519~/ZUi9Chpl0g1kuWSrmehq2EwMQeV0Pd+8xw8XhWuhLE=
PORRO = porro.club:8008:@qAFzUyH1dISX93LnQTllaAtudH79i/ht0crIUgAKTm8=.ed25519~0xqpvDaEWFjHKMjUsGRGgWMjeGBSYYYPXqX0nVyi1Hc=
GARDENING = gardening.planetary.pub:8008:@1ZA2K/bPs41o4EJ1gAVVNGGj0WAB6laJC2AOJbdBrmM=.ed25519~YXJJxmyAxsAnUyn1b5CWURNkIg/T/kQlgN+eYq4EjJE=
POETRY = poetry.planetary.pub:8008:@FBH3fASAJ3aJtzHL7nDg86HiuCjAKSljzXAIhlZqnFw=.ed25519~wu3Fahw7RcC++h/IGFncltVLwanontMtObeRB8EBSFQ=
FUNGI = fungi.planetary.pub:8008:@ULtTfklxd39BtkQs97OwKRm1vncQHc/foySwTPErkwg=.ed25519~Z+Qguco1LSgWACi+zcaJFmS9Ek06dqPOFa473c+a+hU=
COOKING = cooking.planetary.pub:8008:@8oxL9ddFp+y+EJx4HfYsnHKUUlscH0bgng4QJn1g5dQ=.ed25519~GeGYfdnNBBxT4785EiuHITVIA5SyQyge3hlNtF79ZcM=
QUEER = queer.family:8008:@nnAMmrhLfy54wkYSgAZWK4fBg/b/83YjilPk5JfNzXM=.ed25519~kxCY33m5QNMnLbJ0pkHHUaWdRyANTlS4gaISXN2D3x0=

ESPANOL = espanol.planetary.pub:8008:@KpZ49dSM+wr73t8peJQWBLjAlENLG9yLdVBNv7PgatI=.ed25519~s7GLx7uJSllwh4HVB0v7DOY4f9YO1kPw7RvjGDnXe7I=
RUSSIAN = russian-language.planetary.pub:8008:@EmJzXv/EZrAuGS1UNpH07AVz908sGckRaX38BxVgA+0=.ed25519~Sq5cxugjyL3r2VdV2uoT4nG6fqMiws5f9xivqu12oQI=
UKRAINIAN = ukrainian-language.planetary.pub:8008:@pDcdMNVFSDW43XAcsU4WHumId54h4mQi5y8z9FDGyqM=.ed25519~y9Ac9XkzNBHkwaIwxQijXxchVj4QgmPm8VKLBP+2Dag=
FRENCH = francaise.planetary.pub:8008:@yzbJcRdC7BGLumJohjlySD7zwgVgR8udpFzAUK5/ptw=.ed25519~i34wbWgr+bsIdf0uLTABxekybDJEZu8EBPEg9FrN90w=
CHINESE = chinese-language.planetary.pub:8008:@L1LEmI49J3lzKUy6XPkh9/6ci+Cc8JlUIGg8inzWaVo=.ed25519~LMWjK1qWd0MryvrkrMhSY746OuhRMf94tzQuZ+HdVQk=

COMMUNITIES = ${CRYPTO} ${FLOSS} ${FREESOCIAL} ${SCUTTLEUS} ${PORRO} ${GARDENING} ${POETRY} ${FUNGI} ${COOKING} ${QUEER} ${ESPANOL} ${RUSSIAN} ${UKRAINIAN} ${CHINESE} ${FRENCH}


PLANETARY = @l1sGqWeCZRA99gN+t9sI6+UOzGcHq3KhLQUYEwb4DCo=.ed25519
PLANETARY_SYSTEM = ${PLANETARY}

ALIAS_SERVER_ONE = Planetary Alias::net:planetary.name:8008~shs:42ACINb4+Qjd1kPYYpJ67V16CTHIWp93cjd1gDX7FKY=::icon-planetary-3::planetaryRoomToken
PLANETARY_COMMUNITY_ALIAS_SERVERS = ${ALIAS_SERVER_ONE}||${ALIAS_SERVER_TWO}||${ALIAS_SERVER_THREE}
PLANETARY_COMMUNITY_ALIAS_SERVERS = ${ALIAS_SERVER_ONE}

TEST_ALIAS_SERVER_ONE = Lorentz Test Room::net:test-room.lorentz.is:8008~shs:mxAUHhdpkdu7Lg6uB4T1gWcvAD3ugdhNiUb8K37YEh4=::icon-test-room-lorentz::lorentzRoomToken
TEST_PLANETARY_COMMUNITY_ALIAS_SERVERS = ${TEST_ALIAS_SERVER_ONE}||
2 changes: 0 additions & 2 deletions Source/Configs/UnitTests.debug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ CONSTELLATION =

PLANETARY_SYSTEM =

COMMUNITIES =

TEST_PUB_ONE = 198.199.90.207:8008:@2xO+nZ1D46RIc6hGKk1fJ4ccynogPNry1S7q18XZQGk=.ed25519~9qgQcC9XngzFLV2A9kIOyVo0q8P+twN6VLKl4DBOgsQ=
TEST_NETWORK_PUBS = ${TEST_PUB_ONE}

Expand Down
17 changes: 8 additions & 9 deletions Source/Controller/DirectoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ class DirectoryViewController: ContentViewController, AboutTableViewDelegate, He
}
}

private let communityPubs = (AppConfiguration.current?.communityPubs ?? []) +
(AppConfiguration.current?.systemPubs ?? [])
private lazy var communityPubIdentities = Set(communityPubs.map { $0.feed })
private let pubs = AppConfiguration.current?.systemPubs ?? []
private lazy var pubIdentities = Set(pubs.map { $0.feed })

/// A post that was loaded when the user put its ID in the search bar.
private var searchedPost: Message?
Expand Down Expand Up @@ -131,7 +130,7 @@ class DirectoryViewController: ContentViewController, AboutTableViewDelegate, He
if self.searchFilter.isEmpty {
activeSections = Self.defaultSections
self.people = allPeople.filter { person in
!self.communityPubIdentities.contains(person.identity)
!self.pubIdentities.contains(person.identity)
}
} else {
let filter = searchFilter.lowercased()
Expand Down Expand Up @@ -270,7 +269,7 @@ extension DirectoryViewController: UITableViewDataSource {

switch section {
case .communityPubs:
return searchFilter.isEmpty ? communityPubs.count : 0
return searchFilter.isEmpty ? pubs.count : 0
case .users:
return activeSections.contains(.users) ? 1 : 0
case .posts:
Expand All @@ -286,7 +285,7 @@ extension DirectoryViewController: UITableViewDataSource {
switch section {
case .communityPubs:
let cell = dequeueExtendedAboutTableViewCell(in: tableView)
let star = communityPubs[indexPath.row]
let star = pubs[indexPath.row]
if let about = self.allPeople.first(where: { $0.identity == star.feed }) {
cell.aboutView.update(with: star.feed, about: about, star: star)
} else {
Expand All @@ -312,10 +311,10 @@ extension DirectoryViewController: UITableViewDataSource {
case .network:
// Users in Your Network
let about = self.people[indexPath.row]
let isCommunity = communityPubIdentities.contains(about.identity)
let isCommunity = pubIdentities.contains(about.identity)
if isCommunity {
let cell = dequeueExtendedAboutTableViewCell(in: tableView)
if let star = communityPubs.first(where: { $0.feed == about.identity }) {
if let star = pubs.first(where: { $0.feed == about.identity }) {
cell.aboutView.update(with: star.feed, about: about, star: star)
}
return cell
Expand Down Expand Up @@ -344,7 +343,7 @@ extension DirectoryViewController: UITableViewDelegate {

switch section {
case .communityPubs:
let star = communityPubs[indexPath.row]
let star = pubs[indexPath.row]
let controller = IdentityViewBuilder.build(identity: star.feed)
self.navigationController?.pushViewController(controller, animated: true)
case .users:
Expand Down
3 changes: 1 addition & 2 deletions Source/GoBot/FeedStrategy/ProfileStrategy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ final class ProfileStrategy: NSObject, FeedStrategy {
}

private var isStar: Bool {
let pubs = (AppConfiguration.current?.communityPubs ?? []) +
(AppConfiguration.current?.systemPubs ?? [])
let pubs = AppConfiguration.current?.systemPubs ?? []
return pubs.contains { $0.feed == identity }
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Service/PreloadedPubService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class PreloadedPubServiceAdapter: PreloadedPubService {

Log.info("Dropping pub about messages")

let pubs = appConfig.communityPubs + appConfig.systemPubs
let pubs = appConfig.systemPubs
pubs.forEach {
do {
try goBot.database.deleteAbouts(for: $0.feed)
Expand Down
5 changes: 2 additions & 3 deletions Source/UI/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ class AboutView: MessageUIView {
loadRelationship(identity: identity)
}

let communityPubs = (AppConfiguration.current?.communityPubs ?? []) +
(AppConfiguration.current?.systemPubs ?? [])
if let star = communityPubs.first(where: { $0.feed == identity }) {
let pubs = AppConfiguration.current?.systemPubs ?? []
if let star = pubs.first(where: { $0.feed == identity }) {
followButton.star = star
} else {
followButton.star = nil
Expand Down
5 changes: 2 additions & 3 deletions Source/UI/Identity/RelationshipButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ struct RelationshipButton: View {
}

private var star: Star? {
let pubs = (AppConfiguration.current?.communityPubs ?? []) +
(AppConfiguration.current?.systemPubs ?? [])
let pubs = AppConfiguration.current?.systemPubs ?? []
return pubs.first { $0.feed == relationship?.other }
}

Expand Down Expand Up @@ -202,7 +201,7 @@ struct RelationshipButton: View {
isToggling = true
Task.detached {
let bot = await botRepository.current
let pubs = (AppConfiguration.current?.communityPubs ?? []) + (AppConfiguration.current?.systemPubs ?? [])
let pubs = AppConfiguration.current?.systemPubs ?? []
let star = pubs.first { $0.feed == relationshipToUpdate.other }
do {
if relationshipToUpdate.isBlocking {
Expand Down
32 changes: 8 additions & 24 deletions Source/UI/UniversalSearchResultsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ class UniversalSearchResultsView: UIView, UITableViewDelegate, UITableViewDataSo

// MARK: - Private Properties

private let communityPubs = AppConfiguration.current?.communityPubs ?? []
private lazy var communityPubIdentities = Set(communityPubs.map { $0.feed })

@Published private var searchResults = SearchResultsUI(data: .none, query: "")
private var cancellables = [AnyCancellable]()
private let searchQueue = DispatchQueue(label: "searchQueue", qos: .userInitiated)
Expand Down Expand Up @@ -443,28 +440,15 @@ class UniversalSearchResultsView: UIView, UITableViewDelegate, UITableViewDataSo
guard let inNetworkPeople = searchResults.inNetworkPeople else {
return UITableViewCell()
}
let about = inNetworkPeople[indexPath.row]
let isCommunity = communityPubIdentities.contains(about.identity)
if isCommunity {
let cell = (
tableView.dequeueReusableCell(withIdentifier: CommunityTableViewCell.className)
as? CommunityTableViewCell
) ?? CommunityTableViewCell()
if let star = communityPubs.first(where: { $0.feed == about.identity }) {
cell.communityView.update(with: star, about: about)
}
return cell
} else {
guard let inNetworkPeople = searchResults.inNetworkPeople else {
return UITableViewCell()
}
let about = inNetworkPeople[indexPath.row]
let cell = (
tableView.dequeueReusableCell(withIdentifier: AboutTableViewCell.className) as? AboutTableViewCell
) ?? AboutTableViewCell()
cell.aboutView.update(with: about.identity, about: about)
return cell
guard let inNetworkPeople = searchResults.inNetworkPeople else {
return UITableViewCell()
}
let about = inNetworkPeople[indexPath.row]
let cell = (
tableView.dequeueReusableCell(withIdentifier: AboutTableViewCell.className) as? AboutTableViewCell
) ?? AboutTableViewCell()
cell.aboutView.update(with: about.identity, about: about)
return cell
}
}

Expand Down
4 changes: 0 additions & 4 deletions UnitTests/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
<string>$(VERSE_HOST)</string>
<key>PLConstellation</key>
<string>$(CONSTELLATION)</string>
<key>PLCommunities</key>
<string>$(COMMUNITIES)</string>
<key>PLPlanetarySystem</key>
<string>$(PLANETARY_SYSTEM_PUBS)</string>
<key>PLPlanetaryIdentity</key>
Expand All @@ -46,8 +44,6 @@
<string>$(TESTING_NETWORK_NAME)</string>
<key>PLTestNetworkPubs</key>
<string>$(TEST_NETWORK_PUBS)</string>
<key>PLTestNetworkCommunities</key>
<string>$(TEST_NETWORK_COMMUNITIES)</string>
<key>PLTestingNetworkKey</key>
<string>$(TESTING_NETWORK_KEY)</string>
<key>PLTestingNetworkHMAC</key>
Expand Down

0 comments on commit 212da93

Please sign in to comment.