X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=examples%2Fchat.c;h=0df04a73c96ac4efbc2cec7f4a61555aedafc342;hb=80a9dcfd08bcd450f7be14207257713e1b027319;hp=88fe127a1df25368512078c89868a0dddc2336c6;hpb=9d23fe58052b3ef971305699a00ea6dbd1111744;p=meshlink-tiny diff --git a/examples/chat.c b/examples/chat.c index 88fe127..0df04a7 100644 --- a/examples/chat.c +++ b/examples/chat.c @@ -2,7 +2,7 @@ #include #include #include -#include "../src/meshlink.h" +#include "../src/meshlink-tiny.h" static void log_message(meshlink_handle_t *mesh, meshlink_log_level_t level, const char *text) { (void)mesh; @@ -51,24 +51,7 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { *arg++ = 0; } - if(!strcasecmp(buf, "invite")) { - char *invitation; - - if(!arg) { - fprintf(stderr, "/invite requires an argument!\n"); - return; - } - - invitation = meshlink_invite(mesh, NULL, arg); - - if(!invitation) { - fprintf(stderr, "Could not invite '%s': %s\n", arg, meshlink_strerror(meshlink_errno)); - return; - } - - printf("Invitation for %s: %s\n", arg, invitation); - free(invitation); - } else if(!strcasecmp(buf, "join")) { + if(!strcasecmp(buf, "join")) { if(!arg) { fprintf(stderr, "/join requires an argument!\n"); return; @@ -155,7 +138,6 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) { printf( ": Send a message to the given node.\n" " Subsequent messages don't need the : prefix.\n" - "/invite Create an invitation for a new node.\n" "/join Join an existing mesh using an invitation.\n" "/kick Blacklist the given node.\n" "/who [] List all nodes or show information about the given node.\n"