]> git.meshlink.io Git - meshlink/blobdiff - examples/chat.c
We dont check the name in the config file but the name in the handler. This is becaus...
[meshlink] / examples / chat.c
index 70d17d7d917bf6515aaf98d1fb97bea2f969df22..887d1440f0e6b6af095bad45ab0971d801cd363e 100644 (file)
@@ -56,8 +56,10 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) {
 
                if(!meshlink_join(mesh, arg))
                        fprintf(stderr, "Could not join using invitation: %s\n", mesh->errstr);
-               else
+               else {
                        fprintf(stderr, "Invitation accepted!\n");
+                       meshlink_start(mesh);
+               }
        } else if(!strcasecmp(buf, "kick")) {
                if(!arg) {
                        fprintf(stderr, "/kick requires an argument!\n");
@@ -194,7 +196,6 @@ int main(int argc, char *argv[]) {
 
        if(!meshlink_start(mesh)) {
                fprintf(stderr, "Could not start MeshLink: %s\n", mesh->errstr);
-               return 1;
        }
 
        printf("Chat started.\nType /help for a list of commands.\n");