Skip to content
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

conferences saving #1156

Merged
merged 1 commit into from
Nov 29, 2018
Merged

conferences saving #1156

merged 1 commit into from
Nov 29, 2018

Conversation

zugz
Copy link

@zugz zugz commented Sep 9, 2018

This change is Reviewable

@iphydf iphydf added this to the v0.2.x milestone Sep 9, 2018
@zugz zugz force-pushed the minpgcSaving branch 2 times, most recently from 0f10df1 to faf64f4 Compare September 25, 2018 19:52
@codecov
Copy link

codecov bot commented Sep 25, 2018

Codecov Report

Merging #1156 into master will increase coverage by <.1%.
The diff coverage is 98.6%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1156     +/-   ##
========================================
+ Coverage    83.2%   83.3%   +<.1%     
========================================
  Files          82      82             
  Lines       14685   14827    +142     
========================================
+ Hits        12225   12354    +129     
- Misses       2460    2473     +13
Impacted Files Coverage Δ
toxcore/tox.c 66.7% <100%> (ø) ⬆️
auto_tests/conference_test.c 99.2% <100%> (+0.1%) ⬆️
toxcore/friend_connection.c 94.6% <100%> (ø) ⬆️
toxcore/group.c 78.8% <98.3%> (+2.2%) ⬆️
toxav/msi.c 64.2% <0%> (-4.2%) ⬇️
toxcore/LAN_discovery.c 83% <0%> (-2.9%) ⬇️
toxav/toxav.c 67.4% <0%> (-2.6%) ⬇️
toxcore/onion_client.c 95.3% <0%> (-0.7%) ⬇️
toxcore/Messenger.c 86.8% <0%> (-0.2%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update caca350...9770880. Read the comment docs.

@zugz zugz force-pushed the minpgcSaving branch 6 times, most recently from ad35c68 to 4ff673e Compare September 28, 2018 17:02
@zugz zugz changed the title WIP: conferences saving conferences saving Oct 18, 2018
Copy link

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 13 of 13 files at r2, 4 of 4 files at r3, 6 of 6 files at r4, 2 of 2 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, 1 of 1 files at r8, 4 of 4 files at r9, 1 of 1 files at r10, 3 of 3 files at r11, 3 of 3 files at r12, 2 of 2 files at r13, 1 of 1 files at r14, 1 of 1 files at r15, 1 of 1 files at r16.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf and @zugz)


toxcore/group.h, line 461 at r4 (raw file):

 *
 * @param status Result of loading section is stored here if the section is handled.
 * @return true iff section handled.

document rest of the parameters?


toxcore/group.c, line 2937 at r13 (raw file):

    uint32_t len = SAVED_CONF_SIZE_CONSTANT + g->title_len;

    bool found_self = false;

why do we need this flag? is id_equal that expensive to call? If you want to keep this code I'd expect a comment explaining the reason for the existence of this flag.


toxcore/Messenger.c, line 3263 at r4 (raw file):

bool messenger_load_state_section(Messenger *m, const uint8_t *data, uint32_t length, uint16_t type,
                                  State_Load_Status *status)
{

add assertions for non-null parameters m, data, status?


toxcore/state.c, line 108 at r3 (raw file):

void host_to_lendian_bytes16(uint8_t *dest, uint16_t num)
{

I'm not sure if we want to document preconditions for functions, but I would add an assert(dest != nullptr); here


toxcore/state.c, line 116 at r3 (raw file):

void lendian_bytes_to_host16(uint16_t *dest, const uint8_t *lendian)
{

same


toxcore/tox.c, line 607 at r6 (raw file):

{
    if (data == nullptr) {
        return;

add a log message, because loading to a nullptr was probably not intended?

Copy link
Author

@zugz zugz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 7 files at r17.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf, @zugz, and @sudden6)


toxcore/group.h, line 461 at r4 (raw file):

Previously, sudden6 wrote…

document rest of the parameters?

Done.


toxcore/group.c, line 2937 at r13 (raw file):

Previously, sudden6 wrote…

why do we need this flag? is id_equal that expensive to call? If you want to keep this code I'd expect a comment explaining the reason for the existence of this flag.

Done.


toxcore/tox.c, line 607 at r6 (raw file):

Previously, sudden6 wrote…

add a log message, because loading to a nullptr was probably not intended?

This behaviour on null is documented in the API, so we'd best leave it.


toxcore/Messenger.c, line 3263 at r4 (raw file):

Previously, sudden6 wrote…

add assertions for non-null parameters m, data, status?

Generally we don't do this in non-API functions in toxcore. I'd rather conform to that style.


toxcore/state.c, line 108 at r3 (raw file):

Previously, sudden6 wrote…

I'm not sure if we want to document preconditions for functions, but I would add an assert(dest != nullptr); here

As above.


toxcore/state.c, line 116 at r3 (raw file):

Previously, sudden6 wrote…

same

As above.

Copy link

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 7 files at r17, 1 of 2 files at r19, 1 of 1 files at r21, 1 of 2 files at r23, 1 of 1 files at r24.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf)


toxcore/tox.c, line 607 at r6 (raw file):

Previously, zugz (zugz) wrote…

This behaviour on null is documented in the API, so we'd best leave it.

ok


toxcore/Messenger.c, line 3263 at r4 (raw file):

Previously, zugz (zugz) wrote…

Generally we don't do this in non-API functions in toxcore. I'd rather conform to that style.

ok then


toxcore/state.c, line 108 at r3 (raw file):

Previously, zugz (zugz) wrote…

As above.

ok


toxcore/state.c, line 116 at r3 (raw file):

Previously, zugz (zugz) wrote…

As above.

ok

@sudden6
Copy link

sudden6 commented Oct 30, 2018

Are these CI fails because of this PR or did they exist before?

@zugz
Copy link
Author

zugz commented Oct 30, 2018 via email

Copy link

@sudden6 sudden6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong: then

Reviewed 5 of 7 files at r17.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf)

sudden6 added a commit to sudden6/qTox that referenced this pull request Oct 30, 2018
This change creates groups on startup of Core. We need this once
TokTok/c-toxcore#1156 is merged to load existing
groups.
sudden6 added a commit to sudden6/qTox that referenced this pull request Nov 17, 2018
This change creates groups on startup of Core. We need this once
TokTok/c-toxcore#1156 is merged to load existing
groups.
sudden6 added a commit to sudden6/qTox that referenced this pull request Nov 21, 2018
This change creates groups on startup of Core. We need this once
TokTok/c-toxcore#1156 is merged to load existing
groups.
sudden6 added a commit to sudden6/qTox that referenced this pull request Nov 22, 2018
This change creates groups on startup of Core. We need this once
TokTok/c-toxcore#1156 is merged to load existing
groups.
naxuroqa added a commit to naxuroqa/Venom that referenced this pull request Nov 23, 2018
* Prepare for TokTok/c-toxcore#1156 to be merged
* Restore known groupchats from chatlist
@sudden6
Copy link

sudden6 commented Nov 24, 2018

@iphydf Your lgtm seems to block this PR, what is your current state with this?

docs/minpgc.md Outdated
on start-up (e.g. starting windows for them), and by not automatically killing
groups on closing the client.
Clients needs to support this by understanding that groups may exist on
start-up. Clients should call tox\_conference\_get\_chatlist to obtain them. A
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use `backticks` for symbol names.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -796,6 +796,9 @@ uint8_t *messenger_save(const Messenger *m, uint8_t *data);

/* Load a state section.
*
* @param data Data to load
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "." at the end (or remove it from all the others).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

toxcore/group.c Outdated
return false;
}

return (group_kill_peer_send(g_c, groupnumber, g->peer_number) == 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra () around returned expression.

toxcore/group.c Show resolved Hide resolved
toxcore/group.c Show resolved Hide resolved
toxcore/group.c Show resolved Hide resolved
toxcore/group.c Show resolved Hide resolved
* add global friend_connection status callback, used for group rejoining
* stop leaving groups on killing tox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants