forked from Nexus/nexus
OAuth Support (#53)
Rips out the old auth method, adds OAuth support. Fixes #51. Tested Platforms: - [x] Linux - [x] Flatpak - [x] Native (Nix) - [x] Android - [ ] Windows - [ ] MacOS Reviewed-on: Nexus/nexus#53
This commit is contained in:
parent
5df975f607
commit
7d106ad3a2
86 changed files with 558 additions and 1344 deletions
|
|
@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
|
|||
set(BINARY_NAME "nexus")
|
||||
# The unique GTK application identifier for this application. See:
|
||||
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||
set(APPLICATION_ID "nexus.federated.Nexus")
|
||||
set(APPLICATION_ID "nexus.federated.nexus")
|
||||
|
||||
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||
# versions of CMake.
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <dynamic_color/dynamic_color_plugin.h>
|
||||
#include <file_selector_linux/file_selector_plugin.h>
|
||||
#include <gtk/gtk_plugin.h>
|
||||
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
|
||||
#include <media_kit_video/media_kit_video_plugin.h>
|
||||
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||
|
|
@ -21,6 +22,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) gtk_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
|
||||
gtk_plugin_register_with_registrar(gtk_registrar);
|
||||
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
|
||||
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
dynamic_color
|
||||
file_selector_linux
|
||||
gtk
|
||||
media_kit_libs_linux
|
||||
media_kit_video
|
||||
screen_retriever_linux
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@
|
|||
Name=Nexus
|
||||
GenericName=Matrix Client
|
||||
Comment=A simple and user-friendly Matrix client
|
||||
Exec=nexus
|
||||
Exec=nexus %u
|
||||
Icon=nexus
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Chat;Network;InstantMessaging;
|
||||
Categories=Chat;Network;InstantMessaging;
|
||||
MimeType=x-scheme-handler/nexus.federated.nexus;
|
||||
|
|
@ -29,15 +29,14 @@ flutter.buildFlutterApplication {
|
|||
autoPubspecLock = src + "/pubspec.lock";
|
||||
|
||||
gitHashes = {
|
||||
window_size = "sha256-XelNtp7tpZ91QCEcvewVphNUtgQX7xrp5QP0oFo6DgM=";
|
||||
emoji_text_field = "sha256-3TOys09EP2GRo6pUBGPXaqBlE39O2Cmwt42Hs1cTDKo=";
|
||||
linkify = "sha256-mxV/XHLxF9cn7sUPr2SUNjVmDr5lbxkuGCbNdyiZi2c=";
|
||||
linkify = "sha256-TpMD6+0zyY6i9l+6d8ErnVufmepCv362rCtnbOht/z4=";
|
||||
navigation_rail_m3e = "sha256-+2awDTQnK58gGRY1nuHckG/jjxarsYSRu9ovR4i4TEc=";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
install -D assets/icon.svg $out/share/icons/hicolor/scalable/apps/nexus.svg
|
||||
install -Dm755 linux/nexus.federated.Nexus.desktop -t $out/share/applications
|
||||
install -Dm755 linux/nexus.federated.nexus.desktop -t $out/share/applications
|
||||
wrapProgram $out/bin/nexus \
|
||||
--suffix LD_LIBRARY_PATH : $out/app/nexus/lib
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ buildGoModule (finalAttrs: {
|
|||
|
||||
src = "${src}/gomuks";
|
||||
|
||||
vendorHash = "sha256-/Wvx5WjnlPpQILpNqo9075F3nox0Dm8PfqGgck4CifQ=";
|
||||
vendorHash = "sha256-mNZEHOGByVqK1kSLC/Cf1VEvkDxRen+TmoV5CXvGrZ4=";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ static void first_frame_cb(MyApplication* self, FlView *view)
|
|||
// Implements GApplication::activate.
|
||||
static void my_application_activate(GApplication* application) {
|
||||
MyApplication* self = MY_APPLICATION(application);
|
||||
|
||||
GList* windows = gtk_application_get_windows(GTK_APPLICATION(application));
|
||||
if (windows) {
|
||||
gtk_window_present(GTK_WINDOW(windows->data));
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWindow* window =
|
||||
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
||||
|
||||
|
|
@ -93,7 +100,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch
|
|||
g_application_activate(application);
|
||||
*exit_status = 0;
|
||||
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Implements GApplication::startup.
|
||||
|
|
@ -140,6 +147,6 @@ MyApplication* my_application_new() {
|
|||
|
||||
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||
"application-id", APPLICATION_ID,
|
||||
"flags", G_APPLICATION_NON_UNIQUE,
|
||||
"flags", G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_HANDLES_OPEN,
|
||||
nullptr));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue