mirror of https://github.com/procxx/kepka.git
				
				
				
			Add dummy handler for addtheme links.
This commit is contained in:
		
							parent
							
								
									ee210ea701
								
							
						
					
					
						commit
						1c313da888
					
				|  | @ -410,6 +410,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL | |||
| "lng_theme_reverting#other" = "Reverting to the old theme in {count} seconds."; | ||||
| "lng_theme_keep_changes" = "Keep changes"; | ||||
| "lng_theme_revert" = "Revert"; | ||||
| "lng_theme_no_desktop_version" = "Sorry, this theme doesn't include a version for Telegram Desktop.\n\n(Also, Telegram Desktop doesn't support cloud themes yet.)"; | ||||
| "lng_background_header" = "Background preview"; | ||||
| "lng_background_text1" = "Ah, you kids today with techno music! You should enjoy the classics, like Hasselhoff!"; | ||||
| "lng_background_text2" = "I can't even take you seriously right now."; | ||||
|  |  | |||
|  | @ -78,6 +78,18 @@ bool ShowStickerSet( | |||
| 	return true; | ||||
| } | ||||
| 
 | ||||
| bool ShowTheme( | ||||
| 		Main::Session *session, | ||||
| 		const Match &match, | ||||
| 		const QVariant &context) { | ||||
| 	if (!session) { | ||||
| 		return false; | ||||
| 	} | ||||
| 	Core::App().hideMediaView(); | ||||
| 	Ui::show(Box<InformBox>(tr::lng_theme_no_desktop_version(tr::now))); | ||||
| 	return true; | ||||
| } | ||||
| 
 | ||||
| bool SetLanguage( | ||||
| 		Main::Session *session, | ||||
| 		const Match &match, | ||||
|  | @ -353,6 +365,10 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() { | |||
| 			qsl("^addstickers/?\\?set=([a-zA-Z0-9\\.\\_]+)(&|$)"), | ||||
| 			ShowStickerSet | ||||
| 		}, | ||||
| 		{ | ||||
| 			qsl("^addtheme/?\\?slug=([a-zA-Z0-9\\.\\_]+)(&|$)"), | ||||
| 			ShowTheme | ||||
| 		}, | ||||
| 		{ | ||||
| 			qsl("^setlanguage/?\\?lang=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"), | ||||
| 			SetLanguage | ||||
|  | @ -415,6 +431,8 @@ QString TryConvertUrlToLocal(QString url) { | |||
| 			return qsl("tg://join?invite=") + url_encode(joinChatMatch->captured(1)); | ||||
| 		} else if (auto stickerSetMatch = regex_match(qsl("^addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), query, matchOptions)) { | ||||
| 			return qsl("tg://addstickers?set=") + url_encode(stickerSetMatch->captured(1)); | ||||
| 		} else if (auto themeMatch = regex_match(qsl("^addtheme/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), query, matchOptions)) { | ||||
| 			return qsl("tg://addtheme?slug=") + url_encode(themeMatch->captured(1)); | ||||
| 		} else if (auto languageMatch = regex_match(qsl("^setlanguage/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), query, matchOptions)) { | ||||
| 			return qsl("tg://setlanguage?lang=") + url_encode(languageMatch->captured(1)); | ||||
| 		} else if (auto shareUrlMatch = regex_match(qsl("^share/url/?\\?(.+)$"), query, matchOptions)) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue