diff --git a/src/api/account.h b/src/api/account.h index 52efba902690d31dc6d31f39f8a7ac5300dc84e3..1a7924dd62b011104a5e0a764f569382cba49da1 100644 --- a/src/api/account.h +++ b/src/api/account.h @@ -42,7 +42,7 @@ namespace account { Q_NAMESPACE Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") -enum class Type { INVALID, RING, SIP }; +enum class Type { INVALID, JAMI, SIP }; Q_ENUM_NS(Type) #pragma push_macro("REGISTERED") diff --git a/src/api/profile.h b/src/api/profile.h index 551f08b9635161757312b060be1e0c9694993199..474d93aca06411ac1b6c4eb45d6dfd999e736477 100644 --- a/src/api/profile.h +++ b/src/api/profile.h @@ -29,15 +29,15 @@ namespace profile { Q_NAMESPACE Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") -enum class Type { INVALID, RING, SIP, PENDING, TEMPORARY, COUNT__ }; +enum class Type { INVALID, JAMI, SIP, PENDING, TEMPORARY, COUNT__ }; Q_ENUM_NS(Type) static inline const QString to_string(const Type& type) { switch (type) { - case Type::RING: - return "RING"; + case Type::JAMI: + return "JAMI"; case Type::SIP: return "SIP"; case Type::PENDING: @@ -58,8 +58,8 @@ to_type(const QString& type) return Type::PENDING; else if (type == "SIP") return Type::SIP; - else if (type == "RING") - return Type::RING; + else if (type == "JAMI") + return Type::JAMI; else if (type == "TEMPORARY") return Type::TEMPORARY; else diff --git a/src/authority/storagehelper.cpp b/src/authority/storagehelper.cpp index 0e7821190d4d4df9e87989d06e6577d7569d6655..8c45339756f8bbacc089c426351a8df86b5b35c9 100644 --- a/src/authority/storagehelper.cpp +++ b/src/authority/storagehelper.cpp @@ -62,7 +62,7 @@ prepareUri(const QString& uri, api::profile::Type type) case api::profile::Type::SIP: return uriObject.format(URI::Section::USER_INFO | URI::Section::HOSTNAME); break; - case api::profile::Type::RING: + case api::profile::Type::JAMI: return uriObject.format(URI::Section::USER_INFO); break; case api::profile::Type::INVALID: @@ -177,7 +177,7 @@ profileToVcard(const api::profile::Info& profileInfo, bool compressImage) vCardStr += ":"; vCardStr += profileInfo.alias; vCardStr += vCard::Delimiter::END_LINE_TOKEN; - if (profileInfo.type == profile::Type::RING) { + if (profileInfo.type == profile::Type::JAMI) { vCardStr += vCard::Property::TELEPHONE; vCardStr += vCard::Delimiter::SEPARATOR_TOKEN; vCardStr += "other:ring:"; @@ -531,8 +531,7 @@ addDataTransferToConversation(Database& db, {":type", infoFromDaemon.isOutgoing ? "DATA_TRANSFER" : "DATA_TRANSFER"}, {":status", "TRANSFER_CREATED"}, {":is_read", "0"}, - {":daemon_id", infoFromDaemon.uid} - }); + {":daemon_id", infoFromDaemon.uid}}); } void @@ -561,13 +560,15 @@ getInteractionIdByDaemonId(Database& db, const QString& daemon_id) } void -updateDataTransferInteractionForDaemonId(Database& db, const QString& daemonId, api::interaction::Info& interaction) +updateDataTransferInteractionForDaemonId(Database& db, + const QString& daemonId, + api::interaction::Info& interaction) { - auto result - = db.select("body, status", - "interactions", - "daemon_id=:daemon_id", - {{":daemon_id", daemonId}}).payloads; + auto result = db.select("body, status", + "interactions", + "daemon_id=:daemon_id", + {{":daemon_id", daemonId}}) + .payloads; if (result.size() < 2) { return; } @@ -861,7 +862,7 @@ profileToVcard(const api::profile::Info& profileInfo, const QString& accountId = vCardStr += ":"; vCardStr += profileInfo.alias; vCardStr += vCard::Delimiter::END_LINE_TOKEN; - if (profileInfo.type == profile::Type::RING) { + if (profileInfo.type == profile::Type::JAMI) { vCardStr += vCard::Property::TELEPHONE; vCardStr += ":"; vCardStr += vCard::Delimiter::SEPARATOR_TOKEN; @@ -1013,7 +1014,7 @@ migrateAccountDb(const QString& accountId, accountProfileInfo = {accountUri, accountProfile[0], accountProfile[1], - isRingAccount ? profile::Type::RING : profile::Type::SIP}; + isRingAccount ? profile::Type::JAMI : profile::Type::SIP}; } auto accountVcard = profileToVcard(accountProfileInfo, accountId); auto profileFilePath = accountLocalPath + "profile" + ".vcf"; diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index 77cc260c810b63370054c08880dc02311a01f9ce..2b2ffb1a48e0ed5c9e6f42300135550e69fb855c 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -248,7 +248,7 @@ ContactModel::addContact(contact::Info contactInfo) } if ((owner.profileInfo.type != profile.type) - and (profile.type == profile::Type::RING or profile.type == profile::Type::SIP)) { + and (profile.type == profile::Type::JAMI or profile.type == profile::Type::SIP)) { qDebug() << "ContactModel::addContact, types invalids."; return; } @@ -277,7 +277,7 @@ ContactModel::addContact(contact::Info contactInfo) return; } break; - case profile::Type::RING: + case profile::Type::JAMI: case profile::Type::SIP: break; case profile::Type::INVALID: @@ -384,14 +384,14 @@ ContactModel::searchContact(const QString& query) if (static_cast<int>(uriScheme) > 2 && owner.profileInfo.type == profile::Type::SIP) { // sip account do not care if schemeType is NONE, or UNRECOGNIZED (enum value > 2) uriScheme = URI::SchemeType::SIP; - } else if (uriScheme == URI::SchemeType::NONE && owner.profileInfo.type == profile::Type::RING) { + } else if (uriScheme == URI::SchemeType::NONE && owner.profileInfo.type == profile::Type::JAMI) { uriScheme = URI::SchemeType::RING; } if ((uriScheme == URI::SchemeType::SIP || uriScheme == URI::SchemeType::SIPS) && owner.profileInfo.type == profile::Type::SIP) { pimpl_->searchSipContact(uri); - } else if (uriScheme == URI::SchemeType::RING && owner.profileInfo.type == profile::Type::RING) { + } else if (uriScheme == URI::SchemeType::RING && owner.profileInfo.type == profile::Type::JAMI) { pimpl_->searchContact(uri); } else { pimpl_->updateTemporaryMessage(tr("Bad URI scheme")); @@ -758,7 +758,7 @@ ContactModelPimpl::slotContactAdded(const QString& accountId, if (contact != contacts.end()) { if (contact->profileInfo.type == profile::Type::PENDING) { emit behaviorController.trustRequestTreated(linked.owner.id, contactUri); - } else if (contact->profileInfo.type == profile::Type::RING && !contact->isBanned + } else if (contact->profileInfo.type == profile::Type::JAMI && !contact->isBanned && confirmed) { // This means that the peer accepted the trust request. We don't need to re-add the // contact a second time (and this reset the presence to false). @@ -874,7 +874,7 @@ ContactModelPimpl::addToContacts(const QString& contactUri, contactInfo.isBanned = banned; // lookup address in case of RING contact - if (type == profile::Type::RING) { + if (type == profile::Type::JAMI) { ConfigurationManager::instance().lookupAddress(linked.owner.id, "", contactUri); PresenceManager::instance().subscribeBuddy(linked.owner.id, contactUri, !banned); } else { @@ -994,7 +994,7 @@ ContactModelPimpl::slotIncomingCall(const QString& fromId, if (it == contacts.end()) { // Contact not found, load profile from database. // The conversation model will create an entry and link the incomingCall. - auto type = (linked.owner.profileInfo.type == profile::Type::RING) + auto type = (linked.owner.profileInfo.type == profile::Type::JAMI) ? profile::Type::PENDING : profile::Type::SIP; addToContacts(fromId, type, displayname, false); @@ -1008,7 +1008,7 @@ ContactModelPimpl::slotIncomingCall(const QString& fromId, } } if (emitContactAdded) { - if (linked.owner.profileInfo.type == profile::Type::RING) { + if (linked.owner.profileInfo.type == profile::Type::JAMI) { emit behaviorController.newTrustRequest(linked.owner.id, fromId); } } else @@ -1123,11 +1123,11 @@ ContactModelPimpl::slotNewAccountTransfer(DataTransferId dringId, datatransfer:: && contacts.find(info.peerUri) == contacts.end()) { // Contact not found, load profile from database. // The conversation model will create an entry and link the incomingCall. - auto type = (linked.owner.profileInfo.type == profile::Type::RING) + auto type = (linked.owner.profileInfo.type == profile::Type::JAMI) ? profile::Type::PENDING : profile::Type::SIP; addToContacts(info.peerUri, type, "", false); - emitNewTrust = (linked.owner.profileInfo.type == profile::Type::RING); + emitNewTrust = (linked.owner.profileInfo.type == profile::Type::JAMI); } } if (emitNewTrust) { @@ -1156,7 +1156,7 @@ ContactModelPimpl::slotProfileReceived(const QString& accountId, profile::Info profileInfo; profileInfo.uri = peer; - profileInfo.type = profile::Type::RING; + profileInfo.type = profile::Type::JAMI; for (auto& e : QString(vCard).split("\n")) if (e.contains("PHOTO")) diff --git a/src/conversationmodel.cpp b/src/conversationmodel.cpp index c3a6ef69e1e06ac2c4e20a77cace11c1b6a38607..b9a0070da869f29e3295bdf204d69fa356655f9d 100644 --- a/src/conversationmodel.cpp +++ b/src/conversationmodel.cpp @@ -582,7 +582,7 @@ ConversationModel::getFilteredConversations(const FilterType& filter, switch (pimpl_->customTypeFilter) { case FilterType::JAMI: // we have conversation with many participants only for JAMI - return (owner.profileInfo.type == profile::Type::RING && !entry.isRequest); + return (owner.profileInfo.type == profile::Type::JAMI && !entry.isRequest); case FilterType::SIP: return (owner.profileInfo.type == profile::Type::SIP && !entry.isRequest); case FilterType::REQUEST: @@ -2324,7 +2324,7 @@ ConversationModelPimpl::slotConversationRemoved(const QString& accountId, // remove swarm conversation conversations.erase(conversations.begin() + conversationIndex); auto contact = linked.owner.contactModel->getContact(contactId); - if (contact.profileInfo.type != api::profile::Type::RING) { + if (contact.profileInfo.type != api::profile::Type::JAMI) { emit linked.conversationRemoved(conversationId); return; } diff --git a/src/newaccountmodel.cpp b/src/newaccountmodel.cpp index 66b759de3d8c34d8019592b70efdb59f715d76f6..456528722298487f2106f33962d1875104c44e98 100644 --- a/src/newaccountmodel.cpp +++ b/src/newaccountmodel.cpp @@ -235,10 +235,10 @@ NewAccountModel::setAccountConfig(const QString& accountId, details[ConfProperties::ENABLED] = accountInfo.enabled ? QString("true") : QString("false"); details[ConfProperties::ALIAS] = accountInfo.profileInfo.alias; details[ConfProperties::DISPLAYNAME] = accountInfo.profileInfo.alias; - details[ConfProperties::TYPE] = (accountInfo.profileInfo.type == profile::Type::RING) + details[ConfProperties::TYPE] = (accountInfo.profileInfo.type == profile::Type::JAMI) ? QString(ProtocolNames::RING) : QString(ProtocolNames::SIP); - if (accountInfo.profileInfo.type == profile::Type::RING) { + if (accountInfo.profileInfo.type == profile::Type::JAMI) { details[ConfProperties::USERNAME] = accountInfo.profileInfo.uri; } else if (accountInfo.profileInfo.type == profile::Type::SIP) { VectorMapStringString finalCred; @@ -790,9 +790,9 @@ account::Info::fromDetails(const MapStringString& details) // General if (details[ConfProperties::TYPE] != "") profileInfo.type = details[ConfProperties::TYPE] == QString(ProtocolNames::RING) - ? profile::Type::RING + ? profile::Type::JAMI : profile::Type::SIP; - registeredName = profileInfo.type == profile::Type::RING + registeredName = profileInfo.type == profile::Type::JAMI ? volatileDetails[VolatileProperties::REGISTERED_NAME] : ""; profileInfo.alias = details[ConfProperties::DISPLAYNAME]; @@ -803,7 +803,7 @@ account::Info::fromDetails(const MapStringString& details) confProperties.isRendezVous = toBool(details[ConfProperties::ISRENDEZVOUS]); confProperties.activeCallLimit = toInt(details[ConfProperties::ACTIVE_CALL_LIMIT]); confProperties.hostname = details[ConfProperties::HOSTNAME]; - profileInfo.uri = (profileInfo.type == profile::Type::RING + profileInfo.uri = (profileInfo.type == profile::Type::JAMI and details[ConfProperties::USERNAME].contains("ring:")) ? QString(details[ConfProperties::USERNAME]).remove(QString("ring:")) : details[ConfProperties::USERNAME]; diff --git a/src/newcallmodel.cpp b/src/newcallmodel.cpp index 9cfe49d3d7cfaa49999eed4ff8650540cd4611da..f8748d01da34e0c81c57e377de9d1070c1a8533f 100644 --- a/src/newcallmodel.cpp +++ b/src/newcallmodel.cpp @@ -744,7 +744,7 @@ NewCallModelPimpl::initCallFromDaemon() callInfo->status = call::to_status(details["CALL_STATE"]); auto endId = details["PEER_NUMBER"].indexOf("@"); callInfo->peerUri = details["PEER_NUMBER"].left(endId); - if (linked.owner.profileInfo.type == lrc::api::profile::Type::RING) { + if (linked.owner.profileInfo.type == lrc::api::profile::Type::JAMI) { callInfo->peerUri = "ring:" + callInfo->peerUri; } callInfo->videoMuted = details["VIDEO_MUTED"] == "true"; @@ -1001,7 +1001,7 @@ NewCallModelPimpl::slotIncomingCallWithMedia(const QString& accountId, calls.emplace(callId, std::move(callInfo)); if (!linked.owner.confProperties.allowIncoming - && linked.owner.profileInfo.type == profile::Type::RING) { + && linked.owner.profileInfo.type == profile::Type::JAMI) { linked.refuse(callId); return; } @@ -1167,7 +1167,7 @@ NewCallModelPimpl::slotincomingVCardChunk( [](const auto& s) { return s.isEmpty(); })) { profile::Info profileInfo; profileInfo.uri = from; - profileInfo.type = profile::Type::RING; + profileInfo.type = profile::Type::JAMI; QString vcardPhoto;