Skip to content

Commit

Permalink
Frontend: Fix sync
Browse files Browse the repository at this point in the history
  • Loading branch information
badcast committed Aug 14, 2023
1 parent 0580f44 commit 00df652
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pkg_check_modules(gthread REQUIRED gthread-2.0)

file(GLOB_RECURSE DRAGONTEA_SOURCES "${CMAKE_SOURCE_DIR}/src/*.c" "${CMAKE_SOURCE_DIR}/include/*.h")

add_executable(msg-app ${DRAGONTEA_SOURCES})
target_compile_definitions(msg-app PUBLIC TEA_APP_VERSION=${PROJECT_VERSION})
target_include_directories(msg-app PUBLIC "${CMAKE_SOURCE_DIR}/include/" ${gtk3ui_INCLUDE_DIRS} ${gthread_INCLUDE_DIRS}
add_executable(dragontea ${DRAGONTEA_SOURCES})
target_compile_definitions(dragontea PUBLIC TEA_APP_VERSION=${PROJECT_VERSION})
target_include_directories(dragontea PUBLIC "${CMAKE_SOURCE_DIR}/include/" ${gtk3ui_INCLUDE_DIRS} ${gthread_INCLUDE_DIRS}
${libcurl_INCLUDE_DIRS} ${json_INCLUDE_DIRS})
target_link_libraries(msg-app ${gtk3ui_LIBRARIES} ${libcurl_LIBRARIES} ${json_LIBRARIES} ${gthread_LIBRARIES})
target_link_libraries(dragontea ${gtk3ui_LIBRARIES} ${libcurl_LIBRARIES} ${json_LIBRARIES} ${gthread_LIBRARIES})
1 change: 1 addition & 0 deletions server-php/messagedb.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function message_read($uid_reader, $uid_target, $msg_id_start, $max_messages = -
}
}
else {
fclose($fd_index);
unlink($msg_cache_file);
}
fclose($fd_mesg);
Expand Down
1 change: 1 addition & 0 deletions src/core/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void tea_ui_chat_clear()
void tea_ui_chat_sync()
{
widgets.chat_tab.chat_synched = FALSE;
on_chat_message_handler_async(NULL);
}

void tea_ui_chat_set_text_top(const char *text)
Expand Down
3 changes: 2 additions & 1 deletion src/core/ui_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ void tea_on_authenticate(struct tea_id_info *user_info)
// reset chances
check_chance_logouting = CHANCE_TO_LOGOUT;

on_chat_message_handler_async(NULL);
//sync
tea_ui_chat_sync();

widgets.chat_tab.timeout_periodic_sync = g_timeout_add(INTERVAL_CHAT_SYNC, G_CALLBACK(on_chat_message_handler_async), NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tea.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const char *get_conf_dir()
strncat(app_settings.config_dir, "/.config/DragonTea", sizeof(app_settings.config_dir));
if(mkdir(app_settings.config_dir, 0700) != 0 && errno != EEXIST)
{
g_print(strerror(errno));
g_print("%s", strerror(errno));
}
#elif WIN32
home_dir = getenv("APPDATA");
Expand Down

0 comments on commit 00df652

Please sign in to comment.