Browse Source

Merge branch 'damus-io:master' into sidebar

translations_damus-localizations-en-us-xcloc-localized-contents-en-us-xliff--master_es_419
Ben Weeks 2 years ago
committed by GitHub
parent
commit
30151e14fa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      CHANGELOG.md
  2. 18
      damus/ContentView.swift
  3. 2
      damus/Views/ChatroomView.swift
  4. 2
      damus/Views/DMChatView.swift
  5. 6
      damus/Views/EventView.swift

33
CHANGELOG.md

@ -1,3 +1,35 @@
## [1.0.0-5] - 2023-01-06
### Added
- Added share button to profile (William Casarin)
- Added universal link sharing of notes (William Casarin)
- Added clear cache button to wipe pfp/image cache (OlegAba)
- Allow Adding Relay Without wss:// Prefix (Joel Klabo)
- Allow Saving Images to Library (Joel Klabo)
### Changed
- Added damus gradient to post button (Ben Weeks)
- Center the Post Button (Thomas)
- Switch yellow nip05 check to gray (William Casarin)
- Switch from bluecheck to purplecheck (William Casarin)
### Fixed
- Add system background color to profile pics (OlegAba)
- High res color pubkey on profile page (William Casarin)
- Don't spin forever if we're temporarily disconnected (William Casarin)
- Fixed a few issues with avatars not animating (OlegAba)
- Scroll to bottom when new DM received (Aidan O'Loan)
- Make reply view scrollable (Joel Klabo)
- Hide profile edit button when logged in with pubkey (Swift)
[1.0.0-5]: https://github.com/damus-io/damus/releases/tag/v1.0.0-5
## [1.0.0-4] - 2023-01-04
### Added
@ -320,3 +352,4 @@
[0.1.2]: https://github.com/damus-io/damus/releases/tag/v0.1.2

18
damus/ContentView.swift

@ -45,10 +45,10 @@ enum FilterState : Int {
case posts_and_replies = 1
case posts = 0
func filter(privkey: String?, ev: NostrEvent) -> Bool {
func filter(ev: NostrEvent) -> Bool {
switch self {
case .posts:
return !ev.is_reply(privkey)
return !ev.is_reply(nil)
case .posts_and_replies:
return true
}
@ -94,10 +94,12 @@ struct ContentView: View {
var PostingTimelineView: some View {
VStack {
TabView(selection: $filter_state) {
contentTimelineView(filter: posts_filter_event)
contentTimelineView(filter: FilterState.posts.filter)
.tag(FilterState.posts)
contentTimelineView(filter: posts_and_replies_filter_event)
.id(FilterState.posts)
contentTimelineView(filter: FilterState.posts_and_replies.filter)
.tag(FilterState.posts_and_replies)
.id(FilterState.posts_and_replies)
}
.tabViewStyle(.page(indexDisplayMode: .never))
}
@ -127,14 +129,6 @@ struct ContentView: View {
}
}
func posts_and_replies_filter_event(_ ev: NostrEvent) -> Bool {
return true
}
func posts_filter_event(_ ev: NostrEvent) -> Bool {
return !ev.is_reply(nil)
}
var FiltersView: some View {
VStack{
Picker("Filter State", selection: $filter_state) {

2
damus/Views/ChatroomView.swift

@ -24,7 +24,7 @@ struct ChatroomView: View {
next_ev: ind == count-1 ? nil : thread.events[ind+1],
damus_state: damus
)
.event_context_menu(ev, privkey: damus.keypair.privkey)
.event_context_menu(ev, pubkey: ev.pubkey, privkey: damus.keypair.privkey)
.onTapGesture {
if thread.initial_event.id == ev.id {
//dismiss()

2
damus/Views/DMChatView.swift

@ -19,7 +19,7 @@ struct DMChatView: View {
VStack(alignment: .leading) {
ForEach(Array(zip(dms.events, dms.events.indices)), id: \.0.id) { (ev, ind) in
DMView(event: dms.events[ind], damus_state: damus_state)
.event_context_menu(ev, privkey: damus_state.keypair.privkey)
.event_context_menu(ev, pubkey: ev.pubkey, privkey: damus_state.keypair.privkey)
}
EndBlock(height: 80)
}

6
damus/Views/EventView.swift

@ -274,7 +274,7 @@ struct EventView: View {
.id(event.id)
.frame(maxWidth: .infinity, minHeight: PFP_SIZE)
.padding([.bottom], 2)
.event_context_menu(event, privkey: damus.keypair.privkey)
.event_context_menu(event, pubkey: pubkey, privkey: damus.keypair.privkey)
}
}
@ -313,7 +313,7 @@ extension View {
}
}
func event_context_menu(_ event: NostrEvent, privkey: String?) -> some View {
func event_context_menu(_ event: NostrEvent, pubkey: String, privkey: String?) -> some View {
return self.contextMenu {
Button {
UIPasteboard.general.string = event.get_content(privkey)
@ -322,7 +322,7 @@ extension View {
}
Button {
UIPasteboard.general.string = bech32_pubkey(event.pubkey) ?? event.pubkey
UIPasteboard.general.string = bech32_pubkey(pubkey) ?? pubkey
} label: {
Label("Copy User ID", systemImage: "tag")
}

Loading…
Cancel
Save