Skip to content

Add friends table and implement initial tox data save/load#7

Open
Gravechapa wants to merge 1 commit intogravechapa/message_dbfrom
gravechapa/db
Open

Add friends table and implement initial tox data save/load#7
Gravechapa wants to merge 1 commit intogravechapa/message_dbfrom
gravechapa/db

Conversation

@Gravechapa
Copy link
Owner

No description provided.

@Gravechapa Gravechapa self-assigned this Dec 4, 2018
@Gravechapa Gravechapa requested a review from Stuv7CB December 4, 2018 12:12
qDebug() << "Request received";
tox_friend_add_norequest(tox_c, public_key, NULL);
uint32_t friend_id = tox_friend_add_norequest(tox_c, public_key, NULL);
if (friend_id == UINT32_MAX)
Copy link
Collaborator

Choose a reason for hiding this comment

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

std::numeric_limits<uint32_t>::max()

Copy link
Collaborator

@Stuv7CB Stuv7CB Dec 5, 2018

Choose a reason for hiding this comment

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

Замени везде

{
savedata_file.write(reinterpret_cast<char*>(savedata.data()), savedata.size());
}
tox_kill(_tox);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Безопасно так делать, если мы создали объект, но не успели аутентифицироваться?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Нет, но мы так не делаем. Там вообще нужна хорошая обработка ошибок. Пока просто чтобы работало сделал.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Решается банальным if-ом разве нет?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Там надо переделывать систему, чтобы в любом случае данные не повредились. Плюс бэкапы и более частое сохранение.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Я пока занимаюсь функционалом. Обработка ошибок сейчас не самое важное. Там еще 20 раз код поменяется…

Copy link
Collaborator

@Stuv7CB Stuv7CB Dec 5, 2018

Choose a reason for hiding this comment

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

Оставь комментарий с TODO И заведи ишью

Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO - плохая вещь. В мастер заливать буду, заведу.

Copy link
Collaborator

Choose a reason for hiding this comment

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

По ним искать можно потом

Tox_Options *options = tox_options_new(NULL);
if (!options)
{
throw std::runtime_error("Can't initialize tox options");
Copy link
Collaborator

@Stuv7CB Stuv7CB Dec 5, 2018

Choose a reason for hiding this comment

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

Наверняка в токсе есть способ получить ошибку, выводи её вместе с сообщением

ToxModel::~ToxModel()
{
_finalize = true;
_finalize.store(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Разница?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ее нет. Я просто поменял на всякий случай. У меня проблемы с атомиком были, но это на сколько я понимаю касается только чтения.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Оставь комментарий

Copy link
Owner Author

Choose a reason for hiding this comment

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

Оставит комментарий по поводу чего?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Почему тут именно так

Copy link
Owner Author

Choose a reason for hiding this comment

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

Могу вернуть если тебя это очень напрягает.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Напрягает

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.

2 participants