commit 0f0afa41b13e7a81a544f3ffa74e70a8d943eb35 Author: Kaloyan Nikolov Date: Fri Apr 3 18:49:25 2026 +0200 Initial commit: Messenger TUI project skeleton diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03205e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +# Environment +.env +.env.local +.env.*.local + +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +venv/ +ENV/ +.venv/ + +# Build +dist/ +build/ +*.egg-info/ + +# IDE +.idea/ +.vscode/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Config (secrets) +config.json +*.local.yaml +credentials/ + +# Logs +*.log +logs/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..460e0a7 --- /dev/null +++ b/README.md @@ -0,0 +1,130 @@ +# Messenger TUI + +Terminal-based Matrix client for accessing Facebook Messenger via bridge. + +## Overview + +This project connects to a self-hosted Matrix homeserver with a mautrix-facebook bridge, providing a lightweight TUI for messaging on Messenger without the heavy desktop/mobile apps. + +## Architecture + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Your Server │ +│ ┌─────────────────┐ ┌─────────────────────────────┐ │ +│ │ Matrix Homeserver │ │ mautrix-facebook bridge │ │ +│ │ (Conduit) │◄──►│ │ │ +│ └─────────┬───────────┘ └──────────────┬────────────┘ │ +│ │ │ │ +│ │ Facebook/Meta │ │ +│ │ Messenger │ │ +│ │ ◄──── │ │ +│ │ │ │ +└─────────────┼───────────────────────────────┼────────────────┘ + │ │ + ▼ │ +┌─────────────────────────────────────────────────────────────┐ +│ Your Laptop │ +│ ┌─────────────────────────────────────────────────────┐ │ +│ │ WeeChat TUI │ │ +│ │ (This Client) │ │ +│ └─────────────────────────────────────────────────────┘ │ +└─────────────────────────────────────────────────────────────┘ +``` + +## Features + +- [ ] Text messaging +- [ ] Group chats +- [ ] Image/media receive +- [ ] Image/media send +- [ ] Notifications +- [ ] Search + +## Prerequisites + +- WeeChat +- Matrix account on self-hosted server +- Server-side: Conduit + mautrix-facebook bridge + +## Setup + +### 1. Install WeeChat + +```bash +# macOS +brew install weechat + +# Linux (Debian/Ubuntu) +sudo apt install weechat + +# Linux (Arch) +sudo pacman -S weechat +``` + +### 2. Connect to Matrix homeserver + +```bash +/weechat plugin load matrix +/set matrix.server.your_server_name.homeserver https://your-server.com +/plugin reload matrix +``` + +### 3. Login + +```bash +/matrix certs /path/to/ca-certificate.pem # if self-signed +/matrix login your_username your_password +``` + +### 4. Bridge your Messenger account + +On the server, configure mautrix-facebook and link your Facebook account. + +## Usage + +### Basic WeeChat Commands + +| Command | Description | +|---------|-------------| +| `/buffer list` | List all joined rooms | +| `/join #room:server.com` | Join a room | +| `/query nick` | Open private chat | +| `Ctrl+P / Ctrl+N` | Switch buffers | +| `Ctrl+W then n` | Close buffer | +| `/set` | View/set options | +| `/help` | WeeChat help | + +## Configuration + +### WeeChat Matrix Settings + +```weechat +/set matrix.server.default.homeserver "https://your-matrix-server.com" +/set plugins.var.dev矩阵.notify.enabled on +/set plugins.var.dev矩阵.notify.message on +``` + +## Project Structure + +``` +messenger_tui/ +├── README.md # This file +├── .gitignore +├── config/ # WeeChat config snippets +│ └── weechat.conf +└── scripts/ # Helper scripts + └── setup_weechat.sh +``` + +## Known Limitations + +- Voice/video calls: Not supported via bridge +- Read receipts: Partial support +- Some rich media features may not work + +## See Also + +- [WeeChat Quick Start](https://weechat.org/doc/quickstart/) +- [mautrix-facebook](https://docs.mau.fi/bridges/python/facebook/index.html) +- [Conduit Matrix Server](https://conduit.rs/) diff --git a/scripts/setup_weechat.sh b/scripts/setup_weechat.sh new file mode 100755 index 0000000..f8621ab --- /dev/null +++ b/scripts/setup_weechat.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Setup script for WeeChat Matrix client +# Run this after installing WeeChat + +set -e + +echo "Setting up WeeChat for Matrix..." + +# Load matrix plugin +weechat --run-command "/plugin load matrix" + +# Server configuration (update these values) +SERVER_NAME="your_server_name" +HOMESERVER="https://your-matrix-server.com" + +# Set up server +weechat --run-command "/set plugins.var.dev矩阵.server.default.homeserver ${HOMESERVER}" + +echo "Setup complete!" +echo "Next steps:" +echo "1. Update HOMESERVER in this script with your actual server URL" +echo "2. Run: /matrix login " +echo "3. Bridge your Messenger account on the server"