-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a groupchat accept screen. #1074
base: develop
Are you sure you want to change the base?
Conversation
28cc526
to
c4ca090
Compare
Reviewed 3 of 15 files at r1, 26 of 38 files at r2. langs/en.h, line 338 at r2 (raw file):
we don't allow null termination from data that could come from untrusted users. src/layout/group.c, line 65 at r2 (raw file):
this can overrun. Comments from Reviewable |
Review status: 27 of 47 files reviewed at latest revision, 2 unresolved discussions. langs/en.h, line 338 at r2 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Done. src/layout/group.c, line 65 at r2 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Done. Comments from Reviewable |
Reviewed 8 of 15 files at r1, 32 of 38 files at r2, 7 of 7 files at r3. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. langs/en.h, line 335 at r3 (raw file):
I'm not a fan of the change from groupchat to chat. Is this something we want to do? Comments from Reviewable |
Reviewed 18 of 18 files at r4. Comments from Reviewable |
Reviewed 1 of 15 files at r1, 1 of 38 files at r2. src/layout/group_invite.c, line 23 at r4 (raw file):
This declaration isn't needed. Comments from Reviewable |
Review status: 46 of 47 files reviewed at latest revision, 2 unresolved discussions. src/layout/group_invite.c, line 23 at r4 (raw file): Previously, robinlinden (Robin Lindén) wrote…
Done. Comments from Reviewable |
Reviewed 1 of 1 files at r5. Comments from Reviewable |
Reviewed 8 of 15 files at r1, 18 of 38 files at r2, 2 of 7 files at r3, 18 of 18 files at r4, 1 of 1 files at r5. src/group_invite.c, line 30 at r5 (raw file):
Add a check to make sure src/group_invite.c, line 123 at r5 (raw file):
Add a check to make sure Comments from Reviewable |
Thank you for all your hard work. |
56b05a3
to
da27885
Compare
Review status: 32 of 48 files reviewed at latest revision, 3 unresolved discussions. src/group_invite.c, line 30 at r5 (raw file): Previously, endoffile78 (Endoffile) wrote…
Done. src/group_invite.c, line 123 at r5 (raw file): Previously, endoffile78 (Endoffile) wrote…
Done. Comments from Reviewable |
Reviewed 14 of 14 files at r6, 2 of 2 files at r7. Comments from Reviewable |
"TOUCH ALL THE FILES" -- @robinlinden probably round 1 review Reviewed 2 of 15 files at r1, 13 of 18 files at r4, 8 of 14 files at r6, 1 of 2 files at r7. langs/en.h, line 335 at r3 (raw file): Previously, robinlinden (Robin Lindén) wrote…
Not in this pull, but we should change everything to conference. Per the toxcore change. Then groups, and conferences can live side by side. Both with a different feature set. langs/i18n_decls.h, line 107 at r2 (raw file):
Do we want to add a suffix for strings that required additional params? src/ui.c, line 314 at r7 (raw file):
We don't use this macro anymore. Move it to the UI file. src/ui.c, line 344 at r7 (raw file):
NTS: what is this? Comments from Reviewable |
da27885
to
f520dcd
Compare
Review status: 46 of 48 files reviewed at latest revision, 5 unresolved discussions. src/ui.c, line 314 at r7 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
This whole commit moved to #1079. Comments from Reviewable |
Reviewed 2 of 2 files at r8. Comments from Reviewable |
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. src/layout/group.c, line 65 at r2 (raw file): Previously, redmanmale (redmanmale) wrote…
Sorry, this is gonna take me some time to review. This being safe depends on how each platform searches string length, + where/how each func counts bytes, vs utf8-chars. First glance your code looks correct, but I need to make sure all the other functions are being used correctly as well. Comments from Reviewable |
Reviewed 3 of 15 files at r1, 13 of 38 files at r2, 1 of 7 files at r3, 13 of 18 files at r4, 1 of 1 files at r5, 13 of 14 files at r6, 2 of 2 files at r7, 2 of 2 files at r8. src/layout/group.c, line 65 at r2 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
OK, but I did'n touch this at all. Comments from Reviewable |
@redmanmale You're right, but I can't LGTM a section that might be wrong. Hence the apology, through no fault of your own, I have to make you wait for code that's likely fine. |
Review status: 40 of 47 files reviewed at latest revision, 7 unresolved discussions, some commit checks broke. src/messages.c, line 194 at r8 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Getting current group to scroll its content; if you're asking why I touched this at all it's because old code ( src/layout/group_invite.c, line 27 at r8 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
On every UI event; but we do this thing ( src/layout/group_invite.c, line 88 at r8 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Done. src/ui.c, line 344 at r7 (raw file): Previously, GrayHatter (Gregory Mullen) wrote…
Done. Moved to UI definition. Comments from Reviewable |
Reviewed 1 of 14 files at r6, 3 of 4 files at r9, 3 of 5 files at r10. src/layout/group_invite.c, line 27 at r8 (raw file): Previously, redmanmale (redmanmale) wrote…
LGTM but I'd also like to see Comments from Reviewable |
Reviewed 1 of 4 files at r9, 2 of 5 files at r10, 17 of 17 files at r11. Comments from Reviewable |
If no one mind it, I'd like to merge it. Are there any problems? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 14 files at r6, 1 of 2 files at r7, 1 of 4 files at r9, 2 of 5 files at r10, 17 of 17 files at r11.
Reviewable status: 3 open discussions remaining, 1 assignee LGTMs are missing (waiting on @undefined, @undefined, @undefined, @undefined, @undefined, @undefined, @undefined, @undefined, @undefined, and @undefined)
I want to take a look, too. And push translations for Polish, too. And German. |
src/command_funcs.c
Outdated
if (f != NULL && f->online) { | ||
size_t msg_length = UTOX_FRIEND_NAME_LENGTH(f) + SLEN(GROUP_MESSAGE_INVITE); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/flist.c
Outdated
drawalpha(group_bitmap, avatar_x, y + ROSTER_AVATAR_TOP, default_w, default_w, | ||
selected_item == i ? COLOR_MAIN_TEXT : COLOR_LIST_TEXT); | ||
|
||
size_t msg_length = SLEN(GROUP_INVITE) + 4; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/flist.c
Outdated
@@ -895,6 +941,14 @@ GROUPCHAT *flist_get_groupchat(void) { | |||
return NULL; | |||
} | |||
|
|||
uint8_t flist_get_group_invite_id(void) { | |||
if (flist_get_type() == ITEM_GROUP_INVITE) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/flist.c
Outdated
if (f->online) { | ||
size_t msg_length = UTOX_FRIEND_NAME_LENGTH(f) + SLEN(GROUP_MESSAGE_INVITE); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/friend.c
Outdated
|
||
size_t title_length = snprintf((char *)title, UTOX_FRIEND_NAME_LENGTH(f) + 25, "uTox new message from %.*s", | ||
(int)UTOX_FRIEND_NAME_LENGTH(f), UTOX_FRIEND_NAME(f)); | ||
size_t title_length = UTOX_FRIEND_NAME_LENGTH(f) + SLEN(FRIEND_MESSAGE_NEW); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/groups.c
Outdated
memcpy(old, peer->name, peer->name_length); | ||
size_t size = snprintf(msg, TOX_MAX_NAME_LENGTH, "<- has changed their name from %.*s", | ||
peer->name_length, old); | ||
size_t size = peer->name_length + SLEN(GROUP_MESSAGE_CHANGE_NAME); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/groups.c
Outdated
char title[g->name_length + 25]; | ||
|
||
size_t title_length = snprintf(title, g->name_length + 25, "uTox new message in %.*s", g->name_length, g->name); | ||
size_t title_length = g->name_length + SLEN(GROUP_MESSAGE_NEW); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/layout/group.c
Outdated
@@ -56,8 +56,14 @@ static void draw_group(int x, int UNUSED(y), int UNUSED(w), int UNUSED(height)) | |||
GROUP_PEER *peer = g->peer[i]; | |||
|
|||
if (peer && peer->name_length) { | |||
char buf[TOX_MAX_NAME_LENGTH]; | |||
int text_length = snprintf((char *)buf, TOX_MAX_NAME_LENGTH, "%.*s, ", (int)peer->name_length, peer->name); | |||
uint8_t text_length = peer->name_length + 2; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/layout/group_invite.c
Outdated
setcolor(COLOR_MAIN_TEXT); | ||
setfont(FONT_SELF_NAME); | ||
|
||
size_t label_length = SLEN(GROUP_INVITE) + 4; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/utox.c
Outdated
@@ -632,7 +641,7 @@ void utox_message_dispatch(UTOX_MSG utox_msg_id, uint16_t param1, uint16_t param | |||
g->source[param2] = g->source[g->peer_count]; | |||
} | |||
|
|||
g->topic_length = snprintf((char *)g->topic, sizeof(g->topic), "%u users in chat", g->peer_count); | |||
g->topic_length = snprintf((char *)g->topic, sizeof(g->topic), S(GROUP_STATUS), g->peer_count); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/utox.c
Outdated
@@ -653,7 +662,7 @@ void utox_message_dispatch(UTOX_MSG utox_msg_id, uint16_t param1, uint16_t param | |||
return; | |||
} | |||
|
|||
g->topic_length = snprintf((char *)g->topic, sizeof(g->topic), "%u users in chat", g->peer_count); | |||
g->topic_length = snprintf((char *)g->topic, sizeof(g->topic), S(GROUP_STATUS), g->peer_count); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
src/group_invite.c
Outdated
return false; | ||
} | ||
|
||
uint32_t group_id = UINT32_MAX; |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I don't like the current screen.
|
Also, there should be a setting for auto-accepting group invitations. |
Correctly working code is not an exception in uTox.
5bea998
to
5da3d51
Compare
Next I'm translating to German and Polish. |
Translate: FRIEND_MESSAGE_NEW GROUP_STATUS GROUP_INVITE GROUP_INVITE_FRIEND GROUP_MESSAGE_INVITE GROUP_MESSAGE_JOIN GROUP_MESSAGE_CHANGE_NAME GROUP_MESSAGE_QUIT GROUP_MESSAGE_NEW
Translate: FRIEND_MESSAGE_NEW GROUP_STATUS GROUP_INVITE GROUP_INVITE_FRIEND GROUP_MESSAGE_INVITE GROUP_MESSAGE_JOIN GROUP_MESSAGE_CHANGE_NAME GROUP_MESSAGE_QUIT GROUP_MESSAGE_NEW Change: GROUP_JOIN_AUDIO LEAVE_GROUP
@cebe, you can please look at my translation. I am not sure about |
I don't remember where I was on this, but it's not done.
This change is