How 2 git
This commit is contained in:
parent
9edfaa9105
commit
486b30a856
1 changed files with 1 additions and 22 deletions
23
src/main.cpp
23
src/main.cpp
|
@ -45,7 +45,7 @@ int main() {
|
||||||
if(!stream.is_open()){
|
if(!stream.is_open()){
|
||||||
// File dosn't exist, log in
|
// File dosn't exist, log in
|
||||||
client = new Matrix::Client("https://matrix.timoreo.fr", "", nullptr); // &s
|
client = new Matrix::Client("https://matrix.timoreo.fr", "", nullptr); // &s
|
||||||
if (client->login("timoreo-3ds", "***REMOVED***", DEVICE_ID)) {
|
if (client->login("timoreo-3ds", "", DEVICE_ID)) {
|
||||||
// logged in
|
// logged in
|
||||||
puts("Logged in !!");
|
puts("Logged in !!");
|
||||||
std::ofstream ostr{TOKEN_FILENAME, std::fstream::out};
|
std::ofstream ostr{TOKEN_FILENAME, std::fstream::out};
|
||||||
|
@ -234,26 +234,5 @@ OlmAccount* load_account(Matrix::Client client){
|
||||||
_olm_encode_base64(overhead + data, fsize, data);
|
_olm_encode_base64(overhead + data, fsize, data);
|
||||||
olm_unpickle_account(acc, nullptr, 0, data, overhead + fsize);
|
olm_unpickle_account(acc, nullptr, 0, data, overhead + fsize);
|
||||||
}
|
}
|
||||||
return acc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void make_keys(OlmAccount* acc){
|
|
||||||
|
|
||||||
// Generate Device Keys
|
|
||||||
size_t keylen = olm_account_identity_keys_length(acc);
|
|
||||||
//ssize_t datalen = _olm_encode_base64_length(keylen);
|
|
||||||
std::unique_ptr<uint8_t> identity_keys = std::make_unique<uint8_t>(keylen);
|
|
||||||
olm_account_identity_keys(acc, identity_keys.get(), keylen);
|
|
||||||
// _olm_decode_base64(identity_keys.get(), datalen, identity_keys.get());
|
|
||||||
// Save keys to disk
|
|
||||||
std::ofstream storage("account-keys");
|
|
||||||
storage << identity_keys.get() << std::endl;
|
|
||||||
storage.close();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
Loading…
Reference in a new issue