mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Socket api: Add a VERSION command
This commit is contained in:
parent
61138b58bf
commit
253d65727b
@ -22,6 +22,7 @@
|
||||
#include "mirall/theme.h"
|
||||
#include "mirall/syncjournalfilerecord.h"
|
||||
#include "mirall/syncfileitem.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QUrl>
|
||||
@ -32,6 +33,11 @@
|
||||
#include <QDir>
|
||||
#include <QApplication>
|
||||
|
||||
// This is the version that is returned when the client asks for the VERSION.
|
||||
// The first number should be changed if there is an incompatible change that breaks old clients.
|
||||
// The second number should be changed when there are new features.
|
||||
#define MIRALL_SOCKET_API_VERSION "1.0"
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum csync_exclude_type_e {
|
||||
@ -400,4 +406,10 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, QTcpSocket
|
||||
sendMessage(socket, message);
|
||||
}
|
||||
|
||||
void SocketApi::command_VERSION(const QString&, QTcpSocket* socket)
|
||||
{
|
||||
sendMessage(socket, QLatin1String(MIRALL_VERSION_STRING ":" MIRALL_SOCKET_API_VERSION));
|
||||
}
|
||||
|
||||
|
||||
} // namespace Mirall
|
||||
|
||||
@ -59,6 +59,8 @@ private:
|
||||
Q_INVOKABLE void command_RETRIEVE_FOLDER_STATUS(const QString& argument, QTcpSocket* socket);
|
||||
Q_INVOKABLE void command_RETRIEVE_FILE_STATUS(const QString& argument, QTcpSocket* socket);
|
||||
|
||||
Q_INVOKABLE void command_VERSION(const QString& argument, QTcpSocket* socket);
|
||||
|
||||
private:
|
||||
QTcpServer *_localServer;
|
||||
QList<QTcpSocket*> _listeners;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user