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

Group chats logging #1079

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Conversation

redmanmale
Copy link
Contributor

@redmanmale redmanmale commented Oct 4, 2017

Fixes #231.

Since we haven't persistent chats yet, chat log could not be loaded.
So the only case when we need that log is export as plain text which was implemented in that PR.

Also I added unique pseudo-identifier for each new chat. If you are not okay with that I'm looking forward to your options for this.

Merge after #1074 (there will be group settings layout update).


This change is Reviewable

@robinlinden
Copy link
Member

Reviewed 16 of 16 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


src/chatlog.c, line 242 at r1 (raw file):

}

void utox_export_chatlog_init(uint32_t chat_number, bool is_chat) {

I'd prefer is_group or is_groupchat instead of is_chat.


src/groups.c, line 96 at r1 (raw file):

    uint8_t random[TOX_PUBLIC_KEY_SIZE];
    for (uint8_t i = 0; i < TOX_PUBLIC_KEY_SIZE; ++i)
    {

This goes on the line above. (1tbs)


Comments from Reviewable

@redmanmale
Copy link
Contributor Author

Review status: 5 of 19 files reviewed at latest revision, 2 unresolved discussions.


src/chatlog.c, line 242 at r1 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

I'd prefer is_group or is_groupchat instead of is_chat.

Done.


src/groups.c, line 96 at r1 (raw file):

Previously, robinlinden (Robin Lindén) wrote…

This goes on the line above. (1tbs)

Done.


Comments from Reviewable

@redmanmale
Copy link
Contributor Author

Review status: 3 of 19 files reviewed at latest revision, 3 unresolved discussions.


src/xlib/gtk.c, line 330 at r2 (raw file):

            LOG_ERR("GTK", "Could not get group with number: %u", chat->chat_number);
            free(chat);
            utoxGTK_open = false;

Add fix like in #1113.


Comments from Reviewable

@redmanmale
Copy link
Contributor Author

4ac6ce4 is bad. And it needs to be reverted and fixed.

When I merge these to functions (for Win7 and WinXP) in one they were completely the same.
But they should not be.
In WinXP UTOX_FILE_NAME_LENGTH (1024) should not exits because MAX_MATH is 260.

@redmanmale redmanmale force-pushed the groupchat-logging branch 2 times, most recently from 456f0af to 648ee8a Compare November 23, 2017 18:09
@GrayHatter
Copy link
Member

Reviewed 1 of 16 files at r1, 2 of 16 files at r2.
Review status: 5 of 18 files reviewed at latest revision, 4 unresolved discussions.


src/ui.c, line 313 at r4 (raw file):

    /* Group Settings */
    CREATE_EDIT(group_topic, 10, 95, -10, 24);
    CREATE_BUTTON(export_chatlog_group, 10, 125, _BM_SBUTTON_WIDTH, _BM_SBUTTON_HEIGHT); //TODO: Move to layout and fix position

I'm gonna block on this one. Solve the TODO before we merge this.


Comments from Reviewable

@redmanmale
Copy link
Contributor Author

Review status: 3 of 18 files reviewed at latest revision, 4 unresolved discussions.


src/ui.c, line 313 at r4 (raw file):

Previously, GrayHatter (Gregory Mullen) wrote…

I'm gonna block on this one. Solve the TODO before we merge this.

Done.


Comments from Reviewable

Copy link
Member

@GrayHatter GrayHatter left a comment

Choose a reason for hiding this comment

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

somewhat related @utox/devs anyone know if >1 thread can call chatlog functions at the same time? I.e., do we need to add thread locking (per the conversation in IRC a few days back)

Reviewed 2 of 16 files at r2, 1 of 10 files at r3, 1 of 1 files at r4, 1 of 3 files at r5, 2 of 6 files at r6.
Reviewable status: 17 files need 2 more reviewers, 5 open discussions remaining, missing Admin LGTM at current revision.


src/chatlog.h, line 60 at r6 (raw file):

 * Setup for exporting the chat log to plain text
 */
void utox_export_chatlog_init(uint32_t chat_number, bool is_groupchat);

groups vs users should be two different functions. likely with chatlog_export_core_init() for the actual processing


src/chatlog.c, line 242 at r1 (raw file):

Previously, redmanmale (redmanmale) wrote…

Done.

sorry, I'm gonna make it more complicated


src/android/main.c, line 284 at r6 (raw file):

void native_export_chatlog_init(uint32_t chat_number, bool is_groupchat)
{   /* Unsupported on Android */ }

FYI, rip android... no love :/


src/layout/group.c, line 91 at r6 (raw file):

    setfont(FONT_SELF_NAME);

    drawstr(x + SCALE(10), y + SCALE(MAIN_TOP + 10), GROUP_TOPIC);

It's been so long, is this the new way of drawing? IIRC this is the legacy way.

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.

None yet

3 participants