Skip to content

Commit

Permalink
Merge branch 'unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Jul 21, 2024
2 parents 5eedf00 + bb3c819 commit c3567a2
Show file tree
Hide file tree
Showing 46 changed files with 2,271 additions and 1,287 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions build.sh

This file was deleted.

56 changes: 56 additions & 0 deletions docs/DEPENDENCIES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

Update crates from the bottom up:

gossip
├── eframe
│ ├── egui
│ ├── egui-winit
│ └── egui_glow
├── egui-winit
├── egui_extras
├── gossip-relay-picker
│ └── nostr-types
│ └-- speedy
├── nostr-types
└── qrcode

Try to push our dependency changes upstream:
<https://github.com/mikedilger/qrcode-rust> (unlikely, stale for >3 years)
<https://github.com/mikedilger/egui>


nostr-types
-- cargo update, and check for new versions, maybe update dependencies
-- cargo test
-- cargo clippy; cargo fmt
-- FORK 0.N:
-- all deps switch to released versions
-- version 0.N
-- package/publish
-- version to 0.N.1-unstable
-- master:
-- version to 0.N+1.0-unstable

gossip-relay-picker
-- cargo update, and check for new versions, maybe update dependencies
-- cargo test
-- cargo clippy; cargo fmt
-- FORK 0.N:
-- all deps switch to released versions
-- version 0.N
-- package/publish
-- version to 0.N.1-unstable
-- master:
-- version to 0.N+1.0-unstable

gossip
-- cargo update, and check for new versions, maybe update dependencies
-- cargo test
-- cargo clippy; cargo fmt
-- FORK 0.N:
-- all deps switch to released versions
-- version 0.N
-- package/publish (see below)
-- version 0.N.1-unstable
-- master
-- version 0.N+1.0-unstable
15 changes: 15 additions & 0 deletions docs/README.flatpak.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Using the flatpak:
------------------

1) Install with:

flatpak install --user gossip.0.11.1.flatpak

2) Run with:

flatpak run com.mikedilger.gossip

3) If you get an eframe/glutin error, switch to the wgpu backend with this command, then
afterwards you can run it normally as in step (2)

flatpak run com.mikedilger.gossip wgpu_renderer true
File renamed without changes.
10 changes: 10 additions & 0 deletions docs/README.upgrading.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
If you are running very old versions, this version may not work directly
until you run prior versions as explained in this file.

If you are running a version older than 0.8.x, you must first install
version 0.8.x (e.g. 0.8.2) and run that once. Then heed the next paragraph.

If you are running a version older than 0.11x, you must first install
version 0.9.x or 0.10.x (e.g. 0.10.1) and run that once.

Then you can install and run this version.
6 changes: 3 additions & 3 deletions gossip-bin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gossip"
version = "0.11.0-unstable"
version = "0.12.0-unstable"
description = "A social media client for nostr"
authors = ["Mike Dilger <[email protected]>", "fiatjaf <[email protected]>", "Nate Levin <[email protected]>", "Nethanja Focking <[email protected]>", "Daniele Tonon <[email protected]>", "jeremyd (@jeremyd)"]
license = "MIT"
Expand All @@ -25,13 +25,13 @@ egui-winit = { git = "https://github.com/bu5hm4nn/egui", rev = "63dde4c9b311da0c
egui_extras = { git = "https://github.com/bu5hm4nn/egui", rev = "63dde4c9b311da0cae0cb9f9465bf7273227be6c", features = [ "syntect" ] }
#egui = { git = "https://github.com/bu5hm4nn/egui", rev = "63dde4c9b311da0cae0cb9f9465bf7273227be6c", features = [ "deadlock_detection" ] }
egui-video = { git = "https://github.com/mikedilger/egui-video", rev = "97f58f88dfe912697393567830d0751676492a89", features = [ "from_bytes" ], optional = true }
gossip-relay-picker = { git = "https://github.com/mikedilger/gossip-relay-picker", rev = "6a31a4f540ffc5c2928a8c9881810a12cd2cf9f4" }
gossip-relay-picker = { git = "https://github.com/mikedilger/gossip-relay-picker", rev = "3ea9ccfc641cdef1574a3c054a086ac2e24d3c4a" }
gossip-lib = { path = "../gossip-lib" }
humansize = "2.1"
image = { version = "0.24.6", features = [ "png", "jpeg" ] }
lazy_static = "1.4"
memoize = "0.4"
nostr-types = { git = "https://github.com/mikedilger/nostr-types", rev = "76084731b6be2c0203ea1111bfc2a94fd91652b9", features = [ "speedy" ] }
nostr-types = { git = "https://github.com/mikedilger/nostr-types", rev = "d09019261b6d57722eaeb006dd768bd6207c41d1", features = [ "speedy" ] }
paste = "1.0"
qrcode = { git = "https://github.com/mikedilger/qrcode-rust", rev = "519b77b3efa3f84961169b47d3de08c5ddd86548" }
resvg = "0.35.0"
Expand Down
12 changes: 3 additions & 9 deletions gossip-bin/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,7 @@ pub fn delete_spam_by_content(

let job = tokio::task::spawn(async move {
// Process this event locally
if let Err(e) =
gossip_lib::process::process_new_event(&event, None, None, false, false).await
{
if let Err(e) = gossip_lib::process::process_new_event(&event, None, None, false, false) {
println!("ERROR: {}", e);
} else {
// Post the event to all the relays
Expand Down Expand Up @@ -664,9 +662,7 @@ pub fn import_event(cmd: Command, mut args: env::Args, runtime: &Runtime) -> Res
login()?;

let job = tokio::task::spawn(async move {
if let Err(e) =
gossip_lib::process::process_new_event(&event, None, None, false, true).await
{
if let Err(e) = gossip_lib::process::process_new_event(&event, None, None, false, true) {
println!("ERROR: {}", e);
}
});
Expand Down Expand Up @@ -933,9 +929,7 @@ pub fn reprocess_recent(_cmd: Command, runtime: &Runtime) -> Result<(), Error> {

let mut count = 0;
for event in events.iter() {
if let Err(e) =
gossip_lib::process::process_new_event(event, None, None, false, true).await
{
if let Err(e) = gossip_lib::process::process_new_event(event, None, None, false, true) {
println!("ERROR: {}", e);
}
count += 1;
Expand Down
23 changes: 15 additions & 8 deletions gossip-bin/src/notedata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ pub(crate) enum RepostType {
GenericRepost,
}

#[derive(PartialEq, Default)]
pub(crate) enum EncryptionType {
#[default]
None,
Nip04,
Giftwrap,
}

pub(crate) struct NoteData {
/// Original Event object, as received from nostr
pub event: Event,
Expand Down Expand Up @@ -72,8 +80,8 @@ pub(crate) struct NoteData {
/// direct message
pub direct_message: bool,

/// Securely delivered via GiftWrap
pub secure: bool,
/// Encryption type this note had on the network
pub encryption: EncryptionType,

/// Bookmarked
pub bookmarked: bool,
Expand All @@ -84,22 +92,21 @@ impl NoteData {
// We do not filter event kinds here anymore. The feed already does that.
// There is no sense in duplicating that work.

let mut secure: bool = false;
let mut encryption = EncryptionType::None;
let mut direct_message: bool = false;
if matches!(event.kind, EventKind::GiftWrap) {
direct_message = true;
secure = true;
encryption = EncryptionType::Giftwrap;
// Use the rumor for subsequent processing, but swap for the Giftwrap's id
// since that is the effective event (database-accessible, deletable, etc)
if let Ok(rumor) = GLOBALS.identity.unwrap_giftwrap(&event) {
let id = event.id;
event = rumor.into_event_with_bad_signature();
event.id = id; // lie, keep the giftwrap id
}
}

if event.kind == EventKind::EncryptedDirectMessage {
} else if matches!(event.kind, EventKind::EncryptedDirectMessage) {
direct_message = true;
encryption = EncryptionType::Nip04;
}

let delegation = event.delegation();
Expand Down Expand Up @@ -289,7 +296,7 @@ impl NoteData {
shattered_content,
error_content,
direct_message,
secure,
encryption,
bookmarked,
}
}
Expand Down
Loading

0 comments on commit c3567a2

Please sign in to comment.