fix: add gloox lib to make command & fix: move client class to mm window

This commit is contained in:
hexlocation 2025-02-10 10:35:10 +00:00
parent e8704f731f
commit b9b1b50599
9 changed files with 10 additions and 30 deletions

View file

@ -1,6 +1,6 @@
BINARY=renga
CPP=clang
FLAGS=-lbe -std=c++20 -lstdc++
FLAGS=-lbe -lgloox -std=c++20 -lstdc++
all: build

View file

@ -8,16 +8,13 @@
#include <Application.h>
#define kSignature "application/x-vnd.iwakura-Renga"
class Client : public gloox::ConnectionListener, gloox::PresenceHandler {
};
#define appName "Renga"
#define appVersion "v0.1"
class App : public BApplication
{
public:
App(void);
Client *client;
};
#endif

View file

@ -1,8 +0,0 @@
#include <gloox/connectionlistener.h>
#include <gloox/presencehandler.h>
#include "Client.h"
#include <Application.h>
Client::
#endif

View file

@ -1,14 +0,0 @@
#ifndef CLIENT_H
#define CLIENT_H
#include <gloox/connectionlistener.h>
#include <gloox/presencehandler.h>
#include <Application.h>
class Client : public gloox::ConnectionListener, gloox::PresenceHandler {
public:
void connect(void);
};
#endif

View file

@ -6,7 +6,7 @@
#include <Window.h>
#include <StringView.h>
Contacts::Contacts(void)
Contacts::Contacts()
: BWindow(BRect(200,200,600,400), TITLE, B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_QUIT_ON_WINDOW_CLOSE)
{
BGroupLayout *group = new BGroupLayout(B_VERTICAL);

View file

@ -7,6 +7,7 @@
class Contacts : public BWindow {
public:
Contacts(void);
void onMessage(const char* jid, const char* msg);
};
#endif

View file

@ -75,6 +75,7 @@ void MainWindow::MessageReceived(BMessage *msg)
printf("Connect button clicked...\n");
Hide();
Middleman *middleman = new Middleman(JidInputBox->Text(), PwInputBox->Text(), Application);
middleman->Show();

View file

@ -18,6 +18,6 @@ Middleman::Middleman(const char* jid, const char* password, App *app)
group->View()->AdoptSystemColors();
group->AddView(new BStringView("label", "Placeholder label (connection middleman to be added)"));
group->AddView(new BStringView("label", "Placeholder label (connecting...)"));
group->AddView(new BStringView("label", std::format("JID: {}\nPassword: {}", jid, password).c_str()));
}

View file

@ -5,6 +5,9 @@
#include "../App.h"
#define TITLE "Connecting..."
// Middleman is the "middle" window that sets up the XMPP connection and manages all windows that require one.
// TODO: add client class to mm class for windows to send message
class Middleman : public BWindow {
public:
Middleman(const char* jid, const char* password, App *app);