A Pidgin/libpurple protocol plug-in for Signal using presage.
Contains code from flare by Schmiddi.
See the Releases section on github.
- Create a new Pidgin account. Enter your Signal account UUID as username. In case you do not know your UUID, just enter anything. The plug-in will tell you what to use.
- Enable the connection. A window with the QR-code should pop-up. Scan it with your master device. Wait for the window to close.
Note: bitlbee users will receive the login QR-code in form of a URI from a system contact "Logon QR Code". You may need to allow unsolicited messages from unknown contacts in your client. The URI can be converted using any tool like a local qrencode or online services (use at your own risk).
-
startup-delay-secondsint
Tells the plug-in to wait the specified amount of seconds (default: 1) between spawning the native thread for the rust runtime and actually starting the rust runtime. This magically alleviates database locking issues. -
attachment-path-templatestring
This is a template for specifying a path to a local file-name. Setting this to a non-empty value will enable the automated downloader which stores attachments immediately, completely bypassing libpurple's file transfer mechanism. This can be useful for message bridges with limited resources. Also it can help with maintaining the order of messages. Sub-directories will be created as needed.Default value is the empty string.
The template is passed through
strftimeand accepts time and date format parameters such as%Y-%m-%d_%H:%M:%S. The result may not be longer than 128 bytes! Then the replacements are done:$home: User directory (same as~).$purple: Purple configuration directory (usually~/.purple).$direction: Whether this attachment was "received" (sent by a contact) or "sent" (other device on the own account).$chat: The UUID of the contact or key group chat this attachment has been posted to.$sender: The UUID of the contact who posted this attachment to the group chat. Empty if not posted in a group chat.$hash: The file's SHA256 (useful for avoiding clashes and for de-duplication).$filename: The sender-supplied file-name (only for Document messages, otherwise empty). Does not contain the extension.$extension: A file-name extension fitting the mime-type. Includes the dot.
Example:
$purple/presage/attachments/$chat/$filename$hash$extensionThere is no shell expansion (
~will not become the home directory). Relative paths are resolved to the application's working directory. Using an absolute path is recommended.
- Can link as secondary device via QR-Code.
- Receives a styled (bold, italic, strikethrough, monospace) text message from a contact or a group.
- Displays quotes, reactions and incoming calls.
- Resolves mentioned group chat participants by their local alias.
- Receives attachments. Special handling for images, stickers and long text messages.
- Can send a simple text message.
- Can reply to a specific message via "@searchstring:".
- Can send an attachment.
- Will add buddies to contact list unconditionally.
- Uses special handling of login procedure for bitlbee.
- Some very basic support for Spectrum.
- Forward all errors to front-end properly.
- Display names of contacts and groups. This is blocked by a regression in presage, see #303. In fact, the list of contacts is currently empty.
- Mark messages as "read". This is currently not implemented in back-end, see #141. At time of writing, notifications on main device are deleted after answering via linked device. So that is working alright.
- The maximum allowed length of a text-message is unknown.
- Configuration option whether to add contacts to buddy list or not
- Use the hostname (or a user-defined string) as a device name
- Reasonable generation of C headers and rust constants
- Properly process message extensions, e.g. containing a contact
- Display typing notifications
- Display receipts (not important)
- Support for alternative host applications (Bitlbee, Spectrum)
- Support for adding contact via phone number
These lists are not exhaustive.
- When an error occurs while downloading an attachment, the UI may freeze for a couple of seconds before finally displaying the error message.
- Contact information of the own account is not transferred to the buddy list and therefore not resolved in group chats.
- Usage with Spectrum and bitlbee is largely untested. Please keep an eye on your system and check the logs frequently. Issue reports are welcome.
- On Windows, the font Noto Emoji does not work. The monochrome Segoe UI Emoji font does work.
Note: The GNU Linker emits this warning:
missing .note.GNU-stack section implies executable stack
It originates from the sha2-asm crate. An upstream update is expected.
If your distribution is rolling or very new, the rust compiler might be recent enough. If not, install rust according to the rustup instructions.
sudo apt install libpurple-dev libqrencode-dev protobuf-compiler gcc clang
protoc is required by libsignal-svrb. Both gcc and clang are needed by boring-sys call to bindgen.
doas apk add rust pidgin-dev libqrencode-dev protoc
git clone --recurse-submodules https://github.com/hoehermann/purple-presage purple-presage
cmake -S purple-presage -B build
cmake --build build
sudo cmake --install build
or
git clone https://github.com/hoehermann/purple-presage .
make
sudo make install
This is going to get wild, hold on tight…
On Windows, the GNU Toolchain cannot be used as it is not supported by the dependency boring.
purple-presage is known to compile with MSVC 19.30 and rust 1.91.1. You need at least the version of rust mentioned in libsignal-service-rs. A newer version will probably work, too, but 1.91.1 is the last rust version which supports Windows 7. Using the "x86 Native Tools Command Prompt for VS 2022" is recommended.
Install dependencies via vcpkg:
vcpkg.exe install --triplet x86-windows-static libqrencode openssl
openssl is required by a libsqlite3/sqlcipher crate somewhere deep in the dependency tree of presage.
protoc needs to be in your PATH. You can install it with any method you like, including vcpkg:
vcpkg.exe install protobuf
Same as Linux build instructions, but may need to modify the configuration:
-
Generate MSBuild project:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=WIN32 -DCMAKE_TOOLCHAIN_FILE="…/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x86-windows-static -DRust_CARGO_TARGET="i686-pc-windows-msvc" -S purple-presage -B buildIf necessary, the rust tool-chain version can be specified via
-DRust_TOOLCHAIN="1.91.1-i686-pc-windows-msvc". -
Build, Install and Run:
cmake --build build cmake --install build --config Release cmake --build build --target run
When using the "Debug" configuration, the linker complains about mismatching configurations. The implications of this are unknown.
Corrosion does not support the i686-win7-windows-msvc target, so you cannot use CMake. You may look into the Github Action windows.yml to see how to build for Windows 7, with a weird mix of MSYS2's MinGW Make and MSVC.
Needs a whooping 12 GB of disk space during build! 😳 And, depending on the amount of concurrency, several gigabytes of RAM, too.
