Skip to content

Commit

Permalink
Store avatars in the user's cache directory.
Browse files Browse the repository at this point in the history
	- Not anymore in ~/.local/share, where media files are stored.
  • Loading branch information
eerielili committed Sep 22, 2024
1 parent d20553a commit 1757a97
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libdino/src/application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public interface Application : GLib.Application {
public static string get_storage_dir() {
return Path.build_filename(Environment.get_user_data_dir(), "dino");
}

public static unowned Application get_default() {
return (Dino.Application) GLib.Application.get_default();
}
Expand Down
2 changes: 1 addition & 1 deletion libdino/src/service/avatar_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AvatarManager : StreamInteractionModule, Object {
private AvatarManager(StreamInteractor stream_interactor, Database db) {
this.stream_interactor = stream_interactor;
this.db = db;
this.folder = Path.build_filename(Dino.get_storage_dir(), "avatars");
this.folder = Path.build_filename(Dino.get_cache_dir(), "avatars");
DirUtils.create_with_parents(this.folder, 0700);

stream_interactor.account_added.connect(on_account_added);
Expand Down
2 changes: 1 addition & 1 deletion libdino/src/service/file_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class FileManager : StreamInteractionModule, Object {
FileManager m = new FileManager(stream_interactor, db);
stream_interactor.add_module(m);
}

public static string get_storage_dir() {
return Path.build_filename(Dino.get_storage_dir(), "files");
}
Expand Down
4 changes: 4 additions & 0 deletions libdino/src/util/util.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public static string get_storage_dir() {
return Path.build_filename(Environment.get_user_data_dir(), "dino");
}

public static string get_cache_dir() {
return Path.build_filename(Environment.get_user_cache_dir(), "dino");
}

[CCode (cname = "dino_gettext", cheader_filename = "dino_i18n.h")]
public static extern unowned string _(string s);

Expand Down

0 comments on commit 1757a97

Please sign in to comment.