Compare commits
5 Commits
54bda18e7c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84f12f6c0b | ||
|
|
4fea965521 | ||
|
|
d29f45dbd2 | ||
|
|
981e8e3048 | ||
|
|
5ebeeef3c2 |
@@ -1,5 +1,7 @@
|
||||
#include <solanaceae/plugin/solana_plugin_v1.h>
|
||||
|
||||
#include <solanaceae/contact/contact_store_i.hpp>
|
||||
|
||||
#include <solanaceae/ircclient/ircclient.hpp>
|
||||
#include <solanaceae/ircclient_contacts/ircclient_contact_model.hpp>
|
||||
#include <solanaceae/ircclient_messages/ircclient_message_manager.hpp>
|
||||
|
||||
@@ -8,6 +8,7 @@ add_library(solanaceae_ircclient
|
||||
)
|
||||
|
||||
target_include_directories(solanaceae_ircclient PUBLIC .)
|
||||
target_compile_definitions(solanaceae_ircclient PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_features(solanaceae_ircclient PRIVATE cxx_std_20)
|
||||
target_compile_features(solanaceae_ircclient INTERFACE cxx_std_17)
|
||||
target_link_libraries(solanaceae_ircclient PUBLIC
|
||||
@@ -27,6 +28,7 @@ add_library(solanaceae_ircclient_contacts
|
||||
)
|
||||
|
||||
target_include_directories(solanaceae_ircclient_contacts PUBLIC .)
|
||||
target_compile_definitions(solanaceae_ircclient_contacts PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_features(solanaceae_ircclient_contacts PRIVATE cxx_std_20)
|
||||
target_compile_features(solanaceae_ircclient_contacts INTERFACE cxx_std_17)
|
||||
target_link_libraries(solanaceae_ircclient_contacts PUBLIC
|
||||
@@ -43,6 +45,7 @@ add_library(solanaceae_ircclient_messages
|
||||
)
|
||||
|
||||
target_include_directories(solanaceae_ircclient_messages PUBLIC .)
|
||||
target_compile_definitions(solanaceae_ircclient_messages PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
target_compile_features(solanaceae_ircclient_messages PRIVATE cxx_std_20)
|
||||
target_compile_features(solanaceae_ircclient_messages INTERFACE cxx_std_17)
|
||||
target_link_libraries(solanaceae_ircclient_messages PUBLIC
|
||||
|
||||
@@ -70,11 +70,25 @@ bool IRCClientContactModel::addContact(Contact4 c) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// irc provides invites
|
||||
bool IRCClientContactModel::acceptRequest(Contact4 c, std::string_view self_name, std::string_view password) {
|
||||
// TODO: implement
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IRCClientContactModel::leave(Contact4 c, std::string_view reason) {
|
||||
// TODO: implement
|
||||
return false;
|
||||
}
|
||||
|
||||
// irc provides invite
|
||||
bool IRCClientContactModel::invite(Contact4 c, Contact4 to) {
|
||||
// TODO: implement
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IRCClientContactModel::canInvite(Contact4 c, Contact4 to) {
|
||||
// TODO: implement
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <queue>
|
||||
#include <cstdint>
|
||||
|
||||
#include <iostream> // tmp
|
||||
|
||||
class IRCClientContactModel : public IRCClientEventI, public ContactModel4I {
|
||||
ContactStore4I& _cs;
|
||||
ConfigModelI& _conf;
|
||||
@@ -45,6 +43,8 @@ class IRCClientContactModel : public IRCClientEventI, public ContactModel4I {
|
||||
bool addContact(Contact4 c) override;
|
||||
bool acceptRequest(Contact4 c, std::string_view self_name, std::string_view password) override;
|
||||
bool leave(Contact4 c, std::string_view reason) override;
|
||||
bool invite(Contact4 c, Contact4 to) override;
|
||||
bool canInvite(Contact4 c, Contact4 to) override;
|
||||
|
||||
private:
|
||||
// just the hash algo
|
||||
|
||||
@@ -188,7 +188,7 @@ bool IRCClientMessageManager::onEvent(const IRCClient::Events::Channel& e) {
|
||||
|
||||
// e.params.at(0) is channel
|
||||
auto channel = _ircccm.getC(e.params.at(0)); // aka ContactTo
|
||||
if (!channel.valid()) {
|
||||
if (!static_cast<bool>(channel)) {
|
||||
std::cerr << "IRCCMM error: channel event unknown channel\n";
|
||||
return false;
|
||||
}
|
||||
@@ -207,14 +207,14 @@ bool IRCClientMessageManager::onEvent(const IRCClient::Events::PrivMSG& e) {
|
||||
|
||||
// e.origin is sender
|
||||
auto from = _ircccm.getU(e.origin); // assuming its always a user // aka ContactFrom
|
||||
if (!from.valid()) {
|
||||
if (!static_cast<bool>(from)) {
|
||||
std::cerr << "IRCCMM error: privmsg event unknown sender\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
// e.params.at(0) is receiver (us?)
|
||||
auto to = _ircccm.getU(e.params.at(0)); // aka ContactTo
|
||||
if (!to.valid()) {
|
||||
if (!static_cast<bool>(to)) {
|
||||
std::cerr << "IRCCMM error: privmsg event unknown channel\n";
|
||||
return false;
|
||||
}
|
||||
@@ -259,14 +259,14 @@ bool IRCClientMessageManager::onEvent(const IRCClient::Events::ChannelNotice& e)
|
||||
|
||||
// e.origin is sending user (probably)
|
||||
auto from = _ircccm.getU(e.origin);
|
||||
if (!from.valid()) {
|
||||
if (!static_cast<bool>(from)) {
|
||||
std::cerr << "IRCCMM error: channel notice event unknown sender\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
// e.params.at(0) is channel
|
||||
auto to = _ircccm.getC(e.params.at(0));
|
||||
if (!to.valid()) {
|
||||
if (!static_cast<bool>(to)) {
|
||||
std::cerr << "IRCCMM error: unknown receiver\n";
|
||||
return false;
|
||||
}
|
||||
@@ -285,14 +285,14 @@ bool IRCClientMessageManager::onEvent(const IRCClient::Events::CTCP_Action& e) {
|
||||
|
||||
// e.origin is sender
|
||||
auto from = _ircccm.getU(e.origin); // assuming its always a user // aka ContactFrom
|
||||
if (!from.valid()) {
|
||||
if (!static_cast<bool>(from)) {
|
||||
std::cerr << "IRCCMM error: channel event unknown sender\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
// e.params.at(0) is receiver (self if pm or channel if channel)
|
||||
auto receiver = _ircccm.getCU(e.params.at(0));
|
||||
if (!receiver.valid()) {
|
||||
if (!static_cast<bool>(receiver)) {
|
||||
std::cerr << "IRCCMM error: unknown receiver\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user