Git Product home page Git Product logo

weechat-discord's Introduction

Weechat Discord

Deadness indicator: 100%

I'm done. I'm 900% done. Someone can feel free to fork this jar of horrors, but I'm done dealing with the nightmare of the Discord protocol. The PR on discord-api-docs removing the /ack endpoint documentation was the last straw, it was clearly never intended to be used as a client. As there is no API that's actually intended to be used, I'm not going to maintain this steaming pile of Rust FFI barbarity.

I'll leave things the way they are so folks can still use it, but don't expect me to be enthusiastic about bug reports.


Building

Dependencies:

  • Weechat developer libraries. Usually called weechat-dev, or sometimes just weechat includes them.
  • OpenSSL 1.0 (NOT 1.1). Usually called openssl-1.0, libssl1.0-dev, or something similar. This is important. The Makefile will set up paths to override the version to 1.0, so if you get errors building openssl-sys-extras, run cargo clean and use the Makefile.

The makefile should give enough information for build commands. Here's the essentials:

cd weechat-discord # or wherever you cloned it
cargo build --release

This will produce a shared object called target/release/libweecord.so. Place it in your weechat plugins directory, which is probably located at ~/.weechat/plugins (may need to be created)

The Makefile has a tiny bit of automation that helps with development:

make # (same as make all) just runs that `cargo build --release` command, produces weecord.so
make install # builds and copies the .so to ~/.weechat/plugins, creating the dir if required
make run # installs and runs `weechat -a` (-a means "don't autoconnect to servers")

Maybe important note: The previous version of this project, written in Go, used to get really upset when the .so was modified during the same weechat session, even if unloaded. When developing, make sure to completely quit weechat when updating the .so, just to be sure (otherwise you might get a SIGSEGV and hard crash).

Using

Due to some idiocracy on Discord's part, you will need to obtain a login token. The wonderful tip by the Discord devs on how to do that, though, doesn't work: for me, and only for chromium, I went into inspector (ctrl+shift+i, because Discord also decided to do the wonderful thing of ripping out right-click menus), Application tab, Local Storage on left, discordapp.com, token entry.

Set that token (make sure to remove the quotes if you copied them in!):

/discord token 123456789ABCDEF

Then, connect:

/discord connect

Note you may also have to adjust a few settings for best use:

## doesn't work currently: weechat.completion.default_template -> append "|%(weecord_completion)"
weechat.bar.status.items -> replace buffer_name with buffer_short_name
plugins.var.python.go.short_name -> on (if you use go.py)

weechat-discord's People

Contributors

flowbish avatar khyperia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weechat-discord's Issues

Hang (Spinlock) When There is Too Many Servers

When I do /discord connect, weechat indefinitely hangs (I gave it overnight). It does show at least one server, (that server had so many channels that it went offscreen). I also got some messages about muted channels IIRC.
While I don't know the true cause, I am guessing it is because I have so many servers / channels. I have ~40 servers and each server has ~10 channels each. I'm not sure why it does this, but perhaps its running into a rate limit?
If you are not able to reproduce this, feel free to send me a separate branch / diff for me to test.

After struggling with openssl

It's not an issue but a feedback after struggling with openssl.

First, I'm using debian9 stable.

For building weechat-discord we need openssl1.0 because openssl-sys-extras v0.7.14 only support 1.0 version (1.1 support come with version 0.9 of openssl-sys-extras)

So for debian9 we need: sudo apt install pkg-config libssl1.0-dev libssl1.0.2

Be careful libssl-dev is 1.1 version, so not compatible yet.

It could be useful to add a subsection into readme about this particular point.

NB: pkg-config allows rust compiler (and others building tools) to find path information of libssl, without setting those path yourself via env vars (OPENSSL_INCLUDE_DIR and OPENSSL_LIB_DIR)

Mention and <@number>

When I load plugin, for a couple hours there's no problem, mentions are displayed correctly with @Nickname.

But a few hours later, mention came back with <@Number>

Is there an option that I missed?

Anyway, thanks for your great job!

PS: my weechat runs for days

Display server timestamp instead of local time

The discord-rs Message object has a timestamp: String field. We probably want to do something with it instead of snagging the probably terrifyingly wrong local time off the user's computer.

Make things all formatted colorfully!

Do things like:

  1. Display @mentions (and channels, etc) in another color
  2. Maybe apply discord formatting rules into ANSI escape code thingies (should be fairly easy? I think weechat has an API for format strings that you can just dump into a message)

Compilation error: non-capturing closure is experimental

weechat-discord does not compile under a decently new cargo, see bottom for version listings.

~/d/g/weechat-discord *master cargo build --release
   Compiling serde_derive v1.0.10
   Compiling weecord v0.1.0 (file:///home/spill/dotfiles/gits/weechat-discord)
   Compiling url v1.5.1
   Compiling cookie v0.2.5
   Compiling hyper v0.9.18
   Compiling websocket v0.17.1
   Compiling multipart v0.8.1
   Compiling discord v0.8.0 (https://github.com/SpaceManiac/discord-rs.git#2f48893b)
error: non-capturing closure to fn coercion is experimental (see issue #39817)
   --> src/connection.rs:124:35
    |
124 |             Buffer::new(&name_id, |_, _| {}).unwrap()
    |                                   ^^^^^^^^^
    |
    = help: add #![feature(closure_to_fn_coercion)] to the crate attributes to enable

error[E0308]: mismatched types
   --> src/connection.rs:124:35
    |
124 |             Buffer::new(&name_id, |_, _| {}).unwrap()
    |                                   ^^^^^^^^^ expected fn pointer, found closure
    |
    = note: expected type `fn(ffi::Buffer, &str)`
               found type `[closure@src/connection.rs:124:35: 124:44]`

error: aborting due to previous error(s)

error: Could not compile `weecord`.
spill@spilldesk:~/dotfiles/gits/weechat-discord$ git rev-parse HEAD
cf9f593648179976696dffe6e95536b7274a220b

spill@spilldesk:~/dotfiles/gits/weechat-discord$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

spill@spilldesk:~/dotfiles/gits/weechat-discord$ rustc --version
rustc 1.19.0-nightly (28fd1e519 2017-05-27)

spill@spilldesk:~/dotfiles/gits/weechat-discord$ cargo --version
cargo 0.20.0-nightly (38ca9b702 2017-05-14)

spill@spilldesk:~/dotfiles/gits/weechat-discord$ weechat --version
1.6

Documentation improvement regarding weechat-dev dependency.

error: failed to run custom build command for `weecord v0.1.0 (file:///home/spill/dotfiles/gits/weechat-discord)`
process didn't exit successfully: `/home/spill/dotfiles/gits/weechat-discord/target/release/build/weecord-9e4ad1a820c1e932/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"weechat\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package weechat was not found in the pkg-config search path.\nPerhaps you should add the directory containing `weechat.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'weechat\' found\n" } }', /checkout/src/libcore/result.rs:859
note: Run with `RUST_BACKTRACE=1` for a backtrace.

This was easy enough to resolve by installing weechat-dev (on debian, in addition to weechat), but the error message could make this clearer.

Files and attachments and embeds, oh my!

Discord has attachments: Vec<Attachment> and embeds: Vec<Value> in messages, we should prooobably let the user know they at least exist instead of gobbling them up into the void of Drop doom.

error: failed to run custom build command for `weecord v0.1.0

After installing the current rust package I get the following error when attempting 'make install'.

Any clues?

/weechat-discord$ [master @ 8800f81] »make install
cargo build --release
Updating registry https://github.com/rust-lang/crates.io-index
Updating git repository https://github.com/SpaceManiac/discord-rs.git
Downloading libc v0.2.21
Downloading log v0.3.7
Downloading websocket v0.17.1
Downloading byteorder v0.5.3
Downloading flate2 v0.2.19
Downloading multipart v0.8.1
Downloading base64-rs v0.1.1
Downloading serde_json v0.8.6
Downloading time v0.1.36
Downloading hyper v0.9.18
Downloading bitflags v0.7.0
Downloading rustc-serialize v0.3.23
Downloading openssl v0.7.14
Downloading rand v0.3.15
Downloading unicase v1.4.0
Downloading url v1.4.0
Downloading net2 v0.2.27
Downloading num_cpus v1.3.0
Downloading httparse v1.2.1
Downloading openssl-verify v0.1.0
Downloading mime v0.2.3
Downloading solicit v0.4.4
Downloading traitobject v0.0.1
Downloading language-tags v0.2.2
Downloading typeable v0.1.2
Downloading cookie v0.2.5
Downloading openssl-sys-extras v0.7.14
Downloading lazy_static v0.2.8
Downloading openssl-sys v0.7.17
Downloading pkg-config v0.3.9
Downloading gcc v0.3.45
Downloading hpack v0.2.0
Downloading idna v0.1.1
Downloading matches v0.1.4
Downloading unicode-normalization v0.1.4
Downloading unicode-bidi v0.2.5
Downloading rustc_version v0.1.7
Downloading semver v0.1.20
Downloading cfg-if v0.1.0
Downloading miniz-sys v0.1.9
Downloading mime_guess v1.8.1
Downloading tempdir v0.3.5
Downloading phf v0.7.21
Downloading phf_shared v0.7.21
Downloading siphasher v0.2.2
Downloading phf_codegen v0.7.21
Downloading phf_generator v0.7.21
Downloading itoa v0.1.1
Downloading serde v0.8.23
Downloading dtoa v0.2.2
Downloading num-traits v0.1.37
Compiling unicode-normalization v0.1.4
Compiling base64-rs v0.1.1
Compiling typeable v0.1.2
Compiling httparse v1.2.1
Compiling siphasher v0.2.2
Compiling traitobject v0.0.1
Compiling serde v0.8.23
Compiling matches v0.1.4
Compiling bitflags v0.7.0
Compiling gcc v0.3.45
Compiling language-tags v0.2.2
Compiling lazy_static v0.2.8
Compiling libc v0.2.21
Compiling unicode-bidi v0.2.5
Compiling rustc-serialize v0.3.23
Compiling pkg-config v0.3.9
Compiling semver v0.1.20
Compiling time v0.1.36
Compiling openssl-sys v0.7.17
Compiling idna v0.1.1
Compiling num-traits v0.1.37
Compiling cfg-if v0.1.0
Compiling rand v0.3.15
Compiling net2 v0.2.27
Compiling itoa v0.1.1
Compiling dtoa v0.2.2
Compiling miniz-sys v0.1.9
Compiling openssl-sys-extras v0.7.14
Compiling openssl v0.7.14
Compiling log v0.3.7
Compiling weecord v0.1.0 (file:///data/Personal/weechat-discord)
Compiling byteorder v0.5.3
Compiling url v1.4.0
Compiling mime v0.2.3
Compiling hpack v0.2.0
error: failed to run custom build command for weecord v0.1.0 (file:///data/Personal/weechat-discord)
process didn't exit successfully: /data/Personal/weechat-discord/target/release/build/weecord-35b90ef1118d8d40/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: Failure { command: ""pkg-config" "--libs" "--cflags" "weechat"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package weechat was not found in the pkg-config search path.\nPerhaps you should add the directory containing weechat.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'weechat\' found\n" } }', /checkout/src/libcore/result.rs:859 note: Run with RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: build failed
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 101

Autoreconnect on disconnect

When leaving things running for a while, we sometimes get something like the following:

Discord: listening thread had error - Transport endpoint is not connected (os error 107)
Discord: Listening thread stopped!

Should probably detect this and automatically reconnect. Possibly only reconnect in certain disconnect scenarios (automatically doing so on a disconnected: if you reconnect, you will destroy the world is probably not the best idea)

Weechat immediately crashes on /discord connect

See above. I tried to set up this plugin earlier on 1.4 which was apparently too old. So I ended up compiling 2.0-dev from weechat repos (the "default" way, just 'mkdir build && cd build && cmake .. && make && sudo make install') and then build weecord. This seemed to work, but when I fired up weechat and did /discord connect (after supplying token), the client immediately proceeded to crash. Tried 1.9 and 1.8 as well with the same result (rebuilding weecord each time with cargo clean && cargo build --release). Using Ubuntu 16.04LTS. There didn't appear to be anything wrong with weechat setup besides this after version change.

[2151][fiq@fiq ~/weechat-discord]$ cargo --version
cargo 0.20.0 (a60d185c8 2017-07-13)
[2152][fiq@fiq ~/weechat-discord]$ rustc --version
rustc 1.19.0 (0ade33941 2017-07-17)

Weecord fails to compile

Here's the log:

   Compiling weecord v0.1.0 (file:///home/ryzokuken/Software/weechat-discord)
error: failed to run custom build command for `weecord v0.1.0 (file:///home/ryzokuken/Software/weechat-discord)`
process didn't exit successfully: `/home/ryzokuken/Software/weechat-discord/target/release/build/weecord-5d4e49d62e5557be/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("release")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/usr/include/weechat" "-Wall" "-Wextra" "-Werror" "-o" "/home/ryzokuken/Software/weechat-discord/target/release/build/weecord-b7f74f9e6f476cee/out/src/weecord.o" "-c" "src/weecord.c"
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:60:35: error: macro "weechat_hook_command" passed 8 arguments, but takes just 7
cargo:warning=                               NULL);
cargo:warning=                                   ^
cargo:warning=src/weecord.c:53:10: error: ‘weechat_hook_command’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_command(command,
cargo:warning=          ^
cargo:warning=src/weecord.c:53:10: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/weecord.c:40:30: error: unused parameter ‘command’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_command(const char* command,
cargo:warning=                              ^
cargo:warning=src/weecord.c:41:30: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                  const char* description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:42:30: error: unused parameter ‘args’ [-Werror=unused-parameter]
cargo:warning=                  const char* args,
cargo:warning=                              ^
cargo:warning=src/weecord.c:43:30: error: unused parameter ‘args_description’ [-Werror=unused-parameter]
cargo:warning=                  const char* args_description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:44:30: error: unused parameter ‘completion’ [-Werror=unused-parameter]
cargo:warning=                  const char* completion,
cargo:warning=                              ^
cargo:warning=src/weecord.c:45:30: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                  const void* pointer,
cargo:warning=                              ^
cargo:warning=src/weecord.c:46:24: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                  int (*callback)(const void* pointer,
cargo:warning=                        ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:117:71: error: macro "weechat_buffer_new" passed 7 arguments, but takes just 5
cargo:warning=     name, input_callback, pointer, NULL, close_callback, pointer, NULL);
cargo:warning=                                                                       ^
cargo:warning=src/weecord.c:116:10: error: ‘weechat_buffer_new’ undeclared (first use in this function)
cargo:warning=   return weechat_buffer_new(
cargo:warning=          ^
cargo:warning=src/weecord.c:106:28: error: unused parameter ‘name’ [-Werror=unused-parameter]
cargo:warning= wdc_buffer_new(const char* name,
cargo:warning=                            ^
cargo:warning=src/weecord.c:107:28: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                const void* pointer,
cargo:warning=                            ^
cargo:warning=src/weecord.c:108:22: error: unused parameter ‘input_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*input_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c:112:22: error: unused parameter ‘close_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*close_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:147:62: error: macro "weechat_hook_fd" passed 7 arguments, but takes just 6
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=                                                              ^
cargo:warning=src/weecord.c:147:10: error: ‘weechat_hook_fd’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=          ^
cargo:warning=src/weecord.c:143:17: error: unused parameter ‘fd’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_fd(int fd,
cargo:warning=                 ^
cargo:warning=src/weecord.c:144:25: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=             const void* pointer,
cargo:warning=                         ^
cargo:warning=src/weecord.c:145:19: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=             int (*callback)(const void* pointer, void* data, int fd))
cargo:warning=                   ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:231:67: error: macro "weechat_hook_completion" passed 5 arguments, but takes just 4
cargo:warning=     completion_item, description, callback, callback_pointer, NULL);
cargo:warning=                                                                   ^
cargo:warning=src/weecord.c:230:10: error: ‘weechat_hook_completion’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_completion(
cargo:warning=          ^
cargo:warning=src/weecord.c:221:33: error: unused parameter ‘completion_item’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_completion(const char* completion_item,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:222:33: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                     const char* description,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:223:33: error: unused parameter ‘callback_pointer’ [-Werror=unused-parameter]
cargo:warning=                     const void* callback_pointer,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:224:27: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                     int (*callback)(const void*,
cargo:warning=                           ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:61:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:118:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:148:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:232:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=cc1: all warnings being treated as errors
exit code: 1


command did not execute successfully, got: exit code: 1



--- stderr
thread 'main' panicked at 'explicit panic', /home/ryzokuken/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.50/src/lib.rs:1210
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: build failed
Makefile:17: recipe for target 'all' failed
make: *** [all] Error 101

buffers not appearing when i connect?

hi there! not sure if this project is even being maintained any more but i thought i'd drop in and see if i could get help with something.

i'm on macOS - i've installed everything and loaded the plugin within weechat. no problems so far - the plugin loads without issue. it appears to successfully connect with the token i retrieved with the python script (which required a bit of modification to not throw an error - i will attach my fork of that script just in case that has something to do with my problem.

however, when i connect, my discord buffers don't show up on the left side. in fact, nothing visibly changes, other than the app claiming i'm connected.

what am i missing here?

thanks a lot!

import subprocess
import sys
import string
import platform


def strings(filename, min=4):
    with open(filename, "rignore") as f:
        result = ""
        for c in f.read():
            if c in string.printable:
                result += c
                continue
            if len(result) >= min:
                yield result
            result = ""
        if len(result) >= min:
            yield result


def run_command(cmd):
    output = subprocess.Popen(
        [cmd], shell=True, stdout=subprocess.PIPE , # stderr=subprocess.DEVNULL
    )
    return output.communicate()[0].decode().splitlines()


def main():
    print("Searching for Discord localstorage databases...")
    rg = False
    if platform.system() == "Darwin":
        results = run_command("mdfind \"kMDItemDisplayName=='*.ldb'\"")
    else:
        try:
            subprocess.check_output(["rg", "--version"])
            results = run_command("rg ~/ --files -g '*.ldb'")
            rg = True
        except FileNotFoundError:
            results = run_command("find ~/ -name '*.ldb'")

    if len(results) == 0 and rg:
        # try again, but search hidden directories
        results = run_command("rg ~/ --hidden --files -g '*.ldb'")

    if len(results) == 0:
        print("No databases found.")
        sys.exit(1)

    discord_databases = list(filter(lambda x: "discord" in x, results))

    token_candidates = set()
    for database in discord_databases:
        for candidate in strings(database, 40):
            if " " in candidate:
                continue
            parts = candidate.split(".", 3)
            if len(parts) != 3:
                continue
            if len(parts[1]) < 6:
                continue
            token_candidates.add(candidate[1:-2])

    if len(token_candidates) == 0:
        print("No Discord tokens found")
        return

    print("Likely Discord tokens are:\n")
    for token in token_candidates:
        print(token)


if __name__ == "__main__":
    main()

Use weechat's typed config system

Instead of config_get_plugin etc. that return strings only, create a system that uses config_new and the like that provide more complex features like typed config values and change notifications.

Probably want to make a config.rs since it might get big/complicated.

Display nicklist in weechat

Simple to say, mildly difficult to do.

Might also be required for nick colors and tabcomplete to work? Unsure though.

[Help Wanted] Using buffer_autoset with weecord

Could anyone point me in the right direction for using bufer_autoset script to set the short_name for some discord "channels" using buffer_autoset? I'm relatively new to weechat, so I'm a bit confused.

Also, is there a way to tag/ping people? I can autocomplete nicks using the acomplete script, but it doesn't actually 'tag' them so they get a ping.

And I tried to figure out how to label this as Help Wanted, but couldn't figure it out, sorry.

Build fails on openssl v0.7.14

I'm finding that rebuilding weechat-discord fails at building openssl.

Currently building 8800f81

$ cargo build                                                                                     
 Downloading libc v0.2.22
 Downloading num_cpus v1.4.0
   Compiling base64-rs v0.1.1
   Compiling itoa v0.1.1
   Compiling httparse v1.2.2
   Compiling matches v0.1.4
   Compiling num-traits v0.1.37
   Compiling pkg-config v0.3.9
   Compiling bitflags v0.7.0
   Compiling semver v0.1.20
   Compiling rustc_version v0.1.7
   Compiling log v0.3.7
   Compiling hpack v0.2.0
   Compiling solicit v0.4.4
   Compiling openssl-sys v0.7.17
   Compiling dtoa v0.2.2
   Compiling traitobject v0.0.1
   Compiling siphasher v0.2.2                                                                                                            Compiling cfg-if v0.1.0
   Compiling language-tags v0.2.2
   Compiling unicode-normalization v0.1.4
   Compiling unicase v1.4.0
   Compiling serde v0.8.23
   Compiling lazy_static v0.2.8
   Compiling libc v0.2.22
   Compiling time v0.1.37
   Compiling num_cpus v1.4.0
   Compiling rand v0.3.15
   Compiling tempdir v0.3.5
   Compiling net2 v0.2.27
   Compiling byteorder v0.5.3
   Compiling rustc-serialize v0.3.24
   Compiling typeable v0.1.2
   Compiling unicode-bidi v0.2.5
   Compiling mime v0.2.3
   Compiling phf_shared v0.7.21
   Compiling phf_generator v0.7.21
   Compiling phf_codegen v0.7.21
   Compiling phf v0.7.21
   Compiling mime_guess v1.8.1
   Compiling gcc v0.3.45
   Compiling openssl-sys-extras v0.7.14
error: failed to run custom build command for `openssl-sys-extras v0.7.14`
process didn't exit successfully: `/home/user/build/weechat-discord/target/debug/build/openssl-sys-extras-f9e8037051c16bfa/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None                                                                                                    CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("debug")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-o" "/home/eytosh/build/weechat-discord/target/debug/build/openssl-sys-extras-8e2dc543f8892677/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
cargo:warning=src/openssl_shim.c: In function ‘DH_new_from_params’:
cargo:warning=src/openssl_shim.c:132:7: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
cargo:warning=     dh->p = p;
cargo:warning=       ^~
cargo:warning=src/openssl_shim.c: In function ‘X509_get_extensions_shim’:
cargo:warning=src/openssl_shim.c:143:13: error: dereferencing pointer to incomplete type ‘X509 {aka struct x509_st}’
cargo:warning=     return x->cert_info ? x->cert_info->extensions : NULL;
cargo:warning=             ^~
ExitStatus(ExitStatus(256))


command did not execute successfully, got: exit code: 1
                                                                                                                                      

--- stderr
thread 'main' panicked at 'explicit panic', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.45/src/lib.rs:1152
note: Run with `RUST_BACKTRACE=1` for a backtrace.

open_and_sync_buffers is way too slow for large servers

For every update to user/channel state, this program iterates through every channel on every server, then through every user on the server; calculates their nick, asks weechat whether that nick exists in the channel, and adds it if not.

Even if weechat were sane, this would be rather wasteful: O(n^2), assuming the rate of updates is already O(n) in the number of users. And the wasted work is not just a quick list iteration or something, but at minimum includes the allocation and string formatting involved in calculating the nick. But weechat is not sane: nicklist_nick_exists does a linear search over a linked list of nick entries, so this ends up O(n^3), and slow enough in practice to completely lock up my (admittedly puny) EC2 instance (for a Discord server in the thousands of users).

I know this is a work in progress, and you probably know already that that's an inefficient approach, but I'm filing this in case you didn't know just how inefficient :)

The code also never removes nicks, but I guess you know that already too...

Message deletion on user ban

When a user is banned and their messages are deleted, if they have only sent one message it is shown as deleted fine however, if they have sent multiple messages then no deleted message is shown in the channel.

Hide muted channels

Most discord servers have a lot of channels and so when you join them with weechat your buffer list gets flooded and it becomes unmanageable. In the default Discord application you can mute channels and then hide them, getting rid of all of that clutter. It would be nice if one could hide muted channels in the same way.

Cargo build fails on custom build command for `openssl-sys-extras v0.7.14`

My build failed. I was trying to install this on the WSL in windows 10.

The following package was automatically installed and is no longer required:
snap-confine
Compiling mime v0.2.6
Compiling openssl-sys v0.7.17
Compiling unicode-bidi v0.3.3
Compiling libc v0.2.23
Compiling num-traits v0.1.37
Compiling hpack v0.2.0
Compiling rand v0.3.15
Compiling time v0.1.37
Compiling num-integer v0.1.34
Compiling num_cpus v1.5.1
Compiling miniz-sys v0.1.9
Compiling openssl-sys-extras v0.7.14
Compiling solicit v0.4.4
Compiling openssl v0.7.14
Compiling weecord v0.1.0 (file:///mnt/c/Users/Woeste/Desktop/weechat-discord)
Compiling net2 v0.2.29
Compiling num-iter v0.1.33
Compiling unicode-xid v0.0.4
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for openssl-sys-extras v0.7.14
process didn't exit successfully: /mnt/c/Users/<username>/Desktop/weechat-discord/target/release/build/openssl-sys-extras-37ea1ce39db5c0de/build-script-build (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("release")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-o" "/mnt/c/Users//Desktop/weechat-discord/target/release/build/openssl-sys-extras-45159e42f4e1f90d/out/src/openssl_shim.o" "-c" "src/openssl_shim.c"
cargo:warning=src/openssl_shim.c:1:26: fatal error: openssl/hmac.h: No such file or directory
cargo:warning=compilation terminated.
exit code: 1

command did not execute successfully, got: exit code: 1

--- stderr
thread 'main' panicked at 'explicit panic', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.50/src/lib.rs:1210
note: Run with RUST_BACKTRACE=1 for a backtrace.

Compilation errors for weechat 1.0.1

It could be that I have an old weechat version, I am running debian oldstable.
But here's my compilation errors. In the meantime I will look into updating my system

$ RUST_BACKTRACE=1 cargo build
   Compiling libc v0.2.28
   Compiling version_check v0.1.3
   Compiling weecord v0.1.0 (file:///home/spill/dotfiles/gits/weechat-discord)
   Compiling bitflags v0.7.0
   Compiling syn v0.11.11
error: failed to run custom build command for `weecord v0.1.0 (file:///home/spill/dotfiles/gits/weechat-discord)`
process didn't exit successfully: `/home/spill/dotfiles/gits/weechat-discord/target/debug/build/weecord-aa7e2c2fe3f6b7a6/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("debug")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I" "/usr/include/weechat" "-Wall" "-Wextra" "-Werror" "-o" "/home/spill/dotfiles/gits/weechat-discord/target/debug/build/weecord-e9ca8906f351a336/out/src/weecord.o" "-c" "src/weecord.c"
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:66:35: error: macro "weechat_hook_command" passed 8 arguments, but takes just 7
cargo:warning=                               NULL);
cargo:warning=                                   ^
cargo:warning=src/weecord.c:59:10: error: ‘weechat_hook_command’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_command(command,
cargo:warning=          ^
cargo:warning=src/weecord.c:59:10: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/weecord.c:46:30: error: unused parameter ‘command’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_command(const char* command,
cargo:warning=                              ^
cargo:warning=src/weecord.c:47:30: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                  const char* description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:48:30: error: unused parameter ‘args’ [-Werror=unused-parameter]
cargo:warning=                  const char* args,
cargo:warning=                              ^
cargo:warning=src/weecord.c:49:30: error: unused parameter ‘args_description’ [-Werror=unused-parameter]
cargo:warning=                  const char* args_description,
cargo:warning=                              ^
cargo:warning=src/weecord.c:50:30: error: unused parameter ‘completion’ [-Werror=unused-parameter]
cargo:warning=                  const char* completion,
cargo:warning=                              ^
cargo:warning=src/weecord.c:51:30: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                  const void* pointer,
cargo:warning=                              ^
cargo:warning=src/weecord.c:52:24: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                  int (*callback)(const void* pointer,
cargo:warning=                        ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:123:71: error: macro "weechat_buffer_new" passed 7 arguments, but takes just 5
cargo:warning=     name, input_callback, pointer, NULL, close_callback, pointer, NULL);
cargo:warning=                                                                       ^
cargo:warning=src/weecord.c:122:10: error: ‘weechat_buffer_new’ undeclared (first use in this function)
cargo:warning=   return weechat_buffer_new(
cargo:warning=          ^
cargo:warning=src/weecord.c:112:28: error: unused parameter ‘name’ [-Werror=unused-parameter]
cargo:warning= wdc_buffer_new(const char* name,
cargo:warning=                            ^
cargo:warning=src/weecord.c:113:28: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=                const void* pointer,
cargo:warning=                            ^
cargo:warning=src/weecord.c:114:22: error: unused parameter ‘input_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*input_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c:118:22: error: unused parameter ‘close_callback’ [-Werror=unused-parameter]
cargo:warning=                int (*close_callback)(const void* pointer,
cargo:warning=                      ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:159:62: error: macro "weechat_hook_fd" passed 7 arguments, but takes just 6
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=                                                              ^
cargo:warning=src/weecord.c:159:10: error: ‘weechat_hook_fd’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning=          ^
cargo:warning=src/weecord.c:155:17: error: unused parameter ‘fd’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_fd(int fd,
cargo:warning=                 ^
cargo:warning=src/weecord.c:156:25: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning=             const void* pointer,
cargo:warning=                         ^
cargo:warning=src/weecord.c:157:19: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=             int (*callback)(const void* pointer, void* data, int fd))
cargo:warning=                   ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:243:67: error: macro "weechat_hook_completion" passed 5 arguments, but takes just 4
cargo:warning=     completion_item, description, callback, callback_pointer, NULL);
cargo:warning=                                                                   ^
cargo:warning=src/weecord.c:242:10: error: ‘weechat_hook_completion’ undeclared (first use in this function)
cargo:warning=   return weechat_hook_completion(
cargo:warning=          ^
cargo:warning=src/weecord.c:233:33: error: unused parameter ‘completion_item’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_completion(const char* completion_item,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:234:33: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning=                     const char* description,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:235:33: error: unused parameter ‘callback_pointer’ [-Werror=unused-parameter]
cargo:warning=                     const void* callback_pointer,
cargo:warning=                                 ^
cargo:warning=src/weecord.c:236:27: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning=                     int (*callback)(const void*,
cargo:warning=                           ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:67:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:124:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:160:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:244:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=cc1: all warnings being treated as errors
exit code: 1


command did not execute successfully, got: exit code: 1



--- stderr
thread 'main' panicked at 'explicit panic', /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:1239
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: gcc::fail
             at /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:1239
   7: gcc::run
             at /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:1183
   8: gcc::Config::compile_object
             at /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:525
   9: gcc::Config::compile_objects
             at /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:491
  10: gcc::Config::compile
             at /home/spill/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.51/src/lib.rs:440
  11: build_script_build::main
             at ./build.rs:18
  12: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  13: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:59
  14: main
  15: __libc_start_main
  16: <unknown>

Build failed, waiting for other jobs to finish...
error: build failed
spill@spilldesk:~/dotfiles/gits/weechat-discord$ git rev-parse HEAD
cf9f593648179976696dffe6e95536b7274a220b

spill@spilldesk:~/dotfiles/gits/weechat-discord$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

spill@spilldesk:~/dotfiles/gits/weechat-discord$ rustc --version
rustc 1.19.0-nightly (28fd1e519 2017-05-27)

spill@spilldesk:~/dotfiles/gits/weechat-discord$ cargo --version
cargo 0.20.0-nightly (38ca9b702 2017-05-14)

spill@spilldesk:~/dotfiles/gits/weechat-discord$ weechat --version
1.0.1

Direct messages

Is there currently a way to send/receive direct messages and direct group chats through weecord?

Improve buffer heirarchy

When running this, two things are very noticeable: The buffer list is flooded with entries and Every buffer has a huge name (server name || chatroom name). Instead, I wonder if there would be a way to make empty server buffers just like IRC server buffers, and if possible, 1 level under another empty buffer named "Discord". All chatrooms from that discord server would be inside the corresponding buffer, and you will not have to use those huge names. Plus, it would look a lot cleaner and organized, especially if you use indentation.

Build failed: thread 'main' panicked at 'explicit panic'

I'm trying to install on WSL on windows 10.

root@FSXVC8:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

root@FSXVC8:/mnt/c/Users/Woeste/Desktop/weechat-discord# RUST_BACKTRACE=1 cargo build --release
Compiling weecord v0.1.0 (file:///mnt/c/Users/Woeste/Desktop/weechat-discord)
Compiling openssl v0.7.14
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for weecord v0.1.0 (file:///mnt/c/Users/Woeste/Desktop/weechat-discord)
process didn't exit successfully: /mnt/c/Users/Woeste/Desktop/weechat-discord/target/release/build/weecord-65df80a1d94a2456/build-script-build (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
PROFILE = Some("release")
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/usr/include/weechat" "-Wall" "-Wextra" "-Werror" "-o" "/mnt/c/Users/Woeste/Desktop/weechat-discord/target/release/build/weecord-78f661dbbb0d58b7/out/src/weecord.o" "-c" "src/weecord.c"
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:60:35: error: macro "weechat_hook_command" passed 8 arguments, but takes just 7
cargo:warning= NULL);
cargo:warning= ^
cargo:warning=src/weecord.c:53:10: error: ‘weechat_hook_command’ undeclared (first use in this function)
cargo:warning= return weechat_hook_command(command,
cargo:warning= ^
cargo:warning=src/weecord.c:53:10: note: each undeclared identifier is reported only once for each function it appears in
cargo:warning=src/weecord.c:40:30: error: unused parameter ‘command’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_command(const char* command,
cargo:warning= ^
cargo:warning=src/weecord.c:41:30: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning= const char* description,
cargo:warning= ^
cargo:warning=src/weecord.c:42:30: error: unused parameter ‘args’ [-Werror=unused-parameter]
cargo:warning= const char* args,
cargo:warning= ^
cargo:warning=src/weecord.c:43:30: error: unused parameter ‘args_description’ [-Werror=unused-parameter]
cargo:warning= const char* args_description,
cargo:warning= ^
cargo:warning=src/weecord.c:44:30: error: unused parameter ‘completion’ [-Werror=unused-parameter]
cargo:warning= const char* completion,
cargo:warning= ^
cargo:warning=src/weecord.c:45:30: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning= const void* pointer,
cargo:warning= ^
cargo:warning=src/weecord.c:46:24: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning= int (callback)(const void pointer,
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:117:71: error: macro "weechat_buffer_new" passed 7 arguments, but takes just 5
cargo:warning= name, input_callback, pointer, NULL, close_callback, pointer, NULL);
cargo:warning= ^
cargo:warning=src/weecord.c:116:10: error: ‘weechat_buffer_new’ undeclared (first use in this function)
cargo:warning= return weechat_buffer_new(
cargo:warning= ^
cargo:warning=src/weecord.c:106:28: error: unused parameter ‘name’ [-Werror=unused-parameter]
cargo:warning= wdc_buffer_new(const char* name,
cargo:warning= ^
cargo:warning=src/weecord.c:107:28: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning= const void* pointer,
cargo:warning= ^
cargo:warning=src/weecord.c:108:22: error: unused parameter ‘input_callback’ [-Werror=unused-parameter]
cargo:warning= int (input_callback)(const void pointer,
cargo:warning= ^
cargo:warning=src/weecord.c:112:22: error: unused parameter ‘close_callback’ [-Werror=unused-parameter]
cargo:warning= int (close_callback)(const void pointer,
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:147:62: error: macro "weechat_hook_fd" passed 7 arguments, but takes just 6
cargo:warning= return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning= ^
cargo:warning=src/weecord.c:147:10: error: ‘weechat_hook_fd’ undeclared (first use in this function)
cargo:warning= return weechat_hook_fd(fd, 1, 0, 0, callback, pointer, NULL);
cargo:warning= ^
cargo:warning=src/weecord.c:143:17: error: unused parameter ‘fd’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_fd(int fd,
cargo:warning= ^
cargo:warning=src/weecord.c:144:25: error: unused parameter ‘pointer’ [-Werror=unused-parameter]
cargo:warning= const void* pointer,
cargo:warning= ^
cargo:warning=src/weecord.c:145:19: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning= int (callback)(const void pointer, void* data, int fd))
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:231:67: error: macro "weechat_hook_completion" passed 5 arguments, but takes just 4
cargo:warning= completion_item, description, callback, callback_pointer, NULL);
cargo:warning= ^
cargo:warning=src/weecord.c:230:10: error: ‘weechat_hook_completion’ undeclared (first use in this function)
cargo:warning= return weechat_hook_completion(
cargo:warning= ^
cargo:warning=src/weecord.c:221:33: error: unused parameter ‘completion_item’ [-Werror=unused-parameter]
cargo:warning= wdc_hook_completion(const char* completion_item,
cargo:warning= ^
cargo:warning=src/weecord.c:222:33: error: unused parameter ‘description’ [-Werror=unused-parameter]
cargo:warning= const char* description,
cargo:warning= ^
cargo:warning=src/weecord.c:223:33: error: unused parameter ‘callback_pointer’ [-Werror=unused-parameter]
cargo:warning= const void* callback_pointer,
cargo:warning= ^
cargo:warning=src/weecord.c:224:27: error: unused parameter ‘callback’ [-Werror=unused-parameter]
cargo:warning= int (callback)(const void,
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_command’:
cargo:warning=src/weecord.c:61:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_buffer_new’:
cargo:warning=src/weecord.c:118:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_fd’:
cargo:warning=src/weecord.c:148:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=src/weecord.c: In function ‘wdc_hook_completion’:
cargo:warning=src/weecord.c:232:1: error: control reaches end of non-void function [-Werror=return-type]
cargo:warning= }
cargo:warning= ^
cargo:warning=cc1: all warnings being treated as errors
exit code: 1

command did not execute successfully, got: exit code: 1

--- stderr
thread 'main' panicked at 'explicit panic', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.50/src/lib.rs:1210
stack backtrace:
1: 0x7fad9982703a - std::sys::imp::backtrace::tracing::imp::write::hd9cb4c1797101742
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
2: 0x7fad9982d69f - std::panicking::default_hook::{{closure}}::h154dea97b11a961f
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/panicking.rs:349
3: 0x7fad9982d2a4 - std::panicking::default_hook::h7b2373844128ce08
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/panicking.rs:365
4: 0x7fad9982dae7 - std::panicking::rust_panic_with_hook::h8d52d23c1df454da
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/panicking.rs:553
5: 0x7fad9980ed8f - std::panicking::begin_panic::h2b5d2fe46dd8c732
6: 0x7fad9981aac6 - gcc::fail::he78b9b54a8b12edf
7: 0x7fad99819f35 - gcc::run::h894e2a74a7d7b33b
8: 0x7fad998131d8 - gcc::Config::compile::h4ea84059880c8ce2
9: 0x7fad99807ec0 - build_script_build::main::hb091cf0dbb9ae65f
10: 0x7fad99837d7a - __rust_maybe_catch_panic
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libpanic_unwind/lib.rs:98
11: 0x7fad9982e226 - std::rt::lang_start::h654cbbacaf320c39
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/panicking.rs:434
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/panic.rs:351
at /build/rustc-SnYB1V/rustc-1.15.1+dfsg0/src/libstd/rt.rs:57
12: 0x7fad98a0082f - __libc_start_main
13: 0x7fad99807438 - _start
14: 0x0 -

root@FSXVC8:/mnt/c/Users/Woeste/Desktop/weechat-discord#

Have a method of dumping other user's information

Possible features:

  1. Dump username, nickname, game status, discord ID, all mutual servers, etc. of any user specified
  2. List people in channel, their roles, etc.
  3. List people in server, server roles, channels in that server, emojis, possibly voice channels, who is in what voice channel, etc.
  4. Things and stuff that are in the discord::State object that I forgot about when writing this issue.

Possible design:

/discord info [anyID|username|nickname|channelname|servername|etc]
/whois [thing] - would probably be really bad, as weechat doesn't support overloading of commands to be different plugins based on different buffers (would have to do shenanigans with the irc plugin's /whois command)
/info [thing] - or some other unique global command
/discord info channel [channel] - /discord info server [server] - etc.

Settings for default display names / name overrides

Add settings for default display names of various things.

  1. Format of buffer name as displayed in weechat (short_name) - might need arbitrary format string with variable replacement (server name, server ID, channel name, channel ID - also perhaps another format string for privmsg buffers)
  2. Format of logfile name (name) and other things like go.py (although go.py should not be using the same name as the logfile name, but that's a separate issue)
  3. What name a mention gets translated to (discord username or account name, and if the discriminator number is tacked on)
  4. What name is displayed in the panel where the author of a message is displayed
  5. What name is written to the logfile for both mentions and authors (this may not be possible to have different than the previous two items?)
  6. Anything else discovered when having places in code that translate between Discord-named things and weechat things.

In addition, there should be a setting for overriding nicknames:

/discord name 123456789 the_goofy_horse

would set the following setting

plugins.var.weecord.name.123456789 = "the_goofy_horse"

which would be checked by the discord syntax to human name translation, as well as human name to syntax first, before discord's data is used to display the name.

License

I would like to submit a PKGBUILD to the Arch User Repository, so arch users can build and intsall this plugin in an automated way. But I can't find any licensing information about this software.

(Maybe I'm just blind, that happens from time to time.)

Display the user's username in the input bar

I get really freaked out whenever I'm in a buffer that doesn't have the [name] stuff I'm used to in weechat.

[khyperia] I am a sparkle!

Also probably want to add a thing for which name to display (relevant to issue #2 )

cargo build failed

I've got this error when I tried to build.

$ cargo build --release --verbose
failed to parse registry's information for: serde_json
Caused by: the given version requirement is invalid

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.