Commit Graph
318 Commits
Author SHA1 Message Date
Julian Schmidhuber 2887ebd771 fix(backend): Partial fix for messages loading a long time if backend busy
If the backend is busy, e.g. downloading attachments, this would block
the entire backend thread as it cannot handle multiple commands at the
same time (it will directly await on executing the first command, and
only afterwards handle the second one). Fixing this problem is very
difficult as the presage::Manager cannot be sent between threads. One
therefore needs to use tokio::task::LocalSet for the fix, which runs the
futures on the current tokio thread. This still leads to problems though
as many functions in the manager require mutable (and therefore
exclusive) access to the manager. There is no good way to fix it except
for wrapping the manager in a RwLock (I have chosen to use one from
tokio, as using the one in std would likely lead to clippy issues with
hold locks accross await points). This is only a partial fix though, if
some method requires mutable access to the manager, this still blocks
every other method from executing. But it should at least fix the most
serious contenders, like downloading attachments. I don't know a better
fix at this time.

Potentially related to #271.
2025-10-19 16:03:17 +02:00
Julian Schmidhuber 5bb693a3d3 chores(manager-thread): Rework restarting when the network changes
Previously, we restarted the manager loop whenever the device wakes up
from suspend. This required additional permissions. Instead, we can
restart the manager loop whenever the network changes to the "available"
state.
2025-10-13 14:10:06 +02:00
Julian Schmidhuber 11baa9bbbc fix(preedit): Implemented support for preedit
This fixes #272.
2025-10-09 14:03:16 +02:00
Julian Schmidhuber f3c3c03d8b chores(clippy): Fix clippy lints
Mostly merging if-let-chains into one, which was previously not possible.
2025-10-08 16:55:02 +02:00
Julian Schmidhuber 4a79f7c5cb chores(deps): Update all dependencies and the flake 2025-10-08 16:55:02 +02:00
Julian Schmidhuber ce2f0722d4 fix(profile): Fix profile name not displayed correctly
Fixes #248 and #263. I'm not completely sure what the cause of this issue is, but
presage sometimes overwrites a contact with an empty contact except for
the phone number which is set. This in particular unsets the profile key,
which we use to fetch profile information. For some reason, presage also
stores the profile key in a separate table. We can get our profile key
from there in case it is unset from a contact.
2025-07-18 11:34:29 +02:00
Julian Schmidhuber 7750694ec4 chores(presage)!: Update the presage store to sqlite
This updates the underlying store used by presage from sled to sqlite.
This change is not backwards compatible, as there currently exists no
migration between the two stores.

While the main reason behind the change from sled to sqlite was, at least
in my eyes, the features which could be implemented using a real
database, the upstream store will still not allow for such features as
there is still binary data stored inside the database, instead of
structured data like I wanted to have. I raised the concern upstream, but
it was mentioned that such a change could be done in the future.

Porting Flare to this new store required a few fixes from my side, which
I contributed upstream in the following PR: https://github.com/whisperfish/presage/pull/321.
The change also required some bigger changes from the Flare side, as
sqlx (the crate presage uses to interface with sqlite) requires a tokio
runtime, and could therefore lead to crashes if the store was used from
the glib thread. That is why I wrapped all (at least I hope I did not
miss any) calls to the store and internal manager in a tspawn. Some of
those would maybe not be required, but better be on the save side in case
the functions of presage change to access the store where they previously
did not.

I also introduced a new error in case creation of the folder holding
the database failed. There is also still one potential to panic in case
this path is not UTF-8, but I don't care about that right now.
Furthermore, presage changed the order of messages being returned from
incrementing timestamps to decrementing timestamps, I therefore had to
throw away iterator reversal I did in Flare. Other than those changes,
the rest of this commit pretty much only replaces references from the
sled store to the sqlite store.
2025-07-18 11:34:29 +02:00
Julian Schmidhuber edf111fbca chores(clippy): Fix clippy lints
This fixes warnings created in the CI due to clippy updates. The only
lint I had to fix was inserting variables into their respective format
strings.
2025-07-07 16:50:09 +02:00
Julian Schmidhuber 9c7d4c063e chores(clippy): Fix clippy lint 2025-06-14 10:23:43 +02:00
Julian Schmidhuber 5b110d64c9 chores(fmt): Run cargo format with new Rust version 2025-06-14 10:13:40 +02:00
Julian Schmidhuber 824fab6779 fix(message): Fix some bugs regarding mentions
This fixes two issues regarding mentions. The first one is that mentions
are actually not highlighted anymore in the text. This probably broke
with the introduction of the special label for messages which allows to
have the timestamp the message was sent at in-line with the actual
message. The bug was caused by overwriting the message attributes when
setting the label, instead of merging the attributes caused by mentions
and the attribute for blank space reserved for the message timestamp. To
fix the issue, the label now saves the message attributes being set and
adds those attributes to the attributes of the underlying label when it
is updated.

The second bug was that message attributes in quotes were using the
attributes of the quoting message instead of the quote itself. The fix is
just a simple change in the blueprint file, taking the attributes for the
label from the quoted message instead of the quoting message.
2025-06-02 18:35:56 +02:00
Julian Schmidhuber 4eb7ea4d88 chores(spelling): Fix spelling of error message
Fixes #261.
2025-05-29 16:19:20 +02:00
Julian Schmidhuber d90b5f734a fix(message): Fix emoji message not showing the header
This can be confusing as one could in that case interpret the message
being sent from a different sender in a group chat. The fix was just
removing a single line of code, which probably got included by accident.
2025-05-24 17:25:26 +02:00
Julian Schmidhuber 50cdfedf20 Merge branch 'stickers' into 'master'
Implement receiving stickers

Closes #237

See merge request schmiddi-on-mobile/flare!175
2025-04-22 14:09:38 +00:00
Julian Schmidhuber fa063e6db4 chores(about): Initialize about window from metainfo
This is to make it similar to other projects of Schmiddi on Mobile.
2025-04-22 15:23:17 +02:00
Julian Schmidhuber 6f67831821 feat(stickers): Implement receiving stickers
Implement receiving stickers, which can just be handled as attachments.
Some notes:

- Animated stickers do not seem to work for me.
  But I am not sure whether GIFs work in general for Flare right now,
  I remember that they did not work sometimes.
- A sticker pack I had did not set a content type for its files.
  I just hard-coded image/webp (which was the file type) for such files.
  This is extremely ugly, one may want to detect what the content type
  is in such cases. Some sticker packs also mention a completely
  different mime type to what they actually are, but this does not need
  to be handled as gtk::Picture handles that fine.
- Loading webp into a pixbuf does not work by default on the nix build.
  I needed to add an environmental variable to the flake to make it work.
2025-04-22 14:46:01 +02:00
Julian Schmidhuber 058802f3f0 fix(receive): Keep receiving messages even after an error occurred 2025-03-08 13:31:38 +01:00
Julian Schmidhuber a11dfecea2 fix(networking): Ignore one more networking error 2025-03-08 13:30:43 +01:00
Julian Schmidhuber 444c5e3b1b Merge branch 'remove-feedbackd' into 'master'
Let notification daemon handle feedback

See merge request schmiddi-on-mobile/flare!171
2025-03-06 18:09:38 +00:00
Julian Schmidhuber eea3bbbe51 notification(feedbackd): Let notification daemon handle feedback
Phosh by default already gives feedback with a proper notification
category set. Therefore, remove the (optional) dependency on feedbackd.

See also <https://gitlab.gnome.org/World/Chatty/-/merge_requests/1431>.
2025-03-06 18:31:46 +01:00
Julian Schmidhuber 7a91095066 fix(startup): Fix crash on startup if application is already running 2025-03-06 17:58:46 +01:00
Julian Schmidhuber 2ce2936174 Merge branch 'fix-attachment-box-massive' into 'master'
Fix attachment box being massive

See merge request schmiddi-on-mobile/flare!168
2025-03-06 16:57:58 +00:00
Julian Schmidhuber 7fab541bf0 fix(attachment): Fix attachment box being massive 2025-03-02 17:06:20 +01:00
Hugo Osvaldo Barrera 66ac1155bc Enforce lockfile usage for release builds
The --locked flag ensures that the lockfile is used and cargo does not
attempt to change the lockfile due to different dependency resolution.

It is recommended when deterministic builds are desired. Release builds
should be deterministic.
2025-03-01 11:57:51 +01:00
Julian Schmidhuber 64738304f6 fix(attachment): Fix sending PNG images 2025-02-27 17:22:46 +01:00
Julian Schmidhuber 17b8dcd994 fix(error): Hide some more "no network" errors
Untested, but should work. This is due to reqwest 0.12.0 changing the
error message compared to 0.11.0, the source of the error is now not
included in the Display implementation anymore, but has to be received
manually.
2025-02-23 15:54:55 +01:00
Julian Schmidhuber 0fa253fec1 chores(deps): Update all dependencies 2025-02-13 19:38:54 +01:00
Julian Schmidhuber b52dacc496 hotfix(): Fix "Unauthorized" error
Just needed to bump presage, and fix a few breakages.

Fixes #242.
2025-01-16 10:31:36 +01:00
Julian Schmidhuber f3f229bc14 chores(deps): Update dependencies
Upstream presage mentioned some further fixes which should improve
compatibility with Signal.
2024-11-11 17:09:05 +01:00
Integral 4681a06d19 refactor: destruct tuples to enhance readability 2024-11-07 12:23:56 +08:00
Julian Schmidhuber 4be30f333c chores(): Update presage 2024-10-28 16:18:40 +01:00
Julian Schmidhuber f1ba2c72ab fix(fmt): Fix cargo fmt 2024-10-14 18:55:42 +02:00
Julian Schmidhuber ca530f847b fix(build): Fix broken build 2024-10-14 18:41:56 +02:00
Tim Magee f90e2b64fb add counts for reaction emojis that are used more than once 2024-10-13 11:35:51 -04:00
Julian Schmidhuber 2bec8509b1 chores(deps): Update to GNOME 47
This allows the usage of Adw.ButtonRow to improve the UI of the linked
devices window and the contact info window.

Fixes #205.
2024-10-06 15:32:22 +02:00
Julian Schmidhuber ad9b59c7ee fix(link): Fix linking error
Even though the update MR is not yet merged, I would consider this issue
important enough to do a release nevertheless.

Closes #221.
2024-09-26 16:03:50 +02:00
Julian Schmidhuber d36feee988 perf(memory): Decrease the initial number of messages loaded and kept
This potentially reduces the memory requirement slightly, but has not
yet been extensively tested.
2024-09-13 13:17:54 +02:00
Julian Schmidhuber 7842252821 fix(cargo-deny): Fix cargo deny advisories
This also includes an update of the depednencies and removing the
`err-derive` dependency in favor of manually implementing the one error
this is used in.
2024-09-09 15:56:25 +02:00
Julian Schmidhuber 5b3eaf4f02 ui(entry): Set text entry input-hints
Fixes #220.
2024-09-02 16:05:45 +02:00
Julian Schmidhuber 4818dd02e2 chores(fmt): Format code 2024-08-06 17:33:29 +02:00
Julian Schmidhuber e8b8f88e84 chores(clippy): Apply fixes for clippy 2024-08-06 17:33:29 +02:00
Julian Schmidhuber 550830ade1 chores(deps): Update gtk-rs and related dependencies
Had some breaking changes:

- `libadwaita::Dialog::present` now takes an `Option`,
- `glib::clon!` has a new syntax

The porting guide is detailed [here](https://gtk-rs.org/blog/2024/07/17/new-release.html).
2024-07-30 16:30:41 +02:00
Julian Schmidhuber ab44f5911e chores(deps): Update presage
This contains an important fix for linking being broken. It also
contains a fix for a potentially big issue with reliability issue,
but this has not yet been confirmed.

Fixes https://gitlab.com/schmiddi-on-mobile/flare/-/issues/215.
See https://github.com/whisperfish/presage/pull/254.
See https://github.com/whisperfish/presage/pull/259.
2024-07-22 18:54:43 +02:00
Julian Schmidhuber 6be65e4683 chores(rust): Remove unused functions 2024-06-19 15:38:30 +02:00
Julian Schmidhuber 40b4aa26a4 feat(primary): Add env variable to enable primary device button on setup 2024-06-16 14:44:09 +02:00
Julian Schmidhuber 850e099bd5 chores(deps): Update presage
Also finishes the implementation of the linked devices window, as
primary-device now works again after the update.
2024-06-16 14:44:09 +02:00
Julian Schmidhuber 7cd08d31db fix(login1): Not working on missing login1 interface 2024-06-02 12:43:02 +02:00
Julian Schmidhuber 239f3d6afb fix(notification): Fix sometimes no notification sent
This happened when the application was running in the background, and
only for the last active channel.

Fixes #203.
2024-04-28 15:40:30 +02:00
Julian Schmidhuber 165b611712 fix(panic): Potential fix for panics on some reactions 2024-04-17 16:51:25 +02:00
Julian Schmidhuber a8c6321528 chores(deps): Update and remove some dependencies 2024-04-01 16:19:57 +02:00