diff options
author | pranomostro <pranomostro@posteo.net> | 2017-05-15 11:43:21 +0200 |
---|---|---|
committer | pranomostro <pranomostro@posteo.net> | 2017-05-15 11:43:21 +0200 |
commit | ed084d2111166998cd9b9ef7d64c4f62ceb5549c (patch) | |
tree | 736a57093e7461fd6d6ed56c702f6ec83bc59942 /ratox.c | |
parent | 96ac996477712ca79adb31e715328c9b3e727ca6 (diff) |
Update API so that conf/in accepts flags for the conference type.
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -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"); |