Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
60926a66
Commit
60926a66
authored
Jul 14, 2020
by
Aline Gondim Santos
Browse files
modify enable_plugin usage
Change-Id: I0d41bd1a8e55371748d36a1b5c3654ec03f6fd5b
parent
8d40c627
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/archiver.cpp
View file @
60926a66
...
...
@@ -348,12 +348,13 @@ static ArchivePtr createArchiveDiskWriter() {
archive_write_free
(
a
);
}};
}
#endif
//==========================
std
::
vector
<
std
::
string
>
listArchiveContent
(
const
std
::
string
&
archivePath
)
{
std
::
vector
<
std
::
string
>
fileNames
;
#ifdef ENABLE_PLUGIN
ArchivePtr
archiveReader
=
createArchiveReader
();
struct
archive_entry
*
entry
;
int
r
;
...
...
@@ -371,12 +372,13 @@ std::vector<std::string> listArchiveContent(const std::string &archivePath)
std
::
string
fileEntry
=
archive_entry_pathname
(
entry
)
?
archive_entry_pathname
(
entry
)
:
"Undefined"
;
fileNames
.
push_back
(
fileEntry
);
}
#endif
return
fileNames
;
}
void
uncompressArchive
(
const
std
::
string
&
archivePath
,
const
std
::
string
&
dir
,
const
FileMatchPair
&
f
)
{
#ifdef ENABLE_PLUGIN
int
r
;
ArchivePtr
archiveReader
=
createArchiveReader
();
...
...
@@ -452,11 +454,14 @@ void uncompressArchive(const std::string &archivePath, const std::string &dir, c
}
}
}
#endif
}
std
::
vector
<
uint8_t
>
readFileFromArchive
(
const
std
::
string
&
archivePath
,
const
std
::
string
&
fileRelativePathName
)
{
std
::
vector
<
uint8_t
>
fileContent
;
#ifdef ENABLE_PLUGIN
long
r
;
ArchivePtr
archiveReader
=
createArchiveReader
();
struct
archive_entry
*
entry
;
...
...
@@ -489,7 +494,6 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath,
if
(
fileEntry
==
fileRelativePathName
){
// Copying the data content
DataBlock
db
;
std
::
vector
<
uint8_t
>
fileContent
;
while
(
true
)
{
r
=
readDataBlock
(
archiveReader
,
db
);
...
...
@@ -513,7 +517,8 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath,
}
}
throw
std
::
runtime_error
(
"File "
+
fileRelativePathName
+
" not found in the archive"
);
#endif
return
fileContent
;
}
#endif //ENABLE_PLUGIN
}}
// namespace jami::archiver
src/archiver.h
View file @
60926a66
...
...
@@ -88,7 +88,6 @@ std::vector<uint8_t> decompressGzip(const std::string& path);
*/
gzFile
openGzip
(
const
std
::
string
&
path
,
const
char
*
mode
);
#ifdef ENABLE_PLUGIN
/**
* @brief listArchiveContent
* @param archivePath
...
...
@@ -120,7 +119,6 @@ void uncompressArchive(const std::string& path, const std::string &dir, const Fi
*/
std
::
vector
<
uint8_t
>
readFileFromArchive
(
const
std
::
string
&
path
,
const
std
::
string
&
fileRelativePathName
);
#endif //ENABLE_PLUGIN
}
}
// namespace jami
src/plugin/jamipluginmanager.cpp
View file @
60926a66
...
...
@@ -265,6 +265,7 @@ int JamiPluginManager::uninstallPlugin(const std::string &rootPath)
bool
JamiPluginManager
::
loadPlugin
(
const
std
::
string
&
rootPath
)
{
#ifdef ENABLE_PLUGIN
try
{
bool
status
=
pm_
.
load
(
getPluginDetails
(
rootPath
).
at
(
"soPath"
));
...
...
@@ -279,10 +280,13 @@ bool JamiPluginManager::loadPlugin(const std::string &rootPath)
JAMI_ERR
()
<<
e
.
what
();
return
false
;
}
#endif
return
false
;
}
bool
JamiPluginManager
::
unloadPlugin
(
const
std
::
string
&
rootPath
)
{
#ifdef ENABLE_PLUGIN
try
{
bool
status
=
pm_
.
unload
(
getPluginDetails
(
rootPath
).
at
(
"soPath"
));
...
...
@@ -297,6 +301,8 @@ bool JamiPluginManager::unloadPlugin(const std::string &rootPath)
JAMI_ERR
()
<<
e
.
what
();
return
false
;
}
#endif
return
false
;
}
void
JamiPluginManager
::
togglePlugin
(
const
std
::
string
&
rootPath
,
bool
toggle
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment