Commit 0e50a6b5 authored by Danmei Chen's avatar Danmei Chen

add sips and sips-linphone in uri handler

parent 3af9220a
......@@ -7,7 +7,7 @@ Exec=linphone %u
Icon=linphone
Terminal=false
Categories=Network;Telephony;
MimeType=x-scheme-handler/sip-linphone;x-scheme-handler/sip;
MimeType=x-scheme-handler/sip-linphone;x-scheme-handler/sip;x-scheme-handler/sips-linphone;x-scheme-handler/sips;
# Translations
......
......@@ -41,6 +41,8 @@
<array>
<string>sip</string>
<string>sip-linphone</string>
<string>sips</string>
<string>sips-linphone</string>
</array>
</dict>
</array>
......
......@@ -7,3 +7,5 @@ notRunningInUninstall:
DeleteRegKey HKCR "sip"
DeleteRegKey HKCR "sip-linphone"
DeleteRegKey HKCR "sips"
DeleteRegKey HKCR "sips-linphone"
......@@ -10,4 +10,18 @@ WriteRegStr HKCR "sip-linphone" "URL Protocol" ""
WriteRegExpandStr HKCR "sip-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sip-linphone\shell" "" "open"
WriteRegStr HKCR "sip-linphone\shell\open" "" "command"
WriteRegStr HKCR "sip-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
\ No newline at end of file
WriteRegStr HKCR "sip-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sips" "" "URL:sips Protocol"
WriteRegStr HKCR "sips" "URL Protocol" ""
WriteRegExpandStr HKCR "sips\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sips\shell" "" "open"
WriteRegStr HKCR "sips\shell\open" "" "command"
WriteRegStr HKCR "sips\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
WriteRegStr HKCR "sips-linphone" "" "URL:sips-linphone Protocol"
WriteRegStr HKCR "sips-linphone" "URL Protocol" ""
WriteRegExpandStr HKCR "sips-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/assets/linphone.ico,1"
WriteRegStr HKCR "sips-linphone\shell" "" "open"
WriteRegStr HKCR "sips-linphone\shell\open" "" "command"
WriteRegStr HKCR "sips-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\""
\ No newline at end of file
......@@ -334,8 +334,8 @@ QMap<QString, Cli::Command> Cli::mCommands = {
void Cli::executeCommand (const QString &command, CommandFormat *format) {
shared_ptr<linphone::Address> address = linphone::Factory::get()->createAddress(
::Utils::appStringToCoreString(command)
);
::Utils::appStringToCoreString(command)
);
// Execute cli command.
if (!address) {
......@@ -358,11 +358,14 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) {
qInfo() << QStringLiteral("Execute uri command: `%1`.").arg(command);
string scheme = address->getScheme();
if (scheme != "sip" && scheme != "sip-linphone") {
qWarning() << QStringLiteral("Not a valid uri: `%1`.").arg(command);
return;
}
for (const string &validScheme : { "sip", "sip-linphone", "sips", "sips-linphone" })
if (scheme == validScheme)
goto success;
qWarning() << QStringLiteral("Not a valid uri: `%1` Unsupported scheme: `%2`.")
.arg(command).arg(::Utils::coreStringToAppString(scheme));
return;
success:
const QString functionName = ::Utils::coreStringToAppString(address->getHeader("method")).isEmpty()
? QStringLiteral("call")
: ::Utils::coreStringToAppString(address->getHeader("method"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment