Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
9832e803
Commit
9832e803
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
data transfer: return filesystem::path
Change-Id: I9fa3dc2be03856fbd0e647ce6f15d11ccb6881ee
parent
f074cf9d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/data_transfer.cpp
+5
-6
5 additions, 6 deletions
src/data_transfer.cpp
src/data_transfer.h
+2
-2
2 additions, 2 deletions
src/data_transfer.h
src/jamidht/transfer_channel_handler.cpp
+3
-3
3 additions, 3 deletions
src/jamidht/transfer_channel_handler.cpp
with
10 additions
and
11 deletions
src/data_transfer.cpp
+
5
−
6
View file @
9832e803
...
...
@@ -369,7 +369,7 @@ TransferManager::info(const std::string& fileId,
auto
itI
=
pimpl_
->
incomings_
.
find
(
fileId
);
auto
itW
=
pimpl_
->
waitingIds_
.
find
(
fileId
);
path
=
this
->
path
(
fileId
);
path
=
this
->
path
(
fileId
)
.
string
()
;
if
(
itI
!=
pimpl_
->
incomings_
.
end
())
{
total
=
itI
->
second
->
info
().
totalSize
;
progress
=
itI
->
second
->
info
().
bytesProgress
;
...
...
@@ -478,10 +478,10 @@ TransferManager::onIncomingFileTransfer(const std::string& fileId,
}
}
std
::
string
std
::
filesystem
::
path
TransferManager
::
path
(
const
std
::
string
&
fileId
)
const
{
return
(
pimpl_
->
conversationDataPath_
/
fileId
).
string
()
;
return
pimpl_
->
conversationDataPath_
/
fileId
;
}
void
...
...
@@ -560,11 +560,10 @@ TransferManager::onIncomingProfile(const std::shared_ptr<dhtnet::ChannelSocket>&
}
}
std
::
string
std
::
filesystem
::
path
TransferManager
::
profilePath
(
const
std
::
string
&
contactId
)
const
{
// TODO iOS?
return
(
pimpl_
->
profilesPath_
/
fmt
::
format
(
"{}.vcf"
,
base64
::
encode
(
contactId
))).
string
();
return
pimpl_
->
profilesPath_
/
fmt
::
format
(
"{}.vcf"
,
base64
::
encode
(
contactId
));
}
std
::
vector
<
WaitingRequest
>
...
...
This diff is collapsed.
Click to expand it.
src/data_transfer.h
+
2
−
2
View file @
9832e803
...
...
@@ -188,7 +188,7 @@ public:
* Retrieve path of a file
* @param id
*/
std
::
string
path
(
const
std
::
string
&
fileId
)
const
;
std
::
filesystem
::
path
path
(
const
std
::
string
&
fileId
)
const
;
/**
* Retrieve waiting files
...
...
@@ -202,7 +202,7 @@ public:
* @param contactId contact's id
* @return where profile.vcf is stored
*/
std
::
string
profilePath
(
const
std
::
string
&
contactId
)
const
;
std
::
filesystem
::
path
profilePath
(
const
std
::
string
&
contactId
)
const
;
private
:
std
::
weak_ptr
<
TransferManager
>
weak
()
...
...
This diff is collapsed.
Click to expand it.
src/jamidht/transfer_channel_handler.cpp
+
3
−
3
View file @
9832e803
...
...
@@ -164,7 +164,7 @@ TransferChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>&
return
;
}
else
if
(
isContactProfile
&&
fileId
.
find
(
".vcf"
)
!=
std
::
string
::
npos
)
{
auto
path
=
acc
->
dataTransfer
()
->
profilePath
(
fileId
.
substr
(
0
,
fileId
.
size
()
-
4
));
acc
->
dataTransfer
()
->
transferFile
(
channel
,
fileId
,
""
,
path
);
acc
->
dataTransfer
()
->
transferFile
(
channel
,
fileId
,
""
,
path
.
string
()
);
return
;
}
else
if
(
fileId
==
"profile.vcf"
)
{
acc
->
dataTransfer
()
->
onIncomingProfile
(
channel
,
sha3Sum
);
...
...
@@ -178,8 +178,8 @@ TransferChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>&
return
;
}
auto
interactionId
=
fileId
.
substr
(
0
,
sep
);
std
::
string
path
=
dt
->
path
(
fileId
);
dt
->
transferFile
(
channel
,
fileId
,
interactionId
,
path
,
start
,
end
);
auto
path
=
dt
->
path
(
fileId
);
dt
->
transferFile
(
channel
,
fileId
,
interactionId
,
path
.
string
()
,
start
,
end
);
}
}
// namespace jami
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment