Commit 5c910388 authored by minus's avatar minus

Add qfav button

parent 46609155
......@@ -92,6 +92,16 @@ void button_fav(enum button button, enum button_direction direction, void *userd
write(fc->stdin, buf, n);
void button_qfav(enum button button, enum button_direction direction, void *userdata) {
fprintf(stdout, "button pressed: %i dir=%i\n", button, direction);
if (direction != BUTTON_PRESS) return;
struct fav_config *fc = userdata;
char buf[1024];
int n = snprintf(buf, sizeof(buf), "GET request/random?q=@%s\n", fc->username);
fwrite(buf, n, 1, stderr);
write(fc->stdin, buf, n);
int main(int argc, char *argv[]) {
if (argc != 2) {
fprintf(stderr, "usage: %s CLIENT_ID\n", argv[0]);
......@@ -166,6 +176,7 @@ int main(int argc, char *argv[]) {
guint evsrcid = g_io_add_watch(ch, G_IO_IN, &on_fav_info, &fc);
button_callback_add(BOTTOM7, button_fav, &fc);
button_callback_add(TOP7, button_qfav, &fc);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment