A Slack protocol plugin for libpurple IM clients.
- Install libpurple (pidgin, finch, etc.), including necessary development components on binary distros (
libpurple-devel
,libpurple-dev
, etc.); - Clone this repository with
git clone https://github.com/dylex/slack-libpurple.git
, runcd slack-libpurple
, then runsudo make install
ormake install-user
.
@EionRobb is kindly providing windows builds here.
To login enter your email address as the username
and
<workspace>.slack.com
as the host
. You can also optionally enter your
password and have it saved.
For use with Bitlbee set username
to user@example.com%<workspace>.slack.com
.
Some slacks (for some reason) don't allow you to lookup user ids.
If you get errors about "unknown_method" with auth.findUser
, you can instead set your username to your actual user id, which usually looks like "UXXXXXXXX" and you can find at the end of the URL for your slack profile.
Earlier versions of this plugin used Slack's legacy tokens for authentication. This feature is still supported, but as Slack will be stopping the creation of legacy tokens on May 5th 2020, it is highly advised that you migrate to the username/password authentication from above.
- Issue a Slack API token for yourself
- Add your slack account to your libpurple program and enter this token under (Advanced) API token (do not enter your slack password; username/hostname are optional but can be set to
you@your.slack.com
)
If you're using a front-end (like Adium or Spectrum2) that does not let you set the API token, you can enter your token as the account password instead.
Here's how slack concepts are mapped to purple:
- Your "open" channels (on the slack bar) are mapped to the buddy list: joining a channel is equivalent to creating a buddy;
- Which conversations are open in purple is up to you, and has no effect on slack;
- For bitlbee IRC connections, Slack channels are "chat channels" that can be added to your configuration with "
chat add <account id> #<channel>
"
api_token
: API token for legacy authenticationopen_chat
[FALSE]: Open chat on channel message; open a chat window whenever there is activity in a channeldisplay_threads
[TRUE]: Display thread replies; display messages in a thread when they're posteddisplay_parent_indicator
[TRUE]: Re-display parent with indicator when thread is opened; the original messages will be displayed again when a thread is first created, follewd by the threaded messagethread_indicator
[⤷
]: Prepend thread replies with this stringparent_indicator
[◈
]: Prepend parent messages with this stringthread_timestamp
[%X
]: Thread timestamp format for the current day (time only), when the message is displayed the same day as it was postedthread_datestamp
[%x %X
]: Thread timestamp format for previous days (date and time), when the message is displayed on a different day than it was postedconnect_history
[FALSE]: Retrieve unread IM (and channel, ifopen_history
) history on connect; opening any IMs that have new messages since they were last read, and also opening any channels with new activity ifopen_history
is setopen_history
[FALSE]: Retrieve unread history on conversation open (and connect, ifconnect_history
), displaying any messages since they were last read when you open a conversationthread_history
[FALSE]: Retrieve unread thread history too (slow!); requires downloading the previous 1000 messages to check if any of them have new thread messages (we have yet to find a better way to check this through the slack API)enable_avatar_download
[FALSE]: Download user avatars on connectchannel_members
[TRUE]: Show members in channels (disabling may break channel features)attachment_prefix
[▎
]: Prepend attachment lines with this stringlazy_load
[FALSE]: Lazy loading: only request objects on demand (EXPERIMENTAL!); normally all users and conversations are loaded on connect, but with this option set, they are only loaded when they are seen. This requires an undocumented API call that shows only "active" conversations, like the slack web interfaceratelimit_delay
[15]: Seconds to delay when ratelimited; the slack API limits how many requests you can make how quickly. Normally it tells you how long you need to wait before making another call, but due to a parsing limitation in libpurple that we have not bothered to work around, we don't get this value, so have a hard-coded delay. Should only need to be changed in extreme circumstances, though it can also lead to longer delays than necessary.
/history [count]
: fetchcount
(or unread, if not specified) previous messages/edit [new message]
: edit your last message to benew message
/delete
: remove your last message/thread|th [thread-timestamp] [message]
: postmessage
in a thread, wherethread-timestamp
matches the configured display format (eitherthread_timestamp
orthread_datestamp
)/getthread|gth [thread-timestamp]
: fetch messages in a thread, wherethread-timestamp
matches the configured display format (eitherthread_timestamp
orthread_datestamp
)
- Handling of messages while not connected or not open is not great.
- 2FA and other authentication methods are not supported (#115).
- The author (@dylex) has only sporadic attention available and is often slow in responding, so community support and contributions are welcome and encouraged (much thanks to @EionRobb, @klali, @zoltan-dulac, @kacf, and others)!