summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorpranomostro <pranomostro@posteo.net>2017-05-15 11:43:21 +0200
committerpranomostro <pranomostro@posteo.net>2017-05-15 11:43:21 +0200
commited084d2111166998cd9b9ef7d64c4f62ceb5549c (patch)
tree736a57093e7461fd6d6ed56c702f6ec83bc59942 /ratox.c
parent96ac996477712ca79adb31e715328c9b3e727ca6 (diff)
Update API so that conf/in accepts flags for the conference type.
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/ratox.c b/ratox.c
index 2130916..2f303dd 100644
--- a/ratox.c
+++ b/ratox.c
@@ -1884,15 +1884,25 @@ newconf(void *data)
{
uint32_t cnum;
size_t n;
- char title[TOX_MAX_NAME_LENGTH + 1];
+ char *title, input[TOX_MAX_NAME_LENGTH + 2 + 1];
n = fiforead(gslots[CONF].dirfd, &gslots[CONF].fd[IN], gfiles[IN],
- title, sizeof(title) - 1);
+ input, sizeof(input) - 1);
if (n <= 0)
return;
- if (title[n - 1] == '\n')
+ if (input[n - 1] == '\n')
n--;
- title[n] = '\0';
+ input[n] = '\0';
+ if(!((input[0] == 't' || input[0] == 'a' || input[0] == 'v') && input[1] == ' ')) {
+ weprintf("No flag found in input\n");
+ return;
+ }
+ if(input[0] == 'a' || input[0] == 'v') {
+ weprintf("Conferences other than text not supported yet\n");
+ return;
+ }
+ title = input + 2;
+ n -= 2;
cnum = tox_conference_new(tox, NULL);
if (cnum == UINT32_MAX) {
weprintf("Failed to create new conference\n");