commit 332c06103b614e8c3eb9b3a3e684c08b70a9e19f
parent ace2f9d08fc3cc219a33081f0f8029910e2b2bbb
Author: pranomostro <pranomestro@gmail.com>
Date: Sun, 5 Mar 2017 01:32:00 +0100
Update docs and fix minor code issue:
Update error messages.
NUM/invite now also accepts ID's (not only public keys).
The title is now also changed for the changer.
Diffstat:
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/README b/README
@@ -64,6 +64,11 @@ to help explain the semantics of the individual files.
|
|-- id # 'cat id' to show your own ID, you can give this to your friends
|
+|-- conf # managing conferences
+| |-- err # conference related errors
+| |-- in # 'echo "group title" >in' for creating a new group
+| |-- out # 'echo 1 >out/ID_COOKIE' for joining a conference
+|
|-- name # changing your nick
| |-- err # nickname related errors
| |-- in # 'echo my-new-nick > in' to change your name
diff --git a/ratox.c b/ratox.c
@@ -494,12 +494,12 @@ cbconfinvite(Tox *m, uint32_t frnum, TOX_CONFERENCE_TYPE type, const uint8_t *co
uint8_t id[TOX_PUBLIC_KEY_SIZE];
if(type != TOX_CONFERENCE_TYPE_TEXT) {
- weprintf(": %d : Only text conference supported at the moment\n");
+ logmsg(": Conference : Only text conference supported at the moment\n");
return;
}
if (!tox_friend_get_public_key(tox, frnum, id, NULL)) {
- weprintf(": %d : Key: Failed to get for invite\n", frnum);
+ weprintf("Failed to get key by friend %i for invite\n", frnum);
return;
}
@@ -1115,7 +1115,7 @@ invitefriend(struct conference *c)
buf[n - 1] = '\0';
TAILQ_FOREACH(f, &friendhead, entry)
- if (!memcmp(buf, f->idstr, sizeof(f->idstr)))
+ if (!memcmp(buf, f->idstr, sizeof(f->idstr)-1))
break;
if (!f) {
logmsg("Conference %s > no friend with id %s found\n", c->numstr, buf);
@@ -1128,7 +1128,7 @@ invitefriend(struct conference *c)
if (!tox_conference_invite(tox, f->num, c->num, NULL))
weprintf("Failed to invite %s\n", buf);
else
- logmsg("Conference %s > Invite %s\n", c->numstr, buf);
+ logmsg("Conference %s > Invited %s\n", c->numstr, buf);
}
static void
@@ -1163,6 +1163,9 @@ updatetitle(struct conference *c)
weprintf("%s : Title : Failed to set to \"%s\"\n", title, c->numstr);
return;
}
+ ftruncate(c->fd[CTITLE_OUT], 0);
+ lseek(c->fd[CTITLE_OUT], 0, SEEK_SET);
+ dprintf(c->fd[CTITLE_OUT], "%s\n", title);
logmsg("Conference %s > Title > %s\n", c->numstr, title);
}