aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-01 12:19:30 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-01 12:19:30 +0100
commit7292fe11254109266e7adb9937e5f0fa797711f6 (patch)
treea581c05e0f0b795646fb1458ce118adf5bb5bd88 /include
parent2278d52b59e9818f08bd73ec6583a1589d9512f2 (diff)
Matrix: add invites tab, add /leave command, remove room when leaving, add async loading for more tasks
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp4
-rw-r--r--include/QuickMedia.hpp8
2 files changed, 9 insertions, 3 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index 1a82443..99f8b1c 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -59,8 +59,9 @@ namespace QuickMedia {
dirty_author = true;
}
+ // |new_timestamp| is in milliseconds
void set_timestamp(time_t new_timestamp) {
- if(timestamp == 0 && new_timestamp == 0)
+ if(new_timestamp == timestamp)
return;
timestamp = new_timestamp;
dirty_timestamp = true;
@@ -90,6 +91,7 @@ namespace QuickMedia {
const std::string& get_title() const { return title; }
const std::string& get_description() const { return description; }
const std::string& get_author() const { return author; }
+ // In milliseconds
time_t get_timestamp() const { return timestamp; }
sf::Color get_title_color() const { return title_color; }
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp
index 821a427..c043962 100644
--- a/include/QuickMedia.hpp
+++ b/include/QuickMedia.hpp
@@ -59,6 +59,10 @@ namespace QuickMedia {
bool is_window_focused();
RoomData* get_current_chat_room();
+
+ void set_go_to_previous_page();
+
+ TaskResult run_task_with_loading_screen(std::function<bool()> callback);
private:
void base_event_handler(sf::Event &event, PageType previous_page, Body *body, SearchBar *search_bar, bool handle_key_press = true, bool handle_searchbar = true);
void page_loop(std::vector<Tab> &tabs);
@@ -71,8 +75,6 @@ namespace QuickMedia {
void chat_page(MatrixChatPage *chat_page, RoomData *current_room);
void after_matrix_login_page();
- TaskResult run_task_with_loading_screen(std::function<bool()> callback);
-
enum class LoadImageResult {
OK,
FAILED,
@@ -135,5 +137,7 @@ namespace QuickMedia {
std::vector<std::string> selected_files;
bool fit_image_to_window = false;
RoomData *current_chat_room = nullptr;
+ bool go_to_previous_page = false;
+ std::thread::id main_thread_id;
};
} \ No newline at end of file