From bd26a352fd5ceb1675fd34fddd838a5dc96d1c04 Mon Sep 17 00:00:00 2001 From: Mathi Fonseca Date: Fri, 26 Feb 2016 17:51:59 -0300 Subject: [PATCH 1/8] fixed ellipses dots. should be 3, not 2 --- Telegram/Resources/lang.strings | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 387bdd0d7..678298a39 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -86,8 +86,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cancel" = "Cancel"; "lng_continue" = "Continue"; "lng_close" = "Close"; -"lng_connecting" = "Connecting.."; -"lng_reconnecting" = "Reconnect {count:now|in # s|in # s}.."; +"lng_connecting" = "Connecting..."; +"lng_reconnecting" = "Reconnect {count:now|in # s|in # s}..."; "lng_reconnecting_try_now" = "Try now"; "lng_status_service_notifications" = "service notifications"; @@ -108,7 +108,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_status_lastseen_date" = "last seen {date}"; "lng_status_lastseen_date_time" = "last seen {date} at {time}"; "lng_status_online" = "online"; -"lng_status_connecting" = "connecting.."; +"lng_status_connecting" = "connecting..."; "lng_chat_status_unaccessible" = "group is unaccessible"; "lng_chat_status_members" = "{count:no members|# member|# members}"; @@ -127,7 +127,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_edit_deleted" = "This message was deleted"; "lng_edit_too_long" = "Your message text is too long"; "lng_edit_message" = "Edit message"; -"lng_edit_message_text" = "New message text.."; +"lng_edit_message_text" = "New message text..."; "lng_deleted" = "Unknown"; "lng_deleted_message" = "Deleted message"; @@ -156,7 +156,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_code_telegram" = "Please enter the code you've just\nreceived in your previous [b]Telegram[/b] app."; "lng_code_no_telegram" = "Send code via SMS"; "lng_code_call" = "Telegram will dial your number in {minutes}:{seconds}"; -"lng_code_calling" = "Requesting a call from Telegram.."; +"lng_code_calling" = "Requesting a call from Telegram..."; "lng_code_called" = "Telegram dialed your number"; "lng_bad_phone" = "Invalid phone number. Please try again."; @@ -195,7 +195,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_dlg_new_channel_name" = "Channel name"; "lng_no_contacts" = "You have no contacts"; "lng_no_chats" = "Your chats will be here"; -"lng_contacts_loading" = "Loading.."; +"lng_contacts_loading" = "Loading..."; "lng_contacts_not_found" = "No contacts found"; "lng_dlg_search_chat" = "Search in this chat"; "lng_dlg_search_channel" = "Search in this channel"; @@ -204,7 +204,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_save" = "Save"; "lng_settings_upload" = "Set Profile Photo"; "lng_settings_crop_profile" = "Select a square area for your profile photo"; -"lng_settings_uploading_photo" = "Uploading photo.."; +"lng_settings_uploading_photo" = "Uploading photo..."; "lng_username_title" = "Username"; "lng_username_about" = "You can choose a username on Telegram.\nIf you do, other people will be able to find\nyou by this username and contact you\nwithout knowing your phone number.\n\nYou can use a-z, 0-9 and underscores.\nMinimum length is 5 characters."; @@ -241,9 +241,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_auto_update" = "Update automatically"; "lng_settings_current_version" = "Version {version}"; "lng_settings_check_now" = "Check for updates"; -"lng_settings_update_checking" = "Checking for updates.."; +"lng_settings_update_checking" = "Checking for updates..."; "lng_settings_latest_installed" = "Latest version is installed"; -"lng_settings_downloading" = "Downloading update {ready} / {total} MB.."; +"lng_settings_downloading" = "Downloading update {ready} / {total} MB..."; "lng_settings_update_ready" = "New version is ready"; "lng_settings_update_now" = "Restart Now"; "lng_settings_update_fail" = "Update check failed :("; @@ -285,7 +285,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_download_path_failed" = "File download could not be started. It could happen because of a bad download location.\n\nYou can change download path in Settings."; "lng_download_path_settings" = "Settings"; "lng_download_finish_failed" = "File download could not be finished.\n\nWould you like to try again?"; -"lng_download_path_clearing" = "Clearing.."; +"lng_download_path_clearing" = "Clearing..."; "lng_download_path_cleared" = "Cleared!"; "lng_download_path_clear_failed" = "Clear failed :("; @@ -294,7 +294,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_settings_images_cached" = "{count:_not_used_|# image|# images}, {size}"; "lng_settings_audios_cached" = "{count:_not_used_|# voice message|# voice messages}, {size}"; "lng_local_storage_clear" = "Clear all"; -"lng_local_storage_clearing" = "Clearing.."; +"lng_local_storage_clearing" = "Clearing..."; "lng_local_storage_cleared" = "Cleared!"; "lng_local_storage_clear_failed" = "Clear failed :("; @@ -325,7 +325,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_passcode_logout" = "Log out"; "lng_passcode_need_unblock" = "You need to unlock me first."; -"lng_cloud_password_waiting" = "Confirmation link sent to {email}.."; +"lng_cloud_password_waiting" = "Confirmation link sent to {email}..."; "lng_cloud_password_change" = "Change cloud password"; "lng_cloud_password_create" = "Cloud password"; "lng_cloud_password_remove" = "Remove cloud password"; @@ -352,9 +352,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cloud_password_is_same" = "Password was not changed"; "lng_connection_type" = "Connection type:"; -"lng_connection_auto_connecting" = "Default (connecting..)"; +"lng_connection_auto_connecting" = "Default (connecting...)"; "lng_connection_auto" = "Default ({transport} used)"; -"lng_connection_proxy_connecting" = "Connecting through proxy.."; +"lng_connection_proxy_connecting" = "Connecting through proxy..."; "lng_connection_proxy" = "{transport} with proxy"; "lng_connection_header" = "Connection type"; "lng_connection_auto_rb" = "Auto (TCP if available or HTTP)"; @@ -390,7 +390,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_sessions_other_desc" = "You can log in to Telegram from other mobile, tablet and desktop devices, using the same phone number. All your data will be instantly synchronized."; "lng_sessions_terminate_all" = "Terminate all other sessions"; -"lng_preview_loading" = "Getting Link Info.."; +"lng_preview_loading" = "Getting Link Info..."; "lng_profile_chat_unaccessible" = "Group is unaccessible"; "lng_topbar_info" = "Info"; @@ -432,7 +432,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_sure_kick" = "Remove {user} from the group?"; "lng_profile_sure_kick_channel" = "Remove {user} from the channel?"; "lng_profile_sure_kick_admin" = "Remove {user} from administrators?"; -"lng_profile_loading" = "Loading.."; +"lng_profile_loading" = "Loading..."; "lng_profile_shared_media" = "Shared media"; "lng_profile_no_media" = "No media in this conversation."; "lng_profile_photos" = "{count:_not_used_|# photo|# photos} »"; @@ -627,7 +627,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_stickers_remove" = "Delete"; "lng_stickers_return" = "Undo"; "lng_stickers_restore" = "Restore"; -"lng_stickers_count" = "{count:Loading..|# sticker|# stickers}"; +"lng_stickers_count" = "{count:Loading...|# sticker|# stickers}"; "lng_in_dlg_photo" = "Photo"; "lng_in_dlg_video" = "Video"; @@ -652,10 +652,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; "lng_send_button" = "Send"; -"lng_message_ph" = "Write a message.."; -"lng_comment_ph" = "Write a comment.."; -"lng_broadcast_ph" = "Broadcast a message.."; -"lng_broadcast_silent_ph" = "Silent broadcast.."; +"lng_message_ph" = "Write a message..."; +"lng_comment_ph" = "Write a comment..."; +"lng_broadcast_ph" = "Broadcast a message..."; +"lng_broadcast_silent_ph" = "Silent broadcast..."; "lng_record_cancel" = "Release outside this field to cancel"; "lng_will_be_notified" = "Members will be notified when you post"; "lng_wont_be_notified" = "Members will not be notified when you post"; @@ -721,7 +721,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_copy_email" = "Copy email address"; "lng_context_copy_hashtag" = "Copy hashtag"; "lng_context_copy_mention" = "Copy username"; -"lng_context_save_image" = "Save Image As.."; +"lng_context_save_image" = "Save Image As..."; "lng_context_forward_image" = "Forward Image"; "lng_context_delete_image" = "Delete Image"; "lng_context_copy_image" = "Copy Image"; @@ -729,11 +729,11 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_context_cancel_download" = "Cancel Download"; "lng_context_show_in_folder" = "Show in Folder"; "lng_context_show_in_finder" = "Show in Finder"; -"lng_context_save_video" = "Save Video As.."; -"lng_context_save_audio" = "Save Audio As.."; +"lng_context_save_video" = "Save Video As..."; +"lng_context_save_audio" = "Save Audio As..."; "lng_context_pack_info" = "Pack Info"; "lng_context_pack_add" = "Add Stickers"; -"lng_context_save_file" = "Save File As.."; +"lng_context_save_file" = "Save File As..."; "lng_context_forward_file" = "Forward File"; "lng_context_delete_file" = "Delete File"; "lng_context_close_file" = "Close File"; @@ -758,7 +758,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_send_image_too_large" = "Could not send a file, because it is larger than 1.5 GB :("; "lng_send_folder" = "Could not send «{name}» because it is a directory :("; -"lng_forward_choose" = "Choose recipient.."; +"lng_forward_choose" = "Choose recipient..."; "lng_forward_cant" = "Sorry, no way to forward here :("; "lng_forward_confirm" = "Forward to {recipient}?"; "lng_forward_share_contact" = "Share contact to {recipient}?"; @@ -821,7 +821,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_search_global_results" = "Global search results"; "lng_media_save_progress" = "{ready} of {total} {mb}"; -"lng_mediaview_save_as" = "Save As.."; +"lng_mediaview_save_as" = "Save As..."; "lng_mediaview_copy" = "Copy"; "lng_mediaview_forward" = "Forward"; "lng_mediaview_delete" = "Delete"; From abaf74a886777032f33300443366290788e1a0e3 Mon Sep 17 00:00:00 2001 From: Mathi Fonseca Date: Fri, 26 Feb 2016 17:53:08 -0300 Subject: [PATCH 2/8] improved grammar in english lang --- Telegram/Resources/lang.strings | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 678298a39..98830ecb3 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -684,21 +684,21 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_users_typing" = "{user} and {second_user} are typing"; "lng_many_typing" = "{count:_not_used_|# is|# are} typing"; "lng_send_action_record_video" = "recording video"; -"lng_user_action_record_video" = "{user} is recording video"; +"lng_user_action_record_video" = "{user} is recording a video"; "lng_send_action_upload_video" = "sending video"; -"lng_user_action_upload_video" = "{user} is sending video"; +"lng_user_action_upload_video" = "{user} is sending a video"; "lng_send_action_record_audio" = "recording audio"; -"lng_user_action_record_audio" = "{user} is recording audio"; +"lng_user_action_record_audio" = "{user} is recording an audio"; "lng_send_action_upload_audio" = "sending audio"; -"lng_user_action_upload_audio" = "{user} is sending audio"; +"lng_user_action_upload_audio" = "{user} is sending an audio"; "lng_send_action_upload_photo" = "sending photo"; -"lng_user_action_upload_photo" = "{user} is sending photo"; +"lng_user_action_upload_photo" = "{user} is sending a photo"; "lng_send_action_upload_file" = "sending file"; -"lng_user_action_upload_file" = "{user} is sending file"; +"lng_user_action_upload_file" = "{user} is sending a file"; "lng_send_action_geo_location" = "picking location"; -"lng_user_action_geo_location" = "{user} is picking location"; +"lng_user_action_geo_location" = "{user} is picking a location"; "lng_send_action_choose_contact" = "choosing contact"; -"lng_user_action_choose_contact" = "{user} is choosing contact"; +"lng_user_action_choose_contact" = "{user} is choosing a contact"; "lng_unread_bar" = "{count:_not_used_|# unread message|# unread messages}"; "lng_maps_point" = "Location"; From 2ef06a0baacf789a0930bd8816ad3e3eacd2547e Mon Sep 17 00:00:00 2001 From: Soltan Tekeev Date: Fri, 18 Mar 2016 22:13:12 +0300 Subject: [PATCH 3/8] Add "Copy name" option (Requested in #1783) Also add lng_profile_copy_fullname to lang.strings Signed-off-by: Soltan Tekeev (github: stek29) --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/profilewidget.cpp | 10 +++++++++- Telegram/SourceFiles/profilewidget.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 9039db902..8552a51da 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -455,6 +455,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_profile_shared_links" = "{count:_not_used_|# shared link|# shared links} »"; "lng_profile_shared_links_header" = "Shared links overview"; "lng_profile_copy_phone" = "Copy phone number"; +"lng_profile_copy_fullname" = "Copy name"; "lng_channel_add_admins" = "New administrator"; "lng_channel_add_members" = "Add members"; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index c28c5fba1..b74ff6890 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1503,10 +1503,13 @@ void ProfileInner::contextMenuEvent(QContextMenuEvent *e) { _menu->deleteLater(); _menu = 0; } - if (!_phoneText.isEmpty() || (_peerUser && !_peerUser->username.isEmpty())) { + if (!_phoneText.isEmpty() || _peerUser) { QRect info(_left + st::profilePhotoSize + st::profilePhoneLeft, st::profilePadding.top(), _width - st::profilePhotoSize - st::profilePhoneLeft, st::profilePhotoSize); if (info.contains(mapFromGlobal(e->globalPos()))) { _menu = new PopupMenu(); + if (_peerUser) { + _menu->addAction(lang(lng_profile_copy_fullname), this, SLOT(onCopyFullName()))->setEnabled(true); + } if (!_phoneText.isEmpty()) { _menu->addAction(lang(lng_profile_copy_phone), this, SLOT(onCopyPhone()))->setEnabled(true); } @@ -1526,6 +1529,11 @@ void ProfileInner::onMenuDestroy(QObject *obj) { } } +void ProfileInner::onCopyFullName() { + if (!_peerUser) return; + QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName)); +} + void ProfileInner::onCopyPhone() { QApplication::clipboard()->setText(_phoneText); } diff --git a/Telegram/SourceFiles/profilewidget.h b/Telegram/SourceFiles/profilewidget.h index 23b6fcd02..0587884ff 100644 --- a/Telegram/SourceFiles/profilewidget.h +++ b/Telegram/SourceFiles/profilewidget.h @@ -109,6 +109,7 @@ public slots: void onMediaLinks(); void onMenuDestroy(QObject *obj); + void onCopyFullName(); void onCopyPhone(); void onCopyUsername(); From 605f5305e445f482d328d37fda984fcc8720a1e1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 18:07:13 +0300 Subject: [PATCH 4/8] Changed all .. to ... in phrases --- README.md | 2 +- Telegram/SourceFiles/_other/genlang.cpp | 4 +- Telegram/SourceFiles/application.cpp | 32 +++++------ Telegram/SourceFiles/autoupdater.cpp | 2 +- Telegram/SourceFiles/boxes/languagebox.cpp | 2 +- Telegram/SourceFiles/gui/text.cpp | 2 +- Telegram/SourceFiles/history.cpp | 14 ++--- Telegram/SourceFiles/localstorage.cpp | 26 ++++----- Telegram/SourceFiles/main.cpp | 4 +- Telegram/SourceFiles/mtproto/auth_key.h | 4 +- Telegram/SourceFiles/mtproto/connection.cpp | 56 +++++++++---------- .../SourceFiles/mtproto/connection_tcp.cpp | 2 +- Telegram/SourceFiles/mtproto/core_types.cpp | 2 +- Telegram/SourceFiles/mtproto/facade.cpp | 4 +- Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/pspecific_linux.cpp | 4 +- Telegram/SourceFiles/pspecific_win.cpp | 8 +-- Telegram/SourceFiles/pspecific_winrt.cpp | 8 +-- Telegram/SourceFiles/types.cpp | 2 +- Telegram/SourceFiles/window.cpp | 8 +-- 20 files changed, 94 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 4f9b406f7..6229b0d78 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ The source code is published under GPLv3 with OpenSSL exception, the license is * ### MetaLang - Creates from languagepack file `Resources/lang.txt` language constants code and language file parse code: + Creates from languagepack file `Resources/lang.strings` language constants code and language file parse code: * GeneratedFiles/lang.h * GeneratedFiles/lang.cpp diff --git a/Telegram/SourceFiles/_other/genlang.cpp b/Telegram/SourceFiles/_other/genlang.cpp index 4108f7ad2..614f81de5 100644 --- a/Telegram/SourceFiles/_other/genlang.cpp +++ b/Telegram/SourceFiles/_other/genlang.cpp @@ -391,7 +391,7 @@ bool genLang(const QString &lang_in, const QString &lang_out) { th.setCodec("ISO 8859-1"); th << "\ /*\n\ -Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\ +Created from \'/Resources/lang.strings\' by \'/MetaLang\' project\n\ \n\ WARNING! All changes made in this file will be lost!\n\ \n\ @@ -475,7 +475,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org\n\ tcpp << "\ /*\n\ -Created from \'/Resources/lang.txt\' by \'/MetaLang\' project\n\ +Created from \'/Resources/lang.strings\' by \'/MetaLang\' project\n\ \n\ WARNING! All changes made in this file will be lost!\n\ \n\ diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 28530ed5f..d66874dbf 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -120,16 +120,16 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #endif if (cManyInstance()) { - LOG(("Many instance allowed, starting..")); + LOG(("Many instance allowed, starting...")); singleInstanceChecked(); } else { - LOG(("Connecting local socket to %1..").arg(_localServerName)); + LOG(("Connecting local socket to %1...").arg(_localServerName)); _localSocket.connectToServer(_localServerName); } } void Application::socketConnected() { - LOG(("Socket connected, this is not the first application instance, sending show command..")); + LOG(("Socket connected, this is not the first application instance, sending show command...")); _secondInstance = true; QString commands; @@ -154,7 +154,7 @@ void Application::socketWritten(qint64/* bytes*/) { if (_localSocket.bytesToWrite()) { return; } - LOG(("Show command written, waiting response..")); + LOG(("Show command written, waiting response...")); } void Application::socketReading() { @@ -166,7 +166,7 @@ void Application::socketReading() { if (QRegularExpression("RES:(\\d+);").match(_localSocketReadData).hasMatch()) { uint64 pid = _localSocketReadData.mid(4, _localSocketReadData.length() - 5).toULongLong(); psActivateProcess(pid); - LOG(("Show command response received, pid = %1, activating and quitting..").arg(pid)); + LOG(("Show command response received, pid = %1, activating and quitting...").arg(pid)); return App::quit(); } } @@ -175,14 +175,14 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { if (App::quitting()) return; if (_secondInstance) { - LOG(("Could not write show command, error %1, quitting..").arg(e)); + LOG(("Could not write show command, error %1, quitting...").arg(e)); return App::quit(); } if (e == QLocalSocket::ServerNotFoundError) { - LOG(("This is the only instance of Telegram, starting server and app..")); + LOG(("This is the only instance of Telegram, starting server and app...")); } else { - LOG(("Socket connect error %1, starting server and app..").arg(e)); + LOG(("Socket connect error %1, starting server and app...").arg(e)); } _localSocket.close(); @@ -196,7 +196,7 @@ void Application::socketError(QLocalSocket::LocalSocketError e) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (!cNoStartUpdate() && checkReadyUpdate()) { cSetRestartingUpdate(true); - DEBUG_LOG(("Application Info: installing update instead of starting app..")); + DEBUG_LOG(("Application Info: installing update instead of starting app...")); return App::quit(); } #endif @@ -235,7 +235,7 @@ void Application::singleInstanceChecked() { void Application::socketDisconnected() { if (_secondInstance) { - DEBUG_LOG(("Application Error: socket disconnected before command response received, quitting..")); + DEBUG_LOG(("Application Error: socket disconnected before command response received, quitting...")); return App::quit(); } } @@ -704,7 +704,7 @@ AppClass::AppClass() : QObject() anim::startManager(); historyInit(); - DEBUG_LOG(("Application Info: inited..")); + DEBUG_LOG(("Application Info: inited...")); application()->installNativeEventFilter(psNativeEventFilter()); @@ -714,7 +714,7 @@ AppClass::AppClass() : QObject() connect(&killDownloadSessionsTimer, SIGNAL(timeout()), this, SLOT(killDownloadSessions())); - DEBUG_LOG(("Application Info: starting app..")); + DEBUG_LOG(("Application Info: starting app...")); QMimeDatabase().mimeTypeForName(qsl("text/plain")); // create mime database @@ -724,7 +724,7 @@ AppClass::AppClass() : QObject() Sandbox::connect(SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(onAppStateChanged(Qt::ApplicationState))); - DEBUG_LOG(("Application Info: window created..")); + DEBUG_LOG(("Application Info: window created...")); Shortcuts::start(); @@ -734,16 +734,16 @@ AppClass::AppClass() : QObject() Local::ReadMapState state = Local::readMap(QByteArray()); if (state == Local::ReadMapPassNeeded) { cSetHasPasscode(true); - DEBUG_LOG(("Application Info: passcode nneded..")); + DEBUG_LOG(("Application Info: passcode needed...")); } else { - DEBUG_LOG(("Application Info: local map read..")); + DEBUG_LOG(("Application Info: local map read...")); MTP::start(); } MTP::setStateChangedHandler(mtpStateChanged); MTP::setSessionResetHandler(mtpSessionReset); - DEBUG_LOG(("Application Info: MTP started..")); + DEBUG_LOG(("Application Info: MTP started...")); DEBUG_LOG(("Application Info: showing.")); if (state == Local::ReadMapPassNeeded) { diff --git a/Telegram/SourceFiles/autoupdater.cpp b/Telegram/SourceFiles/autoupdater.cpp index d82574cb9..6c46f60c1 100644 --- a/Telegram/SourceFiles/autoupdater.cpp +++ b/Telegram/SourceFiles/autoupdater.cpp @@ -569,7 +569,7 @@ bool checkReadyUpdate() { } #elif defined Q_OS_MAC QDir().mkpath(QFileInfo(curUpdater).absolutePath()); - DEBUG_LOG(("Update Info: moving %1 to %2..").arg(updater.absoluteFilePath()).arg(curUpdater)); + DEBUG_LOG(("Update Info: moving %1 to %2...").arg(updater.absoluteFilePath()).arg(curUpdater)); if (!objc_moveFile(updater.absoluteFilePath(), curUpdater)) { UpdateChecker::clearAll(); return false; diff --git a/Telegram/SourceFiles/boxes/languagebox.cpp b/Telegram/SourceFiles/boxes/languagebox.cpp index 115123b91..f6e7daf2f 100644 --- a/Telegram/SourceFiles/boxes/languagebox.cpp +++ b/Telegram/SourceFiles/boxes/languagebox.cpp @@ -88,7 +88,7 @@ void LanguageBox::mousePressEvent(QMouseEvent *e) { return; } else if (!loader.warnings().isEmpty()) { QString warn = loader.warnings(); - if (warn.size() > 256) warn = warn.mid(0, 254) + qsl(".."); + if (warn.size() > 256) warn = warn.mid(0, 253) + qsl("..."); Ui::showLayer(new InformBox(qsl("Lang \"") + LanguageCodes[i] + qsl("\" warnings :(\n\nWarnings: ") + warn)); return; } diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index da7e31e60..30eab680e 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -3471,7 +3471,7 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi if (length) { style::font blockFont = font; if (!flags && lnkIndex) { - // should use textStyle lnkFlags somehow.. not supported + // should use textStyle lnkFlags somehow... not supported } if ((flags & TextBlockFPre) || (flags & TextBlockFCode)) { diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 6e9458d94..f6194d524 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -1819,7 +1819,7 @@ void History::addOlderSlice(const QVector &slice, const QVector 1) { - HistoryItem *last = block->items.back(); // .. item, item, item, last ], [ first, item, item .. + HistoryItem *last = block->items.back(); // ... item, item, item, last ], [ first, item, item ... HistoryItem *first = blocks.at(1)->items.front(); // we've added a new front block, so previous item for @@ -6946,7 +6946,7 @@ QString HistoryMessage::notificationHeader() const { QString HistoryMessage::notificationText() const { QString msg(inDialogsText()); - if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl(".."); + if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl("..."); return msg; } @@ -7513,7 +7513,7 @@ bool HistoryServiceMessage::updatePinnedText(const QString *pfrom, QString *ptex } } if (!limit && cutat + 5 < size) { - original = original.mid(0, cutat) + qstr(".."); + original = original.mid(0, cutat) + qstr("..."); } text = lng_action_pinned_message(lt_from, from, lt_text, textcmdLink(2, original)); } else { @@ -7796,7 +7796,7 @@ void HistoryServiceMessage::drawInDialog(Painter &p, const QRect &r, bool act, c QString HistoryServiceMessage::notificationText() const { QString msg = _text.original(); - if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl(".."); + if (msg.size() > 0xFF) msg = msg.mid(0, 0xFF) + qsl("..."); return msg; } @@ -7817,7 +7817,7 @@ HistoryServiceMessage::~HistoryServiceMessage() { } HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, const QDateTime &date) - : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 .. %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/) + : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, group.vcount.v)/* + qsl(" (%1 ... %2)").arg(group.vmin_id.v).arg(group.vmax_id.v)*/) , _minId(group.vmin_id.v) , _maxId(group.vmax_id.v) , _count(group.vcount.v) @@ -7825,7 +7825,7 @@ HistoryGroup::HistoryGroup(History *history, const MTPDmessageGroup &group, cons } HistoryGroup::HistoryGroup(History *history, HistoryItem *newItem, const QDateTime &date) - : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 .. %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/) + : HistoryServiceMessage(history, clientMsgId(), date, lng_channel_comments_count(lt_count, 1)/* + qsl(" (%1 ... %2)").arg(newItem->id - 1).arg(newItem->id + 1)*/) , _minId(newItem->id - 1) , _maxId(newItem->id + 1) , _count(1) @@ -7891,7 +7891,7 @@ bool HistoryGroup::decrementCount() { } void HistoryGroup::updateText() { - setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/); + setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 ... %2)").arg(_minId).arg(_maxId)*/); } HistoryCollapse::HistoryCollapse(History *history, MsgId wasMinId, const QDateTime &date) diff --git a/Telegram/SourceFiles/localstorage.cpp b/Telegram/SourceFiles/localstorage.cpp index 359b3b521..16fed59d5 100644 --- a/Telegram/SourceFiles/localstorage.cpp +++ b/Telegram/SourceFiles/localstorage.cpp @@ -1370,7 +1370,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + qsl("tdata/config")); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old config..")); + LOG(("App Info: reading old config...")); QDataStream stream(&file); stream.setVersion(QDataStream::Qt_5_1); @@ -1450,7 +1450,7 @@ namespace { QBuffer decryptedStream(&decrypted); decryptedStream.open(QIODevice::ReadOnly); decryptedStream.seek(4); // skip size - LOG(("App Info: reading encrypted old user config..")); + LOG(("App Info: reading encrypted old user config...")); _readOldUserSettingsFields(&decryptedStream, version); } else if (!_readSetting(blockId, stream, version)) { @@ -1463,7 +1463,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + cDataFile() + (cTestMode() ? qsl("_test") : QString()) + qsl("_config")); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old user config..")); + LOG(("App Info: reading old user config...")); qint32 version = 0; MTP::DcOptions dcOpts; @@ -1537,7 +1537,7 @@ namespace { QBuffer decryptedStream(&decrypted); decryptedStream.open(QIODevice::ReadOnly); decryptedStream.seek(4); // skip size - LOG(("App Info: reading encrypted old keys..")); + LOG(("App Info: reading encrypted old keys...")); _readOldMtpDataFields(&decryptedStream, version); } else if (!_readSetting(blockId, stream, version)) { @@ -1550,7 +1550,7 @@ namespace { bool result = false; QFile file(cWorkingDir() + cDataFile() + (cTestMode() ? qsl("_test") : QString())); if (file.open(QIODevice::ReadOnly)) { - LOG(("App Info: reading old keys..")); + LOG(("App Info: reading old keys...")); qint32 version = 0; MTP::DcOptions dcOpts; @@ -1647,7 +1647,7 @@ namespace { return _writeUserSettings(); } - LOG(("App Info: reading encrypted user settings..")); + LOG(("App Info: reading encrypted user settings...")); while (!userSettings.stream.atEnd()) { quint32 blockId; userSettings.stream >> blockId; @@ -1693,7 +1693,7 @@ namespace { return; } - LOG(("App Info: reading encrypted mtp data..")); + LOG(("App Info: reading encrypted mtp data...")); while (!mtp.stream.atEnd()) { quint32 blockId; mtp.stream >> blockId; @@ -1719,7 +1719,7 @@ namespace { if (!readFile(mapData, qsl("map"))) { return Local::ReadMapFailed; } - LOG(("App Info: reading map..")); + LOG(("App Info: reading map...")); QByteArray salt, keyEncrypted, mapEncrypted; mapData.stream >> salt >> keyEncrypted >> mapEncrypted; @@ -1735,7 +1735,7 @@ namespace { EncryptedDescriptor keyData, map; if (!decryptLocal(keyData, keyEncrypted, _passKey)) { - LOG(("App Info: could not decrypt pass-protected key from map file, maybe bad password..")); + LOG(("App Info: could not decrypt pass-protected key from map file, maybe bad password...")); return Local::ReadMapPassNeeded; } uchar key[LocalEncryptKeySize] = { 0 }; @@ -1752,7 +1752,7 @@ namespace { LOG(("App Error: could not decrypt map.")); return Local::ReadMapFailed; } - LOG(("App Info: reading encrypted map..")); + LOG(("App Info: reading encrypted map...")); DraftsMap draftsMap, draftCursorsMap; DraftsNotReadMap draftsNotReadMap; @@ -2101,7 +2101,7 @@ namespace Local { _readOldMtpData(false); // needed further in _readMtpData return writeSettings(); } - LOG(("App Info: reading settings..")); + LOG(("App Info: reading settings...")); QByteArray salt, settingsEncrypted; settingsData.stream >> salt >> settingsEncrypted; @@ -2117,7 +2117,7 @@ namespace Local { EncryptedDescriptor settings; if (!decryptLocal(settings, settingsEncrypted, _settingsKey)) { - LOG(("App Error: could not decrypt settings from settings file, maybe bad passcode..")); + LOG(("App Error: could not decrypt settings from settings file, maybe bad passcode...")); return writeSettings(); } MTP::DcOptions dcOpts; @@ -2126,7 +2126,7 @@ namespace Local { dcOpts = Global::DcOptions(); } _dcOpts = &dcOpts; - LOG(("App Info: reading encrypted settings..")); + LOG(("App Info: reading encrypted settings...")); while (!settings.stream.atEnd()) { quint32 blockId; settings.stream >> blockId; diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 85096528f..e0300abb6 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -62,12 +62,12 @@ int main(int argc, char *argv[]) { #ifndef TDESKTOP_DISABLE_AUTOUPDATE if (cRestartingUpdate()) { - DEBUG_LOG(("Application Info: executing updater to install update..")); + DEBUG_LOG(("Application Info: executing updater to install update...")); psExecUpdater(); } else #endif if (cRestarting()) { - DEBUG_LOG(("Application Info: executing Telegram, because of restart..")); + DEBUG_LOG(("Application Info: executing Telegram, because of restart...")); psExecTelegram(); } diff --git a/Telegram/SourceFiles/mtproto/auth_key.h b/Telegram/SourceFiles/mtproto/auth_key.h index d2c720c7e..935eee423 100644 --- a/Telegram/SourceFiles/mtproto/auth_key.h +++ b/Telegram/SourceFiles/mtproto/auth_key.h @@ -54,7 +54,7 @@ public: } void prepareAES(const MTPint128 &msgKey, MTPint256 &aesKey, MTPint256 &aesIV, bool send = true) const { - if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(.., %1)").arg(Logs::b(send))); + if (!_isset) throw mtpErrorKeyNotReady(QString("prepareAES(..., %1)").arg(Logs::b(send))); uint32 x = send ? 0 : 8; @@ -90,7 +90,7 @@ public: } void write(QDataStream &to) const { - if (!_isset) throw mtpErrorKeyNotReady("write(..)"); + if (!_isset) throw mtpErrorKeyNotReady("write(...)"); to.writeRawData(_key, 256); } diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index 1a84f8e28..9a2c9fa4d 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -447,7 +447,7 @@ ConnectionPrivate::ConnectionPrivate(QThread *thread, Connection *owner, Session return; } dc = options.cbegin().value().id; - DEBUG_LOG(("MTP Info: searching for any DC, %1 selected..").arg(dc)); + DEBUG_LOG(("MTP Info: searching for any DC, %1 selected...").arg(dc)); } connect(thread, SIGNAL(started()), this, SLOT(socketStart())); @@ -1154,8 +1154,8 @@ void ConnectionPrivate::socketStart(bool afterConfig) { _pingId = _pingMsgId = _pingIdToSend = _pingSendAt = 0; _pingSender.stop(); - if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %3:%4 (http)..").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); - if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)..").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv4) DEBUG_LOG(("MTP Info: creating IPv4 connection to %1:%2 (tcp) and %3:%4 (http)...").arg(ip[IPv4address][TcpProtocol].c_str()).arg(port[IPv4address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); + if (!noIPv6) DEBUG_LOG(("MTP Info: creating IPv6 connection to [%1]:%2 (tcp) and [%3]:%4 (http)...").arg(ip[IPv6address][TcpProtocol].c_str()).arg(port[IPv6address][TcpProtocol]).arg(ip[IPv4address][HttpProtocol].c_str()).arg(port[IPv4address][HttpProtocol])); _waitForConnectedTimer.start(_waitForConnected); if (auto conn = _conn4) { @@ -1188,7 +1188,7 @@ void ConnectionPrivate::restart(bool mayBeBadKey) { clearMessages(); keyId = AuthKey::RecreateKeyId; // retryTimeout = 1; // no ddos please - LOG(("MTP Info: key may be bad and was not checked - but won't be destroyed, no log outs because of bad server right now..")); + LOG(("MTP Info: key may be bad and was not checked - but won't be destroyed, no log outs because of bad server right now...")); } } else { sessionData->setCheckedKey(false); @@ -1254,7 +1254,7 @@ void ConnectionPrivate::onOldConnection() { void ConnectionPrivate::onPingSender() { if (_pingId) { if (_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto - 1) * 1000ULL < getms(true)) { - LOG(("Could not send ping for MTPPingSendAfter seconds, restarting..")); + LOG(("Could not send ping for MTPPingSendAfter seconds, restarting...")); return restart(); } else { _pingSender.start(_pingSendAt + (MTPPingSendAfter - MTPPingSendAfterAuto) * 1000ULL - getms(true)); @@ -1440,7 +1440,7 @@ void ConnectionPrivate::handleReceived() { bool wasConnected = (getState() == ConnectedState); if (serverSalt != mySalt) { if (!badTime) { - DEBUG_LOG(("MTP Info: other salt received.. received: %1, my salt: %2, updating..").arg(serverSalt).arg(mySalt)); + DEBUG_LOG(("MTP Info: other salt received... received: %1, my salt: %2, updating...").arg(serverSalt).arg(mySalt)); sessionData->setSalt(serverSalt); if (setState(ConnectedState, ConnectingState)) { // only connected if (restarted) { @@ -1449,7 +1449,7 @@ void ConnectionPrivate::handleReceived() { } } } else { - DEBUG_LOG(("MTP Info: other salt received.. received: %1, my salt: %2").arg(serverSalt).arg(mySalt)); + DEBUG_LOG(("MTP Info: other salt received... received: %1, my salt: %2").arg(serverSalt).arg(mySalt)); } } else { serverSalt = 0; // dont pass to handle method, so not to lock in setSalt() @@ -1659,7 +1659,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (serverSalt) sessionData->setSalt(serverSalt); unixtimeSet(serverTime, true); - DEBUG_LOG(("Message Info: unixtime updated, now %1, resending in container..").arg(serverTime)); + DEBUG_LOG(("Message Info: unixtime updated, now %1, resending in container...").arg(serverTime)); resend(resendId, 0, true); } else { // must create new session, because msg_id and msg_seqno are inconsistent @@ -1710,13 +1710,13 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime badTime = false; - DEBUG_LOG(("Message Info: unixtime updated, now %1, server_salt updated, now %2, resending..").arg(serverTime).arg(serverSalt)); + DEBUG_LOG(("Message Info: unixtime updated, now %1, server_salt updated, now %2, resending...").arg(serverTime).arg(serverSalt)); resend(resendId); } return 1; case mtpc_msgs_state_req: { if (badTime) { - DEBUG_LOG(("Message Info: skipping with bad time..")); + DEBUG_LOG(("Message Info: skipping with bad time...")); return 0; } MTPMsgsStateReq msg(from, end); @@ -1818,7 +1818,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime case mtpc_msgs_all_info: { if (badTime) { - DEBUG_LOG(("Message Info: skipping with bad time..")); + DEBUG_LOG(("Message Info: skipping with bad time...")); return 0; } @@ -1862,14 +1862,14 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (received) { ackRequestData.push_back(resMsgId); } else { - DEBUG_LOG(("Message Info: answer message %1 was not received, requesting..").arg(resMsgId.v)); + DEBUG_LOG(("Message Info: answer message %1 was not received, requesting...").arg(resMsgId.v)); resendRequestData.push_back(resMsgId); } } return 1; case mtpc_msg_new_detailed_info: { if (badTime) { - DEBUG_LOG(("Message Info: skipping msg_new_detailed_info with bad time..")); + DEBUG_LOG(("Message Info: skipping msg_new_detailed_info with bad time...")); return 0; } MTPMsgDetailedInfo msg(from, end); @@ -1887,7 +1887,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (received) { ackRequestData.push_back(resMsgId); } else { - DEBUG_LOG(("Message Info: answer message %1 was not received, requesting..").arg(resMsgId.v)); + DEBUG_LOG(("Message Info: answer message %1 was not received, requesting...").arg(resMsgId.v)); resendRequestData.push_back(resMsgId); } } return 1; @@ -1914,7 +1914,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime MTPlong reqMsgId(++from, end); mtpTypeId typeId = from[0]; - DEBUG_LOG(("RPC Info: response received for %1, queueing..").arg(reqMsgId.v)); + DEBUG_LOG(("RPC Info: response received for %1, queueing...").arg(reqMsgId.v)); QVector ids(1, reqMsgId); if (badTime) { @@ -1995,7 +1995,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (badTime) return 0; MTPPing msg(from, end); - DEBUG_LOG(("Message Info: ping received, ping_id: %1, sending pong..").arg(msg.vping_id.v)); + DEBUG_LOG(("Message Info: ping received, ping_id: %1, sending pong...").arg(msg.vping_id.v)); emit sendPongAsync(msgId, msg.vping_id.v); } return 1; @@ -2012,7 +2012,7 @@ int32 ConnectionPrivate::handleOneReceived(const mtpPrime *from, const mtpPrime if (data.vping_id.v == _pingId) { _pingId = 0; } else { - DEBUG_LOG(("Message Info: just pong..")); + DEBUG_LOG(("Message Info: just pong...")); } QVector ids(1, data.vmsg_id); @@ -2154,7 +2154,7 @@ void ConnectionPrivate::requestsAcked(const QVector &ids, bool byRespon } } } else { - DEBUG_LOG(("Message Info: msgId %1 was not found in recent sent, while acking requests, searching in resend..").arg(msgId)); + DEBUG_LOG(("Message Info: msgId %1 was not found in recent sent, while acking requests, searching in resend...").arg(msgId)); QWriteLocker locker3(sessionData->toResendMutex()); mtpRequestIdsMap &toResend(sessionData->toResendMap()); mtpRequestIdsMap::iterator reqIt = toResend.find(msgId); @@ -2228,7 +2228,7 @@ void ConnectionPrivate::handleMsgsStates(const QVector &ids, const stri const mtpRequestMap &haveSent(sessionData->haveSentMap()); mtpRequestMap::const_iterator haveSentEnd = haveSent.cend(); if (haveSent.find(requestMsgId) == haveSentEnd) { - DEBUG_LOG(("Message Info: state was received for msgId %1, but request is not found, looking in resent requests..").arg(requestMsgId)); + DEBUG_LOG(("Message Info: state was received for msgId %1, but request is not found, looking in resent requests...").arg(requestMsgId)); QWriteLocker locker2(sessionData->toResendMutex()); mtpRequestIdsMap &toResend(sessionData->toResendMap()); mtpRequestIdsMap::iterator reqIt = toResend.find(requestMsgId); @@ -2385,7 +2385,7 @@ void ConnectionPrivate::updateAuthKey() { connect(_conn, SIGNAL(receivedData()), this, SLOT(pqAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_pq..")); + DEBUG_LOG(("AuthKey Info: sending Req_pq...")); lockFinished.unlock(); sendRequestNotSecure(req_pq); } @@ -2398,7 +2398,7 @@ void ConnectionPrivate::clearMessages() { void ConnectionPrivate::pqAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(pqAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_pq answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_pq answer...")); MTPReq_pq::ResponseType res_pq; if (!readResponseNotSecure(res_pq)) { @@ -2490,13 +2490,13 @@ void ConnectionPrivate::pqAnswered() { } connect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_DH_params..")); + DEBUG_LOG(("AuthKey Info: sending Req_DH_params...")); sendRequestNotSecure(req_DH_params); } void ConnectionPrivate::dhParamsAnswered() { disconnect(_conn, SIGNAL(receivedData()), this, SLOT(dhParamsAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_DH_params answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_DH_params answer...")); MTPReq_DH_params::ResponseType res_DH_params; if (!readResponseNotSecure(res_DH_params)) { @@ -2672,7 +2672,7 @@ void ConnectionPrivate::dhClientParamsSend() { connect(_conn, SIGNAL(receivedData()), this, SLOT(dhClientParamsAnswered())); - DEBUG_LOG(("AuthKey Info: sending Req_client_DH_params..")); + DEBUG_LOG(("AuthKey Info: sending Req_client_DH_params...")); sendRequestNotSecure(req_client_DH_params); } @@ -2681,7 +2681,7 @@ void ConnectionPrivate::dhClientParamsAnswered() { if (!sessionData) return; disconnect(_conn, SIGNAL(receivedData()), this, SLOT(dhClientParamsAnswered())); - DEBUG_LOG(("AuthKey Info: receiving Req_client_DH_params answer..")); + DEBUG_LOG(("AuthKey Info: receiving Req_client_DH_params answer...")); MTPSet_client_DH_params::ResponseType res_client_DH_params; if (!readResponseNotSecure(res_client_DH_params)) { @@ -2839,7 +2839,7 @@ void ConnectionPrivate::onError4(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv4 connection, maybe bad key: %1...").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn4); @@ -2853,7 +2853,7 @@ void ConnectionPrivate::onError6(bool mayBeBadKey) { destroyConn(); _waitForConnectedTimer.stop(); - MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1..").arg(Logs::b(mayBeBadKey))); + MTP_LOG(dc, ("Restarting after error in IPv6 connection, maybe bad key: %1...").arg(Logs::b(mayBeBadKey))); return restart(mayBeBadKey); } else { destroyConn(&_conn6); @@ -2940,7 +2940,7 @@ bool ConnectionPrivate::sendRequest(mtpRequest &request, bool needAnyResponse, Q ReadLockerAttempt lock(sessionData->keyMutex()); if (!lock) { - DEBUG_LOG(("MTP Info: could not lock key for read in sendBuffer(), dc %1, restarting..").arg(dc)); + DEBUG_LOG(("MTP Info: could not lock key for read in sendBuffer(), dc %1, restarting...").arg(dc)); lockFinished.unlock(); restart(); diff --git a/Telegram/SourceFiles/mtproto/connection_tcp.cpp b/Telegram/SourceFiles/mtproto/connection_tcp.cpp index 8f18e4549..b02c63f56 100644 --- a/Telegram/SourceFiles/mtproto/connection_tcp.cpp +++ b/Telegram/SourceFiles/mtproto/connection_tcp.cpp @@ -129,7 +129,7 @@ void AbstractTCPConnection::socketRead() { emit error(); return; } else { - TCP_LOG(("TCP Info: no bytes read, but bytes available was true..")); + TCP_LOG(("TCP Info: no bytes read, but bytes available was true...")); break; } } while (sock.state() == QAbstractSocket::ConnectedState && sock.bytesAvailable()); diff --git a/Telegram/SourceFiles/mtproto/core_types.cpp b/Telegram/SourceFiles/mtproto/core_types.cpp index 1e401eefc..f438c4e6e 100644 --- a/Telegram/SourceFiles/mtproto/core_types.cpp +++ b/Telegram/SourceFiles/mtproto/core_types.cpp @@ -66,7 +66,7 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP } else if (strUtf8.size() < 64) { to.add(Logs::mb(strUtf8.constData(), strUtf8.size()).str()).add(" [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } else { - to.add(Logs::mb(strUtf8.constData(), 16).str()).add(".. [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); + to.add(Logs::mb(strUtf8.constData(), 16).str()).add("... [").add(mtpWrapNumber(strUtf8.size())).add(" BYTES]"); } } break; diff --git a/Telegram/SourceFiles/mtproto/facade.cpp b/Telegram/SourceFiles/mtproto/facade.cpp index f7cff78a7..eb3b23f2f 100644 --- a/Telegram/SourceFiles/mtproto/facade.cpp +++ b/Telegram/SourceFiles/mtproto/facade.cpp @@ -388,7 +388,7 @@ void registerRequest(mtpRequestId requestId, int32 dcWithShift) { QMutexLocker locker(&requestByDCLock); requestsByDC.insert(requestId, dcWithShift); } - internal::performDelayedClear(); // need to do it somewhere.. + internal::performDelayedClear(); // need to do it somewhere... } void unregisterRequest(mtpRequestId requestId) { @@ -517,7 +517,7 @@ void execCallback(mtpRequestId requestId, const mtpPrime *from, const mtpPrime * h = i.value(); parserMap.erase(i); - DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response..").arg(requestId)); + DEBUG_LOG(("RPC Info: found parser for request %1, trying to parse response...").arg(requestId)); } } if (h.onDone || h.onFail) { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 56be26e3b..1aaaf2898 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1537,7 +1537,7 @@ void ProfileInner::onMenuDestroy(QObject *obj) { void ProfileInner::onCopyFullName() { if (!_peerUser) return; - QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName)); + QApplication::clipboard()->setText(lng_full_name(lt_first_name, _peerUser->firstName, lt_last_name, _peerUser->lastName).trimmed()); } void ProfileInner::onCopyPhone() { diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp index 9e00f902d..e3af2b9de 100644 --- a/Telegram/SourceFiles/pspecific_linux.cpp +++ b/Telegram/SourceFiles/pspecific_linux.cpp @@ -347,7 +347,7 @@ namespace { } bool loadLibrary(QLibrary &lib, const char *name, int version) { - DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version)); + DEBUG_LOG(("Loading '%1' with version %2...").arg(QLatin1String(name)).arg(version)); lib.setFileNameAndVersion(QLatin1String(name), version); if (lib.load()) { DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); @@ -443,7 +443,7 @@ namespace { } if (!useGtkBase && lib_gtk.isLoaded()) { - LOG(("Could not load appindicator, trying to load gtk..")); + LOG(("Could not load appindicator, trying to load gtk...")); setupGtkBase(lib_gtk); } if (!useGtkBase) { diff --git a/Telegram/SourceFiles/pspecific_win.cpp b/Telegram/SourceFiles/pspecific_win.cpp index 4153318b7..26665b0d5 100644 --- a/Telegram/SourceFiles/pspecific_win.cpp +++ b/Telegram/SourceFiles/pspecific_win.cpp @@ -2197,7 +2197,7 @@ namespace { } bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { - DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + DEBUG_LOG(("App Info: opening reg key %1...").arg(QString::fromStdWString(key))); LSTATUS status = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_QUERY_VALUE | KEY_WRITE, rkey); if (status != ERROR_SUCCESS) { if (status == ERROR_FILE_NOT_FOUND) { @@ -2236,7 +2236,7 @@ namespace { void RegisterCustomScheme() { #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME - DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); + DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); HKEY rkey; QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); @@ -3385,7 +3385,7 @@ void CheckPinnedAppUserModelId() { BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); CloseHandle(srcfile); if (!srcres) return; - LOG(("Checking..")); + LOG(("Checking...")); WIN32_FIND_DATA findData; HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); if (findHandle == INVALID_HANDLE_VALUE) { @@ -3431,7 +3431,7 @@ void CheckPinnedAppUserModelId() { PROPVARIANT appIdPropVar; hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); if (!SUCCEEDED(hr)) return; - LOG(("Reading..")); + LOG(("Reading...")); WCHAR already[MAX_PATH]; hr = propVariantToString(appIdPropVar, already, MAX_PATH); if (SUCCEEDED(hr)) { diff --git a/Telegram/SourceFiles/pspecific_winrt.cpp b/Telegram/SourceFiles/pspecific_winrt.cpp index 49d8ef081..ee96c9ae5 100644 --- a/Telegram/SourceFiles/pspecific_winrt.cpp +++ b/Telegram/SourceFiles/pspecific_winrt.cpp @@ -2210,7 +2210,7 @@ namespace { //} //bool _psOpenRegKey(LPCWSTR key, PHKEY rkey) { - // DEBUG_LOG(("App Info: opening reg key %1..").arg(QString::fromStdWString(key))); + // DEBUG_LOG(("App Info: opening reg key %1...").arg(QString::fromStdWString(key))); // LSTATUS status = RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_QUERY_VALUE | KEY_WRITE, rkey); // if (status != ERROR_SUCCESS) { // if (status == ERROR_FILE_NOT_FOUND) { @@ -2249,7 +2249,7 @@ namespace { void RegisterCustomScheme() { #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME - DEBUG_LOG(("App Info: Checking custom scheme 'tg'..")); + DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); //HKEY rkey; //QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); @@ -2799,7 +2799,7 @@ void CheckPinnedAppUserModelId() { //BOOL srcres = GetFileInformationByHandle(srcfile, &srcinfo); //CloseHandle(srcfile); //if (!srcres) return; - //LOG(("Checking..")); + //LOG(("Checking...")); //WIN32_FIND_DATA findData; //HANDLE findHandle = FindFirstFileEx((p + L"*").c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, 0, 0); //if (findHandle == INVALID_HANDLE_VALUE) { @@ -2845,7 +2845,7 @@ void CheckPinnedAppUserModelId() { // PROPVARIANT appIdPropVar; // hr = propertyStore->GetValue(pkey_AppUserModel_ID, &appIdPropVar); // if (!SUCCEEDED(hr)) return; - // LOG(("Reading..")); + // LOG(("Reading...")); // WCHAR already[MAX_PATH]; // hr = propVariantToString(appIdPropVar, already, MAX_PATH); // if (SUCCEEDED(hr)) { diff --git a/Telegram/SourceFiles/types.cpp b/Telegram/SourceFiles/types.cpp index 523b02897..6f0b408d9 100644 --- a/Telegram/SourceFiles/types.cpp +++ b/Telegram/SourceFiles/types.cpp @@ -290,7 +290,7 @@ namespace ThirdParty { uchar sha256Buffer[32]; RAND_seed(hashSha256(buf, 16, sha256Buffer), 32); if (!RAND_status()) { - LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0..")); + LOG(("MTP Error: Could not init OpenSSL rand, RAND_status() is 0...")); } } diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 4e7c413fe..4c155538d 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2348,7 +2348,7 @@ void LastCrashedWindow::onSendReport() { connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); - _pleaseSendReport.setText(qsl("Sending crash report..")); + _pleaseSendReport.setText(qsl("Sending crash report...")); _sendingState = SendingProgress; _reportShown = false; updateControls(); @@ -2816,7 +2816,7 @@ void LastCrashedWindow::setUpdatingState(UpdatingState state, bool force) { } break; case UpdatingCheck: - _updating.setText(qsl("Checking for updates..")); + _updating.setText(qsl("Checking for updates...")); break; case UpdatingFail: _updating.setText(qsl("Update check failed :(")); @@ -2923,9 +2923,9 @@ void LastCrashedWindow::onSendingProgress(qint64 uploaded, qint64 total) { _sendingState = SendingUploading; if (total < 0) { - _pleaseSendReport.setText(qsl("Sending crash report %1 KB..").arg(uploaded / 1024)); + _pleaseSendReport.setText(qsl("Sending crash report %1 KB...").arg(uploaded / 1024)); } else { - _pleaseSendReport.setText(qsl("Sending crash report %1 / %2 KB..").arg(uploaded / 1024).arg(total / 1024)); + _pleaseSendReport.setText(qsl("Sending crash report %1 / %2 KB...").arg(uploaded / 1024).arg(total / 1024)); } updateControls(); } From 978e86a8bab2fe3c99eeecb8b69e862a308c543e Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 18:31:11 +0300 Subject: [PATCH 5/8] bubble enlarged for signed thumbed files, error string display added for group/channel create error --- Telegram/Resources/lang.strings | 1 + Telegram/SourceFiles/boxes/addcontactbox.cpp | 3 +++ Telegram/SourceFiles/boxes/contactsbox.cpp | 13 ++++++++++++- Telegram/SourceFiles/history.cpp | 3 +++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 691b3b20b..942d92582 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -686,6 +686,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_banned" = "Sorry, only admin can add this user."; "lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; "lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; +"lng_cant_do_this" = "Sorry, this action is unavailable."; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message..."; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 5f3457ca7..b3e1c85c7 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -540,6 +540,9 @@ bool GroupInfoBox::creationFail(const RPCError &error) { _title.setFocus(); _title.showError(); return true; + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; } return false; } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 803cd32e0..9c8e49098 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -284,6 +284,8 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) { Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers); } else if (error.type() == "ADMINS_TOO_MUCH") { Ui::showLayer(new InformBox(lang(lng_channel_admins_too_much)), KeepOtherLayers); + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this)), KeepOtherLayers); } else { emit adminAdded(); } @@ -1718,7 +1720,13 @@ bool ContactsBox::editAdminFail(const RPCError &error) { if (mtpIsFlood(error)) return true; --_saveRequestId; _inner.chat()->invalidateParticipants(); - if (!_saveRequestId) onClose(); + if (!_saveRequestId) { + if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; + } + onClose(); + } return false; } @@ -1765,6 +1773,9 @@ bool ContactsBox::creationFail(const RPCError &error) { } else if (error.type() == "PEER_FLOOD") { Ui::showLayer(new InformBox(lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq?_hash=can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info)))), KeepOtherLayers); return true; + } else if (error.type() == qstr("USER_RESTRICTED")) { + Ui::showLayer(new InformBox(lang(lng_cant_do_this))); + return true; } return false; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f6194d524..a2f4454c8 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -3902,6 +3902,9 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) { if (thumbed) { _minh = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom(); + if (!captioned && parent->Is()) { + _minh += st::msgDateFont->height - st::msgDateDelta.y(); + } } else { _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); } From 6710ef3e2f16c99790e3c3fee49cdf9f0346289b Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 19:27:38 +0300 Subject: [PATCH 6/8] fixed admin badge display in groups --- Telegram/SourceFiles/app.cpp | 1 - Telegram/SourceFiles/profilewidget.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index df9c75bde..e9d2bbe5c 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -891,7 +891,6 @@ namespace App { } } else { chat->flags &= ~MTPDchat::Flag::f_admins_enabled; - chat->flags &= ~MTPDchat::Flag::f_admin; } if (emitPeerUpdated) { App::main()->peerUpdated(chat); diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 1aaaf2898..a3036db88 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -1034,7 +1034,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { data->online = App::onlineText(user, l_time); } if (_peerChat) { - data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->admins.constFind(user) != _peerChat->admins.cend()); + data->admin = (peerFromUser(_peerChat->creator) == user->id) || (_peerChat->adminsEnabled() && (_peerChat->admins.constFind(user) != _peerChat->admins.cend())); } else if (_peerChannel) { data->admin = (_peerChannel->mgInfo->lastAdmins.constFind(user) != _peerChannel->mgInfo->lastAdmins.cend()); } else { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 304fb2974..4896a0cea 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -491,7 +491,7 @@ public: return flags & MTPDchat::Flag::f_creator; } bool amAdmin() const { - return flags & MTPDchat::Flag::f_admin; + return (flags & MTPDchat::Flag::f_admin) && adminsEnabled(); } bool isDeactivated() const { return flags & MTPDchat::Flag::f_deactivated; From b86d8638bcd6d4501d3b7613cf263950b8725bb1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 20:30:31 +0300 Subject: [PATCH 7/8] Fixed not loaded messages with bot keyboard display Fixed saved gifs row layout Removed information about channel members count / left to invite in invite-to-channel box (channels have no participants limit) --- Telegram/SourceFiles/boxes/contactsbox.cpp | 6 ++++-- Telegram/SourceFiles/dropdown.cpp | 23 ++++++++++++++++------ Telegram/SourceFiles/historywidget.cpp | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 9c8e49098..0d23989d5 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -785,7 +785,9 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) { data->check = true; _checkedContacts.insert(peer, true); ++_selCount; - } else if ((!_channel || !_channel->isMegagroup()) && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) { + } else if (_channel && !_channel->isMegagroup()) { + Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers); + } else if (!_channel && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) { Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers); } if (cnt != _selCount) emit chosenChanged(); @@ -1551,7 +1553,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) { paintTitle(p, lang(lng_channel_admins)); } else if (_inner.chat() || _inner.creating() != CreatingGroupNone) { QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant)); - QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax())); + QString additional((addingAdmin || (_inner.channel() && !_inner.channel()->isMegagroup())) ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax())); paintTitle(p, title, additional); } else if (_inner.bot()) { paintTitle(p, lang(lng_bot_choose_group)); diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index a2fe08399..44d9d2653 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1828,15 +1828,26 @@ StickerPanInner::InlineRow &StickerPanInner::layoutInlineRow(InlineRow &row, int int32 count = row.items.size(); t_assert(count <= SavedGifsMaxPerRow); + // enumerate items in the order of growing maxWidth() + // for that sort item indices by maxWidth() + int indices[SavedGifsMaxPerRow]; + for (int i = 0; i < count; ++i) { + indices[i] = i; + } + std::sort(indices, indices + count, [&row](int a, int b) -> bool { + return row.items.at(a)->maxWidth() < row.items.at(b)->maxWidth(); + }); + row.height = 0; - int32 availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1); - for (int32 i = 0; i < count; ++i) { - int32 w = sumWidth ? (row.items.at(i)->maxWidth() * availw / sumWidth) : row.items.at(i)->maxWidth(); - int32 actualw = qMax(w, int32(st::inlineResultsMinWidth)); - row.height = qMax(row.height, row.items.at(i)->resizeGetHeight(actualw)); + int availw = width() - st::inlineResultsLeft - st::inlineResultsSkip * (count - 1); + for (int i = 0; i < count; ++i) { + int index = indices[i]; + int w = sumWidth ? (row.items.at(index)->maxWidth() * availw / sumWidth) : row.items.at(index)->maxWidth(); + int actualw = qMax(w, int(st::inlineResultsMinWidth)); + row.height = qMax(row.height, row.items.at(index)->resizeGetHeight(actualw)); if (sumWidth) { availw -= actualw; - sumWidth -= row.items.at(i)->maxWidth(); + sumWidth -= row.items.at(index)->maxWidth(); } } return row; diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 174b2506d..ab66e4639 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -8021,6 +8021,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { drawPinnedBar(p); } if (_scroll.isHidden()) { + p.setClipRect(_scroll.geometry()); QPoint dogPos((width() - st::msgDogImg.pxWidth()) / 2, ((height() - _field.height() - 2 * st::sendPadding - st::msgDogImg.pxHeight()) * 4) / 9); p.drawPixmap(dogPos, *cChatDogImage()); } From 2876916258675141cdc9e56164110cffb6fbe7ed Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Mar 2016 20:56:12 +0300 Subject: [PATCH 8/8] beta 9034003 version --- Telegram/SourceFiles/config.h | 2 +- Telegram/Telegram.rc | 8 ++++---- Telegram/Version | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 4f0a5668a..758dee907 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -23,7 +23,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org static const int32 AppVersion = 9034; static const wchar_t *AppVersionStr = L"0.9.34"; static const bool DevVersion = false; -#define BETA_VERSION (9034002ULL) // just comment this line to build public version +#define BETA_VERSION (9034003ULL) // just comment this line to build public version static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 8485fe9cd..cd7485bd7 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,34,2 - PRODUCTVERSION 0,9,34,2 + FILEVERSION 0,9,34,3 + PRODUCTVERSION 0,9,34,3 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.34.2" + VALUE "FileVersion", "0.9.34.3" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.34.2" + VALUE "ProductVersion", "0.9.34.3" END END BLOCK "VarFileInfo" diff --git a/Telegram/Version b/Telegram/Version index 1997f5969..9c0370804 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -3,4 +3,4 @@ AppVersionStrMajor 0.9 AppVersionStrSmall 0.9.34 AppVersionStr 0.9.34 DevChannel 0 -BetaVersion 9034002 +BetaVersion 9034003