Compare commits

...

6 Commits

Author SHA1 Message Date
e8075a412e misc: bump daemon
Change-Id: Ie3c9570dd55e442a6b1e996801e0bb1a7f92b77c
2023-09-12 11:34:20 -04:00
4d55a1430d misc: remove ubuntu 22.10 (EOL)
Change-Id: I9a7bbd77a91b885666519e726530df2ebd7097ca
2023-09-12 11:26:27 -04:00
8de099e38d MessageOptionsPopup: add option to locally delete file
This button offers an option to remove sent/downloaded files
from the device.

Change-Id: Ida1b135681243fd6055034d8a2d699d11bf040e5
GitLab: #1287
2023-09-12 10:59:23 -04:00
306c428019 misc: fix log warning
Change-Id: I943bf58612dc7e6f95fab064c3cd18afda60d9f2
2023-09-12 10:36:46 -04:00
c0a5ced044 misc: fix message bar buttons background color
Change-Id: Ie934835952180803473645bd041bbbba06f02d4f
2023-09-12 10:36:46 -04:00
9f570a3cee Plugin Queries: resolve architecture to be able to handle dynamically all platform
Change-Id: I35ea5be7dc87dcf2e15b5803f9819887c946b91a
2023-09-12 07:32:34 -04:00
21 changed files with 93 additions and 55 deletions

2
daemon

Submodule daemon updated: 85549fce49...459e58a6d2

View File

@ -166,7 +166,6 @@ DISTRIBUTIONS := \
debian_unstable \
ubuntu_20.04 \
ubuntu_22.04 \
ubuntu_22.10 \
ubuntu_23.04 \
fedora_37 \
fedora_38 \

View File

@ -1,22 +0,0 @@
FROM ubuntu:22.10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
python-is-python3 \
wget
ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh qt-deps
COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
RUN /opt/prebuild-package-debian.sh jami-deps
ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD ["/opt/build-package-debian.sh"]

View File

@ -99,8 +99,6 @@ if [ -f /etc/os-release ]; then
ENDTAG="ubuntu_20.04"
elif [ "${UBUNTU_CODENAME}" = "jammy" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_22.04" ]; then
ENDTAG="ubuntu_22.04"
elif [ "${UBUNTU_CODENAME}" = "kinetic" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_22.10" ]; then
ENDTAG="ubuntu_22.10"
elif [ "${UBUNTU_CODENAME}" = "lunar" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_23.04" ]; then
ENDTAG="ubuntu_23.04"
elif [ "${ID}" = "debian" ] && \

View File

@ -228,6 +228,18 @@ Popup {
}
}
MessageOptionButton {
visible: type === Interaction.Type.DATA_TRANSFER && Status === Interaction.Status.TRANSFER_FINISHED
textButton: JamiStrings.removeLocally
iconSource: JamiResources.trash_black_24dp_svg
Layout.fillWidth: true
Layout.margins: 5
onClicked: {
MessagesAdapter.removeFile(msgId, root.location)
close()
}
}
MessageOptionButton {
id: buttonEdit

View File

@ -496,6 +496,7 @@ Item {
// Context Menu
property string saveFile: qsTr("Save file")
property string openLocation: qsTr("Open location")
property string removeLocally: qsTr("Delete file from device")
// Updates
property string betaInstall: qsTr("Install beta version")

View File

@ -57,6 +57,7 @@ RowLayout {
Layout.preferredHeight: parent.height
Layout.preferredWidth: childrenRect.width
visible: !CurrentConversation.isSip
color: JamiTheme.transparentColor
ComboBox {
id: showMoreButton
width: JamiTheme.chatViewFooterButtonSize
@ -1174,6 +1175,7 @@ RowLayout {
Layout.preferredHeight: parent.height
Layout.preferredWidth: childrenRect.width
visible: sendButtonVisibility
color: JamiTheme.transparentColor
PushButton {
id: sendMessageButton

View File

@ -239,7 +239,7 @@ ListSelectionView {
Connections {
target: CurrentAccount
onIdChanged: {
function onIdChanged() {
//Making sure the tips are refreshed when changing user
loader_tipsRow.active = false;
loader_tipsRow.active = Qt.binding(function () {

View File

@ -299,6 +299,13 @@ MessagesAdapter::openDirectory(const QString& path)
}
}
void
MessagesAdapter::removeFile(const QString& interactionId, const QString& path)
{
auto convUid = lrcInstance_->get_selectedConvUid();
lrcInstance_->getCurrentConversationModel()->removeFile(convUid, interactionId, path);
}
void
MessagesAdapter::acceptFile(const QString& interactionId)
{

View File

@ -111,6 +111,7 @@ protected:
Q_INVOKABLE void cancelFile(const QString& arg);
Q_INVOKABLE void openUrl(const QString& url);
Q_INVOKABLE void openDirectory(const QString& arg);
Q_INVOKABLE void removeFile(const QString& interactionId, const QString& path);
Q_INVOKABLE void deleteInteraction(const QString& interactionId);
Q_INVOKABLE void joinCall(const QString& uri,
const QString& deviceId,

View File

@ -90,7 +90,8 @@ PluginAdapter::getPluginsFromStore()
Q_EMIT storeNotAvailable();
});
pluginVersionManager_
->sendGetRequest(QUrl(baseUrl_ + "?arch=" + Utils::getPlatformString()),
->sendGetRequest(QUrl(baseUrl_
+ "?arch=" + lrcInstance_->pluginModel().getPlatformInfo()["os"]),
[this, errorHandler](const QByteArray& data) {
auto result = QJsonDocument::fromJson(data).array();
auto pluginsInstalled = lrcInstance_->pluginModel().getPluginsId();
@ -112,18 +113,19 @@ PluginAdapter::getPluginsFromStore()
void
PluginAdapter::getPluginDetails(const QString& pluginId)
{
pluginVersionManager_->sendGetRequest(QUrl(baseUrl_ + "/details/" + pluginId
+ "?arch=" + Utils::getPlatformString()),
[this](const QByteArray& data) {
auto result = QJsonDocument::fromJson(data).object();
// my response is a json object and I want to convert
// it to a QVariantMap
auto plugin = result.toVariantMap();
if (!plugin.contains("id")) {
plugin["id"] = plugin["name"];
}
pluginStoreListModel_->addPlugin(plugin);
});
pluginVersionManager_
->sendGetRequest(QUrl(baseUrl_ + "/details/" + pluginId
+ "?arch=" + lrcInstance_->pluginModel().getPlatformInfo()["os"]),
[this](const QByteArray& data) {
auto result = QJsonDocument::fromJson(data).object();
// my response is a json object and I want to convert
// it to a QVariantMap
auto plugin = result.toVariantMap();
if (!plugin.contains("id")) {
plugin["id"] = plugin["name"];
}
pluginStoreListModel_->addPlugin(plugin);
});
}
void
@ -204,11 +206,13 @@ PluginAdapter::baseUrl() const
QString
PluginAdapter::getIconUrl(const QString& pluginId) const
{
return baseUrl_ + "/icons/" + pluginId + "?arch=" + Utils::getPlatformString();
return baseUrl_ + "/icons/" + pluginId
+ "?arch=" + lrcInstance_->pluginModel().getPlatformInfo()["os"];
}
QString
PluginAdapter::getBackgroundImageUrl(const QString& pluginId) const
{
return baseUrl_ + "/backgrounds/" + pluginId + "?arch=" + Utils::getPlatformString();
return baseUrl_ + "/backgrounds/" + pluginId
+ "?arch=" + lrcInstance_->pluginModel().getPlatformInfo()["os"];
}

View File

@ -103,8 +103,8 @@ public:
return;
}
parent_.sendGetRequest(QUrl(parent_.baseUrl + "/versions/" + plugin.id
+ "?arch=" + Utils::getPlatformString()),
parent_.sendGetRequest(QUrl(parent_.baseUrl + "/versions/" + plugin.id + "?arch="
+ lrcInstance_->pluginModel().getPlatformInfo()["os"]),
[this, plugin](const QByteArray& data) {
// `data` represents the version in this case.
if (plugin.version < data) {
@ -121,7 +121,8 @@ public:
void installRemotePlugin(const QString& pluginId)
{
parent_.downloadFile(
QUrl(parent_.baseUrl + "/download/" + Utils::getPlatformString() + "/" + pluginId),
QUrl(parent_.baseUrl + "/download/"
+ lrcInstance_->pluginModel().getPlatformInfo()["os"] + "/" + pluginId),
pluginId,
0,
[this, pluginId](bool success, const QString& error) {

View File

@ -931,9 +931,3 @@ Utils::generateUid()
{
return QUuid::createUuid().toString(QUuid::Id128);
}
QString
Utils::getPlatformString()
{
return "desktop";
}

View File

@ -126,6 +126,4 @@ QString generateUid();
// Misc
QString humanFileSize(qint64 fileSize);
QString getDebugFilePath();
QString getPlatformString();
} // namespace Utils

View File

@ -306,6 +306,9 @@ public:
void getTransferInfo(const QString& conversationId,
const QString& interactionId,
api::datatransfer::Info& info) const;
void removeFile(const QString& conversationId,
const QString& interactionId,
const QString& path);
/**
* Starts a search of all medias in a conversation

View File

@ -102,6 +102,7 @@ public:
*/
QString getPluginPath(const QString& pluginId);
MapStringString getPlatformInfo();
/**
* @brief fetch all plugins path and id
*

View File

@ -3384,8 +3384,7 @@ ConversationModelPimpl::slotNewCall(const QString& fromId, const QString& callId
// in case if we receive call after removing contact add conversation request;
try {
auto contact = linked.owner.contactModel->getContact(fromId);
if (!isOutgoing && !contact.isBanned
&& fromId != linked.owner.profileInfo.uri) {
if (!isOutgoing && !contact.isBanned && fromId != linked.owner.profileInfo.uri) {
addContactRequest(fromId);
}
if (isOutgoing && contact.profileInfo.type == profile::Type::TEMPORARY) {
@ -4049,6 +4048,26 @@ ConversationModel::getTransferInfo(const QString& conversationId,
}
}
void
ConversationModel::removeFile(const QString& conversationId,
const QString& interactionId,
const QString& path)
{
auto convOpt = getConversationForUid(conversationId);
if (!convOpt)
return;
QFile::remove(path);
std::lock_guard<std::mutex> lk(pimpl_->interactionsLocks[convOpt->get().uid]);
auto& interactions = convOpt->get().interactions;
auto it = interactions->find(interactionId);
if (it != interactions->end()) {
it->second.status = interaction::Status::TRANSFER_AWAITING_HOST;
interactions->emitDataChanged(it, {MessageList::Role::Status});
}
}
int
ConversationModel::getNumberOfUnreadMessagesFor(const QString& convUid)
{

View File

@ -109,6 +109,12 @@ PluginModel::getPluginDetails(const QString& path)
return result;
}
MapStringString
PluginModel::getPlatformInfo()
{
return PluginManager::instance().getPlatformInfo();
}
bool
PluginModel::installPlugin(const QString& jplPath, bool force)
{

View File

@ -60,6 +60,12 @@ PluginManagerInterface::uninstallPlugin(const QString& pluginRootPath)
return libjami::uninstallPlugin(pluginRootPath.toStdString());
}
MapStringString
PluginManagerInterface::getPlatformInfo()
{
return convertMap(libjami::getPlatformInfo());
}
QStringList
PluginManagerInterface::getCallMediaHandlers()
{

View File

@ -61,6 +61,12 @@ PluginManagerInterface::uninstallPlugin(const QString& pluginRootPath)
return 0;
}
MapStringString
PluginManagerInterface::getPlatformInfo()
{
return {};
}
QStringList
PluginManagerInterface::getCallMediaHandlers()
{

View File

@ -58,6 +58,8 @@ public Q_SLOTS: // METHODS
int uninstallPlugin(const QString& pluginRootPath);
MapStringString getPlatformInfo();
QStringList getCallMediaHandlers();
void toggleCallMediaHandler(const QString& mediaHandlerId, const QString& callId, bool toggle);