Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/Messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace DDM {
InformationMessage,
UserActivateMessage,
SwitchToGreeter,
UserLoggedIn,
};

enum Capability {
Expand Down
15 changes: 15 additions & 0 deletions src/daemon/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include "SocketServer.h"
#include "Greeter.h"
#include "Utils.h"
#include "Messages.h"

Check warning on line 34 in src/daemon/Display.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "Messages.h" not found.
#include "SocketWriter.h"

Check warning on line 35 in src/daemon/Display.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "SocketWriter.h" not found.

#include <QDebug>

Check warning on line 37 in src/daemon/Display.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QFile>

Check warning on line 38 in src/daemon/Display.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFile> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QTimer>
#include <QLocalSocket>

Expand Down Expand Up @@ -149,6 +151,9 @@
connect(m_displayServer, &DisplayServer::started, this, &Display::displayServerStarted);
connect(m_displayServer, &DisplayServer::stopped, this, &Display::stop);

// connect connected signal
connect(m_socketServer, &SocketServer::connected, this, &Display::connected);

// connect login signal
connect(m_socketServer, &SocketServer::login, this, &Display::login);

Expand Down Expand Up @@ -365,6 +370,16 @@
emit stopped();
}

void Display::connected(QLocalSocket *socket) {
m_socket = socket;
// send logined user (for possible crash recovery)
SocketWriter writer(socket);
for (Auth *auth : loginedSession()) {
if (auth->isActive())
writer << quint32(DaemonMessages::UserLoggedIn) << auth->user();
}
}

void Display::login(QLocalSocket *socket,
const QString &user, const QString &password,
const Session &session) {
Expand Down
1 change: 1 addition & 0 deletions src/daemon/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace DDM {
bool start();
void stop();

void connected(QLocalSocket *socket);
void login(QLocalSocket *socket,
const QString &user, const QString &password,
const Session &session);
Expand Down