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 ...@@ -7,7 +7,7 @@ Exec=linphone %u
Icon=linphone Icon=linphone
Terminal=false Terminal=false
Categories=Network;Telephony; 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 # Translations
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
<array> <array>
<string>sip</string> <string>sip</string>
<string>sip-linphone</string> <string>sip-linphone</string>
<string>sips</string>
<string>sips-linphone</string>
</array> </array>
</dict> </dict>
</array> </array>
......
...@@ -7,3 +7,5 @@ notRunningInUninstall: ...@@ -7,3 +7,5 @@ notRunningInUninstall:
DeleteRegKey HKCR "sip" DeleteRegKey HKCR "sip"
DeleteRegKey HKCR "sip-linphone" DeleteRegKey HKCR "sip-linphone"
DeleteRegKey HKCR "sips"
DeleteRegKey HKCR "sips-linphone"
...@@ -11,3 +11,17 @@ WriteRegExpandStr HKCR "sip-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/ass ...@@ -11,3 +11,17 @@ WriteRegExpandStr HKCR "sip-linphone\DefaultIcon" "" "@LINPHONE_DESKTOP_DIR@/ass
WriteRegStr HKCR "sip-linphone\shell" "" "open" WriteRegStr HKCR "sip-linphone\shell" "" "open"
WriteRegStr HKCR "sip-linphone\shell\open" "" "command" WriteRegStr HKCR "sip-linphone\shell\open" "" "command"
WriteRegStr HKCR "sip-linphone\shell\open\command" "" "$INSTDIR\bin\linphone.exe $\"%1$\"" 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
...@@ -358,11 +358,14 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) { ...@@ -358,11 +358,14 @@ void Cli::executeCommand (const QString &command, CommandFormat *format) {
qInfo() << QStringLiteral("Execute uri command: `%1`.").arg(command); qInfo() << QStringLiteral("Execute uri command: `%1`.").arg(command);
string scheme = address->getScheme(); string scheme = address->getScheme();
if (scheme != "sip" && scheme != "sip-linphone") { for (const string &validScheme : { "sip", "sip-linphone", "sips", "sips-linphone" })
qWarning() << QStringLiteral("Not a valid uri: `%1`.").arg(command); if (scheme == validScheme)
goto success;
qWarning() << QStringLiteral("Not a valid uri: `%1` Unsupported scheme: `%2`.")
.arg(command).arg(::Utils::coreStringToAppString(scheme));
return; return;
}
success:
const QString functionName = ::Utils::coreStringToAppString(address->getHeader("method")).isEmpty() const QString functionName = ::Utils::coreStringToAppString(address->getHeader("method")).isEmpty()
? QStringLiteral("call") ? QStringLiteral("call")
: ::Utils::coreStringToAppString(address->getHeader("method")); : ::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