75de08a18b
Protocol messages was added to the API to allow joining abstract rooms by their chat_id― IM_JOIN_ROOM and IM_ROOM_JOINED. To make room in anticipation of future room-related calls, some messages' values have been shifted. A JoinWindow was created (found through [Chat→Join Room] or [Alt-J] in the main window), to allow joining a room with this protocol message. The user can select which account the room should be joined from through a drop-down menu in the lower left-hand corner― a design I think could be replicated in other parts of Caya well. Path() and SetPath() in CayaProtocol were renamed to AddOnPath() and SetAddOnPath() respectively. GetName() and SetName() were also added, where "name" is the account name (aka the leaf of the protocols settings path). To Server, a new KeyMap was added for convenience (AccountInstances), to associate these account names with their instance IDs.
41 lines
724 B
C++
41 lines
724 B
C++
/*
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef JOINWINDOW_H
|
|
#define JOINWINDOW_H
|
|
|
|
#include <Window.h>
|
|
|
|
#include "Server.h"
|
|
|
|
class BMenu;
|
|
class BMenuField;
|
|
class BMessenger;
|
|
class BTextControl;
|
|
|
|
|
|
/* A window used to specify a room to join. */
|
|
class JoinWindow : public BWindow {
|
|
public:
|
|
JoinWindow(BMessenger* messenger, AccountInstances accounts);
|
|
|
|
void MessageReceived(BMessage* message);
|
|
|
|
private:
|
|
void _InitInterface();
|
|
BMenu* _CreateAccountMenu();
|
|
|
|
BMessenger* fTarget;
|
|
AccountInstances fAccounts;
|
|
|
|
BMenuField* fMenuField;
|
|
BTextControl* fTextBox;
|
|
|
|
int32 fSelectedAcc;
|
|
};
|
|
|
|
|
|
#endif // JOINWINDOW_H
|
|
|