Commit Graph

4319 Commits

Author SHA1 Message Date
ed749c5879 WIP NIP-A0 voice messages 2025-11-23 13:04:05 -06:00
Daniel D’Aquino
719a0c8cb0 Merge pull request #3209 from damus-io/translations
Translations
2025-08-25 18:53:36 -07:00
89ad22833d Reduce default zap amount and deduplicate from preset zap amount items
Changelog-Changed: Reduced default zap amount and deduplicated from preset zap amount items
Closes: https://github.com/damus-io/damus/issues/3198
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-08-25 18:47:14 -07:00
transifex-integration[bot]
9407c75d60 Translate Localizable.strings in de
100% translated source file: 'Localizable.strings'
on 'de'.
2025-08-25 14:43:27 +00:00
transifex-integration[bot]
c4e6e5e6a7 Translate Localizable.strings in ja
100% translated source file: 'Localizable.strings'
on 'ja'.
2025-08-25 00:36:13 +00:00
transifex-integration[bot]
592e9f9405 Translate Localizable.strings in ja
100% translated source file: 'Localizable.strings'
on 'ja'.
2025-08-25 00:36:02 +00:00
transifex-integration[bot]
d924485bb3 Translate InfoPlist.strings in zh_CN
100% translated source file: 'InfoPlist.strings'
on 'zh_CN'.
2025-08-24 13:56:16 +00:00
transifex-integration[bot]
b774f28427 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-24 01:22:28 +00:00
transifex-integration[bot]
deae6c0636 Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 19:40:14 +00:00
transifex-integration[bot]
da386f3bcd Translate Localizable.strings in nl
100% translated source file: 'Localizable.strings'
on 'nl'.
2025-08-23 17:57:15 +00:00
55dbb46bb5 Export strings for translation
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-08-23 11:08:07 -04:00
transifex-integration[bot]
dc8e647c34 Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
eb25ff3584 Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
0ae03fc3f3 Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
e60f74eb9f Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
0d75f9cdd9 Translate Localizable.strings in pt_PT
100% translated source file: 'Localizable.strings'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
33a3ddbfd6 Translate Localizable.stringsdict in pt_PT
100% translated source file: 'Localizable.stringsdict'
on 'pt_PT'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
6555531846 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
97b9d06774 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:14 -04:00
transifex-integration[bot]
198448b114 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
a0333058a6 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
e640d5185e Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
9723718bc5 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
08e19fd395 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
7f39c3c4b2 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:13 -04:00
transifex-integration[bot]
cd3314c068 Translate Localizable.strings in th
100% translated source file: 'Localizable.strings'
on 'th'.
2025-08-23 11:05:12 -04:00
f73c0ec1c4 Add support for scanning nprofile QR codes
Changelog-Added: Added support for scanning nprofile QR codes

Closes: https://github.com/damus-io/damus/issues/2671
Signed-off-by: Terry Yiu <git@tyiu.xyz>
2025-08-18 19:10:51 -07:00
Daniel D’Aquino
05b62c5860 Fix edge case around bolt11 invoice parsing
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3190
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-13 12:54:46 -07:00
Daniel D’Aquino
fae061cec0 Fix MAX_PREFIX parameter on bolt11 parsing logic
Closes: https://github.com/damus-io/damus/issues/3187
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
4570ba797c Verify events at RelayConnection
This commit introduces a verification step at the relay connection
level, to help ensure notes get validated at the source and prevent
security issues associated with untrusted relays.

`RelayConnection.swift` — the source that initially handles WebSocket
messages — was analyzed, and measures were put in place to prevent
(or at least minimize) unverified nostr event data being spread
throughout the app.

The following measures were taken:
1. A note verification step was added prior to the `self.handleEvent(.nostr_event(ev))` call (which sends a Nostr response to the rest of the app for logical handling).
    a. From code analysis, there is only one such call in `RelayConnection.swift`.
2. `NostrConnectionEvent`, the object that gets passed to event handlers, had its interface modified to remove the "message" case, since:
    a. that could be a source of unverified nostr events.
    b. it is redundant an unneeded due to the `.nostr_event` case.
    c. there were no usages of it around the codebase
3. The raw websocket event handler had its label renamed to "handleUnverifiedWSEvent", to make it clear to the caller about the verification status of the data.
    a. Usages of this were inspected and no significant risk was detected.
4. A new `verify` method in NdbNote was created to verify Nostr notes, and unit tests were added to confirm tampering detections around all the major fields in a Nostr note.
5. Care was taken to ensure the performance regression is as little as
   possible.

It is worth noting that we will not need this once the local relay model
architecture is introduced, since that architecture ensures note
validation before it reaches the rest of the application and the user.

In other words, this is a temporary fix.

However, since the migration to that new architecture is a major
undertaking that will take some time to be completed, this fix was written
in order to address security concerns while the migration is unfinished.

This fix was written in a way that attempts to be as effective as
possible in reducing security risks without a risky and lenghty
refactor of the code that would delay the fix from being published.

Changelog-Fixed: Improved security around note validation
Closes: https://github.com/damus-io/damus/issues/1341
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
d1ea081018 Fix regressions in note content rendering logic
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3150
Closes: https://github.com/damus-io/damus/issues/3158
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
682704b2cb Fix quoted note regression
This fixes a regression that caused quoted notes not to appear.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3163
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
176f1a338a Fix app swap crash
This commit fixes a crash that occurred when swapping between Damus and
other apps.

When Damus enters background mode, NostrDB is closed and its resources
released. When Damus re-enters foreground mode, NostrDB is reopened.

However, an issue with the transaction inheritance logic
caused a race condition where a side menu profile lookup would get an
obsolete transaction containing pointers that have been freedwhen
NostrDB was closed, causing a "use-after-free" memory error.

The issue was fixed by improving the transaction inheritance logic to
double-check if the "generation" counter (which auto increments when
Damus closes and re-opens) matches the generation marked on the
thread-specific transaction. This effectively prevents lookups from
inheriting an obsolete transaction from a previous NostrDB generation.

Closes: https://github.com/damus-io/damus/issues/3167
Changelog-Fixed: Fixed an issue where the app would crash when swapping between apps
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
fc1eb326e8 Render profile bios
Note: This brings us closer to feature parity with the master branch, so there
is no changelog item to be added

Closes: https://github.com/damus-io/damus/issues/3156
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
5e420187e0 Fix highlight comment rendering
Closes: https://github.com/damus-io/damus/issues/3129
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
4815c8a6f7 Fix nprofile parsing failure
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
f42ae0673d Reword subscript out-of-bounds assertion
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
474e2d8d57 Disable bai kanji test
To be fixed on https://github.com/damus-io/damus/issues/3154

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
95a91bed7e Disable invoice block parsing tests
It was decided on a standup meeting that this feature is not important
and failing tests can be disabled.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
ff12d8bd7e Prevent crash from ndb search test
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
f8245a7b0e Update Invoice tests to use the new blocks interface, and fix reverse blocks iteration indexing
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
4036995348 Remove deprecated nrelay uses from tests
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
5b6534fd56 Fix stack corruption in bech32 parsing
This commit fixes a stack corruption issue caused by
an off-by-one error in one of the functions responsible
for parsing bech32 entities.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
bdd10cccaa Do not show images twice
This commit fixes a logical error in the blocks rendering function.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3133
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
e9f4cbe881 Make NdbBlock ~Copyable for better lifetime safety
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3127
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
91abd187d3 Improve lifetime handling in collectBlocks
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
b9d8b1dbf3 Fix blocks_size calculation
Previously two addresses from different memory regions were being
subtracted, which will lead to the incorrect number. This commit
improves the calculation.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
12a7b483a0 Fix incorrect buffer size argument in block parsing
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
caa7802bce Fix broken DM rendering
Currently NostrDB does not seem to handle encryption/decryption of DMs.
Since NostrDB now controls the block parsing process and fetches note
contents directly from the database, we have to add a specific condition
that injects decrypted content directly to the ndb content parser.

This is done in conjunction with some minor refactoring to `NdbBlocks`
and associated structs, as in C those are separated between the content
string and the offsets for each block, but in Swift this is more
ergonomically represented as a standalone/self-containing object.

No changelog entry is added because the previously broken version was
never released to the public, and therefore this fix produces no
user-facing changes compared to the last released version.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3106
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00
Daniel D’Aquino
9c47d2e0bd Temporarily disable broken tests
Some tests have been broken at some point during the nostrdb migration.
Disable them for now and address them later
(https://github.com/damus-io/damus/issues/3112)

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-08-11 16:40:01 -07:00