summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 48ab1f6642673fa5049b4867f58d77fc2d887dbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# discord.c

an alternative client for a messaging platform, written in the C programming language.

code rewrite in 0.0.4 brings a lot of new features and marks the 0.0.3 release obsolete, though it still kind of works for terminal users, although it is very bad. rewritten version is better because it does not reach ratelimits due to using a socket connection and not polling for messages via HTTP. it also has ~~voice support and~~ a GUI frontend.

## screenshots

![screenshot in fullscreen](https://cdn.sijanec.eu/img/2021/09/discord.c_prtsc.png)

## instructions

### debian (ubuntu as well)

```
sudo apt update
sudo apt install discord.c
```

you need to add [my apt repository](https://prog.sijanec.eu/).

built packages only exist for `amd64`, `arm64` and `i386`. for other architectures grab the source package:

```
apt-get --install build discord.c
```

### caveman style install

```
make
./discord.c
```

#### building requirements

* a POSIX build system - app is cross platform and should also be able to be compiled for all major OSes
* a C compiler, `gcc` 10 (faster) and `clang` (better warnings) tested working
* `make`, with support for `.NOTPARALLEL:` or without executing in parallel, GNU `make` tested working
* `libwebsockets-dev` for http and ws client and json parser
* GTK+, `libgtk-3-dev` tested working
* ~~`libsoundio-dev` for crossplatform sound io~~
* ~~`libopus-dev` for sound encoding~~
* ~~`libsodium-dev` for encrypting UDP packets to server~~
* `xxd` for embedding files inside binary (via C unsigned char arrays without messing with object files)

## automatic building

automatic building is done on two servers, one for `arm64` and the other for `amd64`.

check the build badge before downloading:

[![Build Status](https://jenkins.sijanec.eu/buildStatus/icon?job=discord.c)](https://jenkins.sijanec.eu/job/discord.c/)

* `amd64`: [https://cargova.sijanec.eu/prog/discord.c/](https://cargova.sijanec.eu/prog/discord.c/)
* `arm64`: [https://of.sijanec.eu/prog/discord.c/](https://of.sijanec.eu/prog/discord.c/)

there are deb packages and binaries.

## using discord.c as a library (libdiscord.c/discord.c-dev)

discord.c is programmed in two separate sections, the ui section, that was previously made in ncurses, and the API section, that can, as of the code rewrite, be used independently in other applications. It is useful to write alternative frontends for accessing content available using discord.c by using the discord.c library, since that allows breaking API changes to be fixed in one place instead of fixing it for each individual program. There is no documentation provided for the library, but reading discord.c source code you will get the idea. Expect a Doxygen soon.

to your surprise, you can use the ui section, as of the code rewrite, as a library as well and integrate other platforms into it. No docs yet here either.

~~The package for Debian comes with include header files and compiled shared objects so it can be used as a dependency, but beware, this dependency will depend on GTK+3.0, which would be, in case you are doing a GUI with a different widget toolkit, useless.~~

the program is, as of the code rewrite, single threaded, for increased stability and performance. it used to have separated network and ui threads, but now the threading model is abstracted with an event-based programming.

## todo

### discord.c interface for the blind

a must-have feature is an alternative `ui.c` that would simply print messages to the console and be controllable fully from the keyboard, similar to the way pre-0.0.4 `discord.c` was created, but without `ncurses`. blind people can't interact with the messaging platform's official client at the time of writing, and I assume that users of `espeakup` and similar services mostly use their computer from the console and advanced GUI features are only a burden to them. I got an idea that if a piece of software is usable via the old-style printer terminals, only then it's usable for the blind.

completing this task would make `discord.c` the first and the only alternative client with an easy to use interface for the blind.

### android port

it would be useful to have an android port, and luckily this is possible with little effort due to the GTK broadway backend that interfaces with a HTML renderer, WebView for example.

<!--

## working features

* listing guilds and their channels, including private message channels
* joining and listing past messages from those existing channels
* sending messages into channels, ability to be joined into multiple channels at once
* viewing attachments as links
* joining voice channels, talking

## missing features

* check for permissions before join (needs roles parsing)
* tagging people, parsing tags of people/channels/emotes
* ability to join video calls and stream video
* altering profile
* parsing per-channel nicks
* creating channels and creating PMs
* invites
* refreshing channel and guild lists whilst begin turned on
* responding to SIGWINCH and reloading ncurses windows whenever terminal window is resized
* refreshing sound devices whilst being turned on
* checking for rare system failures (for example [a malloc/realloc that fails and returns NULL will probably lead to corruption and SIGSEGV](http://etalabs.net/overcommit.html))

-->