+ // Check if the file contains Sub-Mesh information
+ buf[0] = 0;
+ fgets(buf, sizeof(buf), f);
+
+ if(*buf) {
+ buf[strlen(buf) - 1] = 0;
+ }
+
+ if(!strncmp(buf, "SubMesh", 7)) {
+ len = strcspn(buf, " \t=");
+ char *submesh_name = buf + len;
+ submesh_name += strspn(submesh_name, " \t");
+
+ if(*submesh_name == '=') {
+ submesh_name++;
+ submesh_name += strspn(submesh_name, " \t");
+ }
+
+ if(!check_id(submesh_name)) {
+ logger(mesh, MESHLINK_ERROR, "Invalid invitation file %s\n", cookie);
+ fclose(f);
+ return false;
+ }
+
+ c->submesh = NULL;
+ c->submesh = lookup_or_create_submesh(mesh, submesh_name);
+
+ if(!c->submesh) {
+ return false;
+ }
+ }
+