Skip to content

Remove Swiften dependency from plugins#470

Open
vitalyster wants to merge 7 commits into
masterfrom
noswiften
Open

Remove Swiften dependency from plugins#470
vitalyster wants to merge 7 commits into
masterfrom
noswiften

Conversation

@vitalyster

@vitalyster vitalyster commented Mar 30, 2023

Copy link
Copy Markdown
Collaborator

Remove Swiften dependency from backend plugins.

Replace Swiften networking (Swift::Connection, BoostNetworkFactories, SimpleEventLoop) with Boost.Asio via new BoostNetworkPlugin class.

Changes

  • protocol/: new transport-protocol library — wire protocol, Config, Util, MemoryUsage, Logging
  • BoostNetworkPlugin: Boost.Asio TCP + deadline_timer replaces Swift::Connection + Swift::Timer
  • Backend plugins link transport-plugin instead of transport
  • Storage backends stay in libtransport — plugins access via protocol
  • smstools3: refactored to use protocol-based routing instead of direct StorageBackend
  • HTTPRequest, HTTPRequestQueue, ThreadPool remain in libtransport
  • New ENABLE_SLACK_FRONTEND CMake option (default OFF), enabled in CI

Architecture

transport-protocol ← shared wire protocol, no Swiften
     ↑              ↑
transport (Swiften)  transport-plugin (no Swiften)
     ↑                    ↑
spectrum2 +         frotz, libcommuni, swiften,
Slack frontend      smstools3, template

🤖 Generated with Claude Code

@Neustradamus

Copy link
Copy Markdown

Dear @vitalyster,

Have you progressed on it?

Swiften can be totally removed?

- slack/*.cpp added to SRC_TEST glob (was dead SRC variable)
- slack frontend sources added to add_executable, not target_link_libraries
- Fixes AdminInterfaceTest and SlackRTMTest not being compiled
vitalyster added a commit that referenced this pull request Jun 17, 2026
This file was never part of the original PR #470 — it was created
in this session and incorrectly shadows spectrum/src/frontends/slack/SlackRTM.h
which provides the full class definition. The .cpp's #include "SlackRTM.h"
resolved to the frontend header via include_directories before this file
existed, and it does so again now.

Co-Authored-By: Claude <noreply@anthropic.com>
vitalyster added a commit that referenced this pull request Jun 17, 2026
PR #470 rewrote HTTPRequest.h and deleted HTTPRequestQueue, breaking
the Slack frontend. OAuth2.cpp was updated to use simplified API.

Fix: single Transport::HTTPRequest with both the full API (ThreadPool,
JSON, callbacks, signals — for Slack frontend) and simple API (default
constructor, public init/GET/getCurlError — for OAuth2.cpp).

Implementation in plugin/cpp/ (transport-plugin) so plugins can use
HTTP without linking libtransport. libtransport links transport-plugin,
Slack frontend links transport which links transport-plugin — single
class accessible everywhere.

- include/transport/HTTPRequest.h: unified class, both APIs
- include/transport/HTTPRequestQueue.h: restored from master
- plugin/cpp/HTTPRequest.cpp: full Transport::HTTPRequest implementation
- plugin/cpp/HTTPRequestQueue.cpp: restored from master

Co-Authored-By: Claude <noreply@anthropic.com>
@vitalyster vitalyster force-pushed the noswiften branch 2 times, most recently from 17e1bd8 to 0a5e59f Compare June 17, 2026 21:29
@vitalyster vitalyster force-pushed the noswiften branch 2 times, most recently from 3da14f8 to d126ca1 Compare June 17, 2026 21:45
Replace Swiften networking (Swift::Connection, BoostNetworkFactories,
SimpleEventLoop) with Boost.Asio in backend plugins via new
BoostNetworkPlugin class. Create transport-protocol library for
shared wire protocol and utilities used by both frontend and backend.

Key changes:
- protocol/: new transport-protocol library — wire protocol, Config,
  Util, MemoryUsage, Logging
- plugin/cpp/BoostNetworkPlugin: Boost.Asio TCP + deadline_timer
  replaces Swift::Connection + Swift::Timer
- Backend plugins link transport-plugin instead of transport
- Storage backends stay in libtransport — plugins access via protocol
- smstools3: refactored to use protocol-based routing (std::map)
  instead of direct StorageBackend access
- HTTPRequest, HTTPRequestQueue, ThreadPool remain in libtransport
- Add ENABLE_SLACK_FRONTEND CMake option (default OFF), enable in CI
- Unity build fix: rename duplicate logger in NetworkPluginServer
- Various cleanup: dead includes, override keywords, indentation

Co-Authored-By: Claude <noreply@anthropic.com>
vitalyster and others added 2 commits June 18, 2026 01:27
libtransport_test needs to be in the install target so cmake --install
copies it to dist/bin/ with all required DLLs (transport-protocol,
transport-plugin, transport) for Windows test execution.

Co-Authored-By: Claude <noreply@anthropic.com>
Shared library on Windows generates a .dll (RUNTIME) and .lib (ARCHIVE).
Missing RUNTIME destination meant the DLL was not copied to install prefix.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants