mirror of https://github.com/procxx/kepka.git
				
				
				
			prepared 0.5.7 version with serverside search and some fixes
This commit is contained in:
		
							parent
							
								
									a810fe258a
								
							
						
					
					
						commit
						b676158117
					
				| 
						 | 
					@ -382,6 +382,10 @@ This software is licensed under [a href=\"https://github.com/telegramdesktop/tde
 | 
				
			||||||
source code is available on [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a].";
 | 
					source code is available on [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a].";
 | 
				
			||||||
lng_about_done: "Done";
 | 
					lng_about_done: "Done";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					lng_search_no_results: "No messages found";
 | 
				
			||||||
 | 
					lng_search_one_result: "Found {count} message";
 | 
				
			||||||
 | 
					lng_search_n_results: "Found {count} messages";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Mac specific
 | 
					// Mac specific
 | 
				
			||||||
 | 
					
 | 
				
			||||||
lng_mac_choose_app: "Choose Application";
 | 
					lng_mac_choose_app: "Choose Application";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -958,6 +958,12 @@ unreadBarBG: #fcfbfa;
 | 
				
			||||||
unreadBarBorder: titleShadowColor;
 | 
					unreadBarBorder: titleShadowColor;
 | 
				
			||||||
unreadBarColor: #538bb4;
 | 
					unreadBarColor: #538bb4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					searchedBarHeight: unreadBarHeight;
 | 
				
			||||||
 | 
					searchedBarFont: unreadBarFont;
 | 
				
			||||||
 | 
					searchedBarBG: #f1f1f1;
 | 
				
			||||||
 | 
					searchedBarBorder: unreadBarBorder;
 | 
				
			||||||
 | 
					searchedBarColor: #aaa;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
layerSlideDuration: 200;
 | 
					layerSlideDuration: 200;
 | 
				
			||||||
layerHideDuration: 200;
 | 
					layerHideDuration: 200;
 | 
				
			||||||
layerPadding: margins(10px, 10px, 10px, 10px);
 | 
					layerPadding: margins(10px, 10px, 10px, 10px);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,7 +133,7 @@ namespace App {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void logOut() {
 | 
						void logOut() {
 | 
				
			||||||
		MTP::send(MTPauth_LogOut(), rpcDone(&loggedOut), rpcFail(&loggedOut));
 | 
							MTP::logoutKeys(rpcDone(&loggedOut), rpcFail(&loggedOut));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	PeerId peerFromMTP(const MTPPeer &peer_id) {
 | 
						PeerId peerFromMTP(const MTPPeer &peer_id) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 4.9 KiB  | 
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
| 
						 | 
					@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const int32 AppVersion = 5006;
 | 
					static const int32 AppVersion = 5007;
 | 
				
			||||||
static const wchar_t *AppVersionStr = L"0.5.6";
 | 
					static const wchar_t *AppVersionStr = L"0.5.7";
 | 
				
			||||||
#ifdef Q_OS_WIN
 | 
					#ifdef Q_OS_WIN
 | 
				
			||||||
static const wchar_t *AppName = L"Telegram Win (Unofficial)";
 | 
					static const wchar_t *AppName = L"Telegram Win (Unofficial)";
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,7 @@ enum {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SaveRecentEmojisTimeout = 3000, // 3 secs
 | 
						SaveRecentEmojisTimeout = 3000, // 3 secs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	AutoSearchTimeout = 1500, // 1.5 secs
 | 
						AutoSearchTimeout = 900, // 0.9 secs
 | 
				
			||||||
	SearchPerPage = 50,
 | 
						SearchPerPage = 50,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -116,10 +116,20 @@ static const char *ApiHash = "344583e45741c457fe1862106095a5eb";
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
inline const char *cApiDeviceModel() {
 | 
					inline const char *cApiDeviceModel() {
 | 
				
			||||||
 | 
					#ifdef Q_OS_WIN
 | 
				
			||||||
	return "x86 desktop";
 | 
						return "x86 desktop";
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
						return "x64 desktop";
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
inline const char *cApiSystemVersion() {
 | 
					inline const char *cApiSystemVersion() {
 | 
				
			||||||
 | 
					#ifdef Q_OS_WIN
 | 
				
			||||||
	return "windows";
 | 
						return "windows";
 | 
				
			||||||
 | 
					#elif defined Q_OS_MAC
 | 
				
			||||||
 | 
						return "os x";
 | 
				
			||||||
 | 
					#elif defined Q_OS_LINUX
 | 
				
			||||||
 | 
						return "linux";
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
inline QString cApiAppVersion() {
 | 
					inline QString cApiAppVersion() {
 | 
				
			||||||
	return QString::number(AppVersion);
 | 
						return QString::number(AppVersion);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,16 +26,13 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
 | 
				
			||||||
#include "boxes/newgroupbox.h"
 | 
					#include "boxes/newgroupbox.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DialogsListWidget::DialogsListWidget(QWidget *parent, MainWidget *main) : QWidget(parent),
 | 
					DialogsListWidget::DialogsListWidget(QWidget *parent, MainWidget *main) : QWidget(parent),
 | 
				
			||||||
dialogs(false), contactsNoDialogs(true), contacts(true), sel(0), contactSel(false), selByMouse(false), filteredSel(-1), searchedSel(-1), _state(DefaultState) {
 | 
						dialogs(false), contactsNoDialogs(true), contacts(true), sel(0), contactSel(false), selByMouse(false), filteredSel(-1), searchedCount(0), searchedSel(-1), _state(DefaultState) {
 | 
				
			||||||
	connect(main, SIGNAL(dialogToTop(const History::DialogLinks &)), this, SLOT(onDialogToTop(const History::DialogLinks &)));
 | 
						connect(main, SIGNAL(dialogToTop(const History::DialogLinks &)), this, SLOT(onDialogToTop(const History::DialogLinks &)));
 | 
				
			||||||
	connect(main, SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(onPeerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)));
 | 
						connect(main, SIGNAL(peerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)), this, SLOT(onPeerNameChanged(PeerData *, const PeerData::Names &, const PeerData::NameFirstChars &)));
 | 
				
			||||||
	connect(main, SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(onPeerPhotoChanged(PeerData *)));
 | 
						connect(main, SIGNAL(peerPhotoChanged(PeerData *)), this, SLOT(onPeerPhotoChanged(PeerData *)));
 | 
				
			||||||
	connect(main, SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *)));
 | 
						connect(main, SIGNAL(dialogRowReplaced(DialogRow *, DialogRow *)), this, SLOT(onDialogRowReplaced(DialogRow *, DialogRow *)));
 | 
				
			||||||
	connect(main, SIGNAL(historyItemReplaced(HistoryItem *, HistoryItem *)), this, SLOT(onItemReplaced(HistoryItem *, HistoryItem *)));
 | 
						connect(main, SIGNAL(historyItemReplaced(HistoryItem *, HistoryItem *)), this, SLOT(onItemReplaced(HistoryItem *, HistoryItem *)));
 | 
				
			||||||
	connect(main, SIGNAL(historyItemDeleted(HistoryItem *)), this, SLOT(onItemRemoved(HistoryItem *)));
 | 
						connect(main, SIGNAL(historyItemDeleted(HistoryItem *)), this, SLOT(onItemRemoved(HistoryItem *)));
 | 
				
			||||||
 | 
					 | 
				
			||||||
	_updateSearchTimer.setSingleShot(true);
 | 
					 | 
				
			||||||
	connect(&_updateSearchTimer, SIGNAL(timeout()), this, SIGNAL(searchMessages()));
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::paintEvent(QPaintEvent *e) {
 | 
					void DialogsListWidget::paintEvent(QPaintEvent *e) {
 | 
				
			||||||
| 
						 | 
					@ -58,33 +55,42 @@ void DialogsListWidget::paintEvent(QPaintEvent *e) {
 | 
				
			||||||
		} else if (!otherStart) {
 | 
							} else if (!otherStart) {
 | 
				
			||||||
			// .. paint no dialogs found
 | 
								// .. paint no dialogs found
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		if (filterResults.isEmpty()) {
 | 
							if (filterResults.isEmpty()) {
 | 
				
			||||||
			// .. paint no dialogs 
 | 
								// .. paint no dialogs 
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			int32 from = r.top() / int32(st::dlgHeight);
 | 
								int32 from = r.top() / int32(st::dlgHeight);
 | 
				
			||||||
			if (from < 0) from = 0;
 | 
								if (from < 0) {
 | 
				
			||||||
 | 
									from = 0;
 | 
				
			||||||
 | 
								} else if (from > filterResults.size()) {
 | 
				
			||||||
 | 
									from = filterResults.size();
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								p.translate(0, from * st::dlgHeight);
 | 
				
			||||||
			if (from < filterResults.size()) {
 | 
								if (from < filterResults.size()) {
 | 
				
			||||||
				int32 to = (r.bottom() / int32(st::dlgHeight)) + 1, w = width();
 | 
									int32 to = (r.bottom() / int32(st::dlgHeight)) + 1, w = width();
 | 
				
			||||||
				if (to > filterResults.size()) to = filterResults.size();
 | 
									if (to > filterResults.size()) to = filterResults.size();
 | 
				
			||||||
 | 
					 | 
				
			||||||
				p.translate(0, from * st::dlgHeight);
 | 
					 | 
				
			||||||
				for (; from < to; ++from) {
 | 
									for (; from < to; ++from) {
 | 
				
			||||||
					bool active = (filterResults[from]->history->peer == App::main()->activePeer());
 | 
										bool active = (filterResults[from]->history->peer == App::main()->activePeer() && !App::main()->activeMsgId());
 | 
				
			||||||
					bool selected = (from == filteredSel);
 | 
										bool selected = (from == filteredSel);
 | 
				
			||||||
					filterResults[from]->paint(p, w, active, selected);
 | 
										filterResults[from]->paint(p, w, active, selected);
 | 
				
			||||||
					p.translate(0, st::dlgHeight);
 | 
										p.translate(0, st::dlgHeight);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
					
 | 
				
			||||||
		if (searchResults.isEmpty()) {
 | 
							if (_state == SearchedState || !searchResults.isEmpty()) {
 | 
				
			||||||
			// .. paint no dialogs 
 | 
								QString text = searchResults.isEmpty() ? lang(lng_search_no_results) : lang(searchedCount > 1 ? lng_search_n_results : lng_search_one_result).replace(qsl("{count}"), QString::number(searchedCount));
 | 
				
			||||||
		} else {
 | 
								p.fillRect(0, 0, width(), st::searchedBarHeight, st::searchedBarBG->b);
 | 
				
			||||||
			int32 from = r.top() / int32(st::dlgHeight);
 | 
								p.setFont(st::searchedBarFont->f);
 | 
				
			||||||
 | 
								p.setPen(st::searchedBarColor->p);
 | 
				
			||||||
 | 
								p.drawText(QRect(0, 0, width(), st::searchedBarHeight), text, style::al_center);
 | 
				
			||||||
 | 
								p.translate(0, st::searchedBarHeight);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								int32 skip = filterResults.size() * st::dlgHeight + st::searchedBarHeight;
 | 
				
			||||||
 | 
								int32 from = (r.top() - skip) / int32(st::dlgHeight);
 | 
				
			||||||
			if (from < 0) from = 0;
 | 
								if (from < 0) from = 0;
 | 
				
			||||||
			if (from < searchResults.size()) {
 | 
								if (from < searchResults.size()) {
 | 
				
			||||||
				int32 to = (r.bottom() / int32(st::dlgHeight)) + 1, w = width();
 | 
									int32 to = ((r.bottom() - skip) / int32(st::dlgHeight)) + 1, w = width();
 | 
				
			||||||
				if (to > searchResults.size()) to = searchResults.size();
 | 
									if (to > searchResults.size()) to = searchResults.size();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				p.translate(0, from * st::dlgHeight);
 | 
									p.translate(0, from * st::dlgHeight);
 | 
				
			||||||
| 
						 | 
					@ -100,11 +106,7 @@ void DialogsListWidget::paintEvent(QPaintEvent *e) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::activate() {
 | 
					void DialogsListWidget::activate() {
 | 
				
			||||||
	if (
 | 
						if (_state == DefaultState && !sel) {
 | 
				
			||||||
		(_state == DefaultState && !sel) ||
 | 
					 | 
				
			||||||
		(_state == FilteredState && (filteredSel < 0 || filteredSel >= filterResults.size())) ||
 | 
					 | 
				
			||||||
		(_state == SearchedState && (searchedSel < 0 || searchedSel >= searchResults.size()))
 | 
					 | 
				
			||||||
	) {
 | 
					 | 
				
			||||||
		selectSkip(1);
 | 
							selectSkip(1);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -135,7 +137,7 @@ void DialogsListWidget::onUpdateSelected(bool force) {
 | 
				
			||||||
			setCursor(sel ? style::cur_pointer : style::cur_default);
 | 
								setCursor(sel ? style::cur_pointer : style::cur_default);
 | 
				
			||||||
			parentWidget()->update();
 | 
								parentWidget()->update();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		if (!filterResults.isEmpty()) {
 | 
							if (!filterResults.isEmpty()) {
 | 
				
			||||||
			int32 newFilteredSel = mouseY / int32(st::dlgHeight);
 | 
								int32 newFilteredSel = mouseY / int32(st::dlgHeight);
 | 
				
			||||||
			if (newFilteredSel < 0 || newFilteredSel >= filterResults.size()) {
 | 
								if (newFilteredSel < 0 || newFilteredSel >= filterResults.size()) {
 | 
				
			||||||
| 
						 | 
					@ -147,9 +149,9 @@ void DialogsListWidget::onUpdateSelected(bool force) {
 | 
				
			||||||
				parentWidget()->update();
 | 
									parentWidget()->update();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
							if (_state == SearchedState && !searchResults.isEmpty()) {
 | 
				
			||||||
		if (!searchResults.isEmpty()) {
 | 
								mouseY -= filterResults.size() * st::dlgHeight + st::searchedBarHeight;
 | 
				
			||||||
			int32 newSearchedSel = mouseY / int32(st::dlgHeight);
 | 
								int32 newSearchedSel = (mouseY >= 0) ? mouseY / int32(st::dlgHeight) : -1;
 | 
				
			||||||
			if (newSearchedSel < 0 || newSearchedSel >= searchResults.size()) {
 | 
								if (newSearchedSel < 0 || newSearchedSel >= searchResults.size()) {
 | 
				
			||||||
				newSearchedSel = -1;
 | 
									newSearchedSel = -1;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -172,7 +174,7 @@ void DialogsListWidget::mousePressEvent(QMouseEvent *e) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow) {
 | 
					void DialogsListWidget::onDialogRowReplaced(DialogRow *oldRow, DialogRow *newRow) {
 | 
				
			||||||
	if (_state == FilteredState) {
 | 
						if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		for (FilteredDialogs::iterator i = filterResults.begin(); i != filterResults.end();) {
 | 
							for (FilteredDialogs::iterator i = filterResults.begin(); i != filterResults.end();) {
 | 
				
			||||||
			if (*i == oldRow) { // this row is shown in filtered and maybe is in contacts!
 | 
								if (*i == oldRow) { // this row is shown in filtered and maybe is in contacts!
 | 
				
			||||||
				if (newRow) {
 | 
									if (newRow) {
 | 
				
			||||||
| 
						 | 
					@ -243,7 +245,7 @@ void DialogsListWidget::removeContact(UserData *user) {
 | 
				
			||||||
void DialogsListWidget::dlgUpdated(DialogRow *row) {
 | 
					void DialogsListWidget::dlgUpdated(DialogRow *row) {
 | 
				
			||||||
	if (_state == DefaultState) {
 | 
						if (_state == DefaultState) {
 | 
				
			||||||
		update(0, row->pos * st::dlgHeight, width(), st::dlgHeight);
 | 
							update(0, row->pos * st::dlgHeight, width(), st::dlgHeight);
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		int32 cnt = 0;
 | 
							int32 cnt = 0;
 | 
				
			||||||
		for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
							for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
				
			||||||
			if ((*i)->history == row->history) {
 | 
								if ((*i)->history == row->history) {
 | 
				
			||||||
| 
						 | 
					@ -267,7 +269,7 @@ void DialogsListWidget::dlgUpdated(History *history) {
 | 
				
			||||||
				update(0, (dialogs.list.count + i.value()->pos) * st::dlgHeight, width(), st::dlgHeight);
 | 
									update(0, (dialogs.list.count + i.value()->pos) * st::dlgHeight, width(), st::dlgHeight);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		int32 cnt = 0;
 | 
							int32 cnt = 0;
 | 
				
			||||||
		for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
							for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
				
			||||||
			if ((*i)->history == history) {
 | 
								if ((*i)->history == history) {
 | 
				
			||||||
| 
						 | 
					@ -276,16 +278,17 @@ void DialogsListWidget::dlgUpdated(History *history) {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			++cnt;
 | 
								++cnt;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
							if (!searchResults.isEmpty()) {
 | 
				
			||||||
		int32 cnt = 0;
 | 
								int32 cnt = 0, add = filterResults.size() * st::dlgHeight + st::searchedBarHeight;
 | 
				
			||||||
			for (SearchResults::const_iterator i = searchResults.cbegin(), e = searchResults.cend(); i != e; ++i) {
 | 
								for (SearchResults::const_iterator i = searchResults.cbegin(), e = searchResults.cend(); i != e; ++i) {
 | 
				
			||||||
				if ((*i)->_item->history() == history) {
 | 
									if ((*i)->_item->history() == history) {
 | 
				
			||||||
				update(0, cnt * st::dlgHeight, width(), st::dlgHeight);
 | 
										update(0, add + cnt * st::dlgHeight, width(), st::dlgHeight);
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				++cnt;
 | 
									++cnt;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::enterEvent(QEvent *e) {
 | 
					void DialogsListWidget::enterEvent(QEvent *e) {
 | 
				
			||||||
| 
						 | 
					@ -331,11 +334,6 @@ void DialogsListWidget::onPeerPhotoChanged(PeerData *peer) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) {
 | 
					void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) {
 | 
				
			||||||
	if (_state == SearchedState && !newFilter.trimmed().isEmpty()) {
 | 
					 | 
				
			||||||
		_updateSearchTimer.start(AutoSearchTimeout);
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	newFilter = textAccentFold(newFilter.trimmed().toLower());
 | 
						newFilter = textAccentFold(newFilter.trimmed().toLower());
 | 
				
			||||||
	if (newFilter != filter || force) {
 | 
						if (newFilter != filter || force) {
 | 
				
			||||||
		QStringList f;
 | 
							QStringList f;
 | 
				
			||||||
| 
						 | 
					@ -356,6 +354,7 @@ void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) {
 | 
				
			||||||
			if (filter.isEmpty()) {
 | 
								if (filter.isEmpty()) {
 | 
				
			||||||
				_state = DefaultState;
 | 
									_state = DefaultState;
 | 
				
			||||||
				filterResults.clear();
 | 
									filterResults.clear();
 | 
				
			||||||
 | 
									searchResults.clear();
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi;
 | 
									QStringList::const_iterator fb = f.cbegin(), fe = f.cend(), fi;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -434,6 +433,9 @@ void DialogsListWidget::onFilterUpdate(QString newFilter, bool force) {
 | 
				
			||||||
		refresh(true);
 | 
							refresh(true);
 | 
				
			||||||
		setMouseSel(false, true);
 | 
							setMouseSel(false, true);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (_state != DefaultState) {
 | 
				
			||||||
 | 
							emit searchMessages();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DialogsListWidget::~DialogsListWidget() {
 | 
					DialogsListWidget::~DialogsListWidget() {
 | 
				
			||||||
| 
						 | 
					@ -485,7 +487,7 @@ void DialogsListWidget::dialogsReceived(const QVector<MTPDialog> &added) {
 | 
				
			||||||
	refresh();
 | 
						refresh();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::searchReceived(const QVector<MTPMessage> &messages, bool fromStart) {
 | 
					void DialogsListWidget::searchReceived(const QVector<MTPMessage> &messages, bool fromStart, int32 fullCount) {
 | 
				
			||||||
	if (fromStart) {
 | 
						if (fromStart) {
 | 
				
			||||||
		clearSearchResults();
 | 
							clearSearchResults();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -493,6 +495,10 @@ void DialogsListWidget::searchReceived(const QVector<MTPMessage> &messages, bool
 | 
				
			||||||
		HistoryItem *item = App::histories().addToBack(*i, -1);
 | 
							HistoryItem *item = App::histories().addToBack(*i, -1);
 | 
				
			||||||
		searchResults.push_back(new FakeDialogRow(item));
 | 
							searchResults.push_back(new FakeDialogRow(item));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						searchedCount = fullCount;
 | 
				
			||||||
 | 
						if (_state == FilteredState) {
 | 
				
			||||||
 | 
							_state = SearchedState;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	refresh();
 | 
						refresh();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -531,15 +537,15 @@ int32 DialogsListWidget::addNewContact(int32 uid, bool select) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::refresh(bool toTop) {
 | 
					void DialogsListWidget::refresh(bool toTop) {
 | 
				
			||||||
	int32 cnt = 0;
 | 
						int32 h = 0;
 | 
				
			||||||
	if (_state == DefaultState) {
 | 
						if (_state == DefaultState) {
 | 
				
			||||||
		cnt = dialogs.list.count + contactsNoDialogs.list.count;
 | 
							h = (dialogs.list.count + contactsNoDialogs.list.count) * st::dlgHeight;
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState) {
 | 
				
			||||||
		cnt = filterResults.count();
 | 
							h = (filterResults.count() + searchResults.count()) * st::dlgHeight + (searchResults.isEmpty() ? 0 : st::searchedBarHeight);
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
						} else if (_state == SearchedState) {
 | 
				
			||||||
		cnt = searchResults.count();
 | 
							h = (filterResults.count() + searchResults.count()) * st::dlgHeight + st::searchedBarHeight;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	resize(width(), cnt * st::dlgHeight);
 | 
						resize(width(), h);
 | 
				
			||||||
	if (toTop) {
 | 
						if (toTop) {
 | 
				
			||||||
		emit mustScrollTo(0, 0);
 | 
							emit mustScrollTo(0, 0);
 | 
				
			||||||
		loadPeerPhotos(0);
 | 
							loadPeerPhotos(0);
 | 
				
			||||||
| 
						 | 
					@ -553,19 +559,18 @@ void DialogsListWidget::setMouseSel(bool msel, bool toTop) {
 | 
				
			||||||
		if (_state == DefaultState) {
 | 
							if (_state == DefaultState) {
 | 
				
			||||||
			sel = (dialogs.list.count ? dialogs.list.begin : (contactsNoDialogs.list.count ? contactsNoDialogs.list.begin : 0));
 | 
								sel = (dialogs.list.count ? dialogs.list.begin : (contactsNoDialogs.list.count ? contactsNoDialogs.list.begin : 0));
 | 
				
			||||||
			contactSel = !dialogs.list.count && contactsNoDialogs.list.count;
 | 
								contactSel = !dialogs.list.count && contactsNoDialogs.list.count;
 | 
				
			||||||
		} else if (_state == FilteredState) {
 | 
							} else if (_state == FilteredState || _state == SearchedState) { // don't select first elem in search
 | 
				
			||||||
			filteredSel = 0;
 | 
								filteredSel = -1;
 | 
				
			||||||
		} else if (_state == SearchedState) {
 | 
								searchedSel = -1;
 | 
				
			||||||
			searchedSel = -1; // don't select first elem in search
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::setState(State newState) {
 | 
					void DialogsListWidget::setState(State newState) {
 | 
				
			||||||
	_state = newState;
 | 
						_state = newState;
 | 
				
			||||||
	if (_state == DefaultState || _state == FilteredState) {
 | 
						if (_state == DefaultState) {
 | 
				
			||||||
		clearSearchResults();
 | 
							clearSearchResults();
 | 
				
			||||||
		searchedSel = -1;
 | 
							searchedSel = filteredSel = -1;
 | 
				
			||||||
	} else if (_state == DefaultState || _state == SearchedState) {
 | 
						} else if (_state == DefaultState || _state == SearchedState) {
 | 
				
			||||||
		filterResults.clear();
 | 
							filterResults.clear();
 | 
				
			||||||
		filteredSel = -1;
 | 
							filteredSel = -1;
 | 
				
			||||||
| 
						 | 
					@ -579,8 +584,10 @@ DialogsListWidget::State DialogsListWidget::state() const {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::clearFilter() {
 | 
					void DialogsListWidget::clearFilter() {
 | 
				
			||||||
	if (_state == FilteredState) {
 | 
						if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		_state = DefaultState;
 | 
							_state = DefaultState;
 | 
				
			||||||
 | 
							filterResults.clear();
 | 
				
			||||||
 | 
							searchResults.clear();
 | 
				
			||||||
		filter = QString();
 | 
							filter = QString();
 | 
				
			||||||
		refresh(true);
 | 
							refresh(true);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -596,6 +603,7 @@ void DialogsListWidget::addDialog(const MTPDdialog &dialog) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::selectSkip(int32 direction) {
 | 
					void DialogsListWidget::selectSkip(int32 direction) {
 | 
				
			||||||
 | 
						int32 skipMore = 0;
 | 
				
			||||||
	if (_state == DefaultState) {
 | 
						if (_state == DefaultState) {
 | 
				
			||||||
		if (!sel) {
 | 
							if (!sel) {
 | 
				
			||||||
			if (dialogs.list.count && direction > 0) {
 | 
								if (dialogs.list.count && direction > 0) {
 | 
				
			||||||
| 
						 | 
					@ -622,22 +630,56 @@ void DialogsListWidget::selectSkip(int32 direction) {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		int32 fromY = (sel->pos + (contactSel ? dialogs.list.count : 0)) * st::dlgHeight;
 | 
							int32 fromY = (sel->pos + (contactSel ? dialogs.list.count : 0)) * st::dlgHeight;
 | 
				
			||||||
		emit mustScrollTo(fromY, fromY + st::dlgHeight);
 | 
							emit mustScrollTo(fromY, fromY + st::dlgHeight);
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		if (filterResults.isEmpty()) return;
 | 
							if (filterResults.isEmpty() && searchResults.isEmpty()) return;
 | 
				
			||||||
		int32 newSel = snap(filteredSel + direction, 0, filterResults.size() - 1);
 | 
							if (filteredSel < 0 || filteredSel >= filterResults.size()) {
 | 
				
			||||||
		if (newSel != filteredSel) {
 | 
								if (searchedSel < 0 || searchedSel >= searchResults.size()) {
 | 
				
			||||||
			filteredSel = newSel;
 | 
									if (filterResults.isEmpty()) {
 | 
				
			||||||
 | 
										searchedSel = 0;
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										filteredSel = 0;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
								} else if (direction < 0 && !searchedSel && !filterResults.isEmpty()) {
 | 
				
			||||||
 | 
									searchedSel = -1;
 | 
				
			||||||
 | 
									filteredSel = filterResults.size() + direction;
 | 
				
			||||||
 | 
									if (filteredSel < 0) filteredSel = 0;
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									if (direction < -1 && searchedSel + direction < 0) {
 | 
				
			||||||
 | 
										skipMore = direction + searchedSel;
 | 
				
			||||||
 | 
										if (skipMore == direction) {
 | 
				
			||||||
 | 
											skipMore = 0;
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											direction -= skipMore;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									searchedSel = snap(searchedSel + direction, 0, searchResults.size() - 1);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							} else if (direction > 0 && filteredSel == filterResults.size() - 1 && !searchResults.isEmpty()) {
 | 
				
			||||||
 | 
								filteredSel = -1;
 | 
				
			||||||
 | 
								searchedSel = direction - 1;
 | 
				
			||||||
 | 
								if (searchedSel > searchResults.size() - 1) searchedSel = searchResults.size() - 1;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								if (direction > 1 && filteredSel + direction > filterResults.size() - 1) {
 | 
				
			||||||
 | 
									skipMore = direction - (filterResults.size() - 1 - filteredSel);
 | 
				
			||||||
 | 
									if (skipMore == direction) {
 | 
				
			||||||
 | 
										skipMore = 0;
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										direction -= skipMore;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								filteredSel = snap(filteredSel + direction, 0, filterResults.size() - 1);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (filteredSel >= 0 && filteredSel < filterResults.size()) {
 | 
				
			||||||
			emit mustScrollTo(filteredSel * st::dlgHeight, (filteredSel + 1) * st::dlgHeight);
 | 
								emit mustScrollTo(filteredSel * st::dlgHeight, (filteredSel + 1) * st::dlgHeight);
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
							} else {
 | 
				
			||||||
		if (searchResults.isEmpty()) return;
 | 
								emit mustScrollTo((searchedSel + filterResults.size()) * st::dlgHeight + (searchedSel ? st::searchedBarHeight : 0), (searchedSel + filterResults.size() + 1) * st::dlgHeight + st::searchedBarHeight);
 | 
				
			||||||
		int32 newSel = snap(searchedSel + direction, 0, searchResults.size() - 1);
 | 
					 | 
				
			||||||
		if (newSel != searchedSel) {
 | 
					 | 
				
			||||||
			searchedSel = newSel;
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		emit mustScrollTo(searchedSel * st::dlgHeight, (searchedSel + 1) * st::dlgHeight);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (skipMore) {
 | 
				
			||||||
 | 
							return selectSkip(skipMore);
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
		parentWidget()->update();
 | 
							parentWidget()->update();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsListWidget::scrollToPeer(const PeerId &peer) {
 | 
					void DialogsListWidget::scrollToPeer(const PeerId &peer) {
 | 
				
			||||||
| 
						 | 
					@ -729,7 +771,7 @@ void DialogsListWidget::loadPeerPhotos(int32 yFrom) {
 | 
				
			||||||
				row->history->peer->photo->load();
 | 
									row->history->peer->photo->load();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		int32 from = yFrom / st::dlgHeight;
 | 
							int32 from = yFrom / st::dlgHeight;
 | 
				
			||||||
		if (from < 0) from = 0;
 | 
							if (from < 0) from = 0;
 | 
				
			||||||
		if (from < filterResults.size()) {
 | 
							if (from < filterResults.size()) {
 | 
				
			||||||
| 
						 | 
					@ -740,11 +782,11 @@ void DialogsListWidget::loadPeerPhotos(int32 yFrom) {
 | 
				
			||||||
				filterResults[from]->history->peer->photo->load();
 | 
									filterResults[from]->history->peer->photo->load();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
					
 | 
				
			||||||
		int32 from = yFrom / st::dlgHeight;
 | 
							from = (yFrom > st::searchedBarHeight ? ((yFrom - st::searchedBarHeight) / int32(st::dlgHeight)) : 0) - filterResults.size();
 | 
				
			||||||
		if (from < 0) from = 0;
 | 
							if (from < 0) from = 0;
 | 
				
			||||||
		if (from < searchResults.size()) {
 | 
							if (from < searchResults.size()) {
 | 
				
			||||||
			int32 to = (yTo / int32(st::dlgHeight)) + 1, w = width();
 | 
								int32 to = (yTo > st::searchedBarHeight ? ((yTo - st::searchedBarHeight) / int32(st::dlgHeight)) : 0) - filterResults.size() + 1, w = width();
 | 
				
			||||||
			if (to > searchResults.size()) to = searchResults.size();
 | 
								if (to > searchResults.size()) to = searchResults.size();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			for (; from < to; ++from) {
 | 
								for (; from < to; ++from) {
 | 
				
			||||||
| 
						 | 
					@ -759,10 +801,10 @@ bool DialogsListWidget::choosePeer() {
 | 
				
			||||||
	MsgId msgId = 0;
 | 
						MsgId msgId = 0;
 | 
				
			||||||
	if (_state == DefaultState) {
 | 
						if (_state == DefaultState) {
 | 
				
			||||||
		if (sel) history = sel->history;
 | 
							if (sel) history = sel->history;
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		if (filteredSel >= 0 && filteredSel < filterResults.size()) history = filterResults[filteredSel]->history;
 | 
							if (filteredSel >= 0 && filteredSel < filterResults.size()) {
 | 
				
			||||||
	} else if (_state == SearchedState) {
 | 
								history = filterResults[filteredSel]->history;
 | 
				
			||||||
		if (searchedSel >= 0 && searchedSel < searchResults.size()) {
 | 
							} else if (searchedSel >= 0 && searchedSel < searchResults.size()) {
 | 
				
			||||||
			history = searchResults[searchedSel]->_item->history();
 | 
								history = searchResults[searchedSel]->_item->history();
 | 
				
			||||||
			msgId = searchResults[searchedSel]->_item->id;
 | 
								msgId = searchResults[searchedSel]->_item->id;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -808,7 +850,7 @@ PeerData *DialogsListWidget::peerBefore(const PeerData *peer) const {
 | 
				
			||||||
		if (i.value()->prev) {
 | 
							if (i.value()->prev) {
 | 
				
			||||||
			return i.value()->prev->history->peer;
 | 
								return i.value()->prev->history->peer;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		if (filterResults.isEmpty() || filterResults.at(0)->history->peer == peer) return 0;
 | 
							if (filterResults.isEmpty() || filterResults.at(0)->history->peer == peer) return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for (FilteredDialogs::const_iterator b = filterResults.cbegin(), i = b + 1, e = filterResults.cend(); i != e; ++i) {
 | 
							for (FilteredDialogs::const_iterator b = filterResults.cbegin(), i = b + 1, e = filterResults.cend(); i != e; ++i) {
 | 
				
			||||||
| 
						 | 
					@ -840,7 +882,7 @@ PeerData *DialogsListWidget::peerAfter(const PeerData *peer) const {
 | 
				
			||||||
		} else if (contactsNoDialogs.list.count) {
 | 
							} else if (contactsNoDialogs.list.count) {
 | 
				
			||||||
			return contactsNoDialogs.list.begin->history->peer;
 | 
								return contactsNoDialogs.list.begin->history->peer;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (_state == FilteredState) {
 | 
						} else if (_state == FilteredState || _state == SearchedState) {
 | 
				
			||||||
		for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
							for (FilteredDialogs::const_iterator i = filterResults.cbegin(), e = filterResults.cend(); i != e; ++i) {
 | 
				
			||||||
			if ((*i)->history->peer == peer) {
 | 
								if ((*i)->history->peer == peer) {
 | 
				
			||||||
				++i;
 | 
									++i;
 | 
				
			||||||
| 
						 | 
					@ -871,7 +913,6 @@ DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent)
 | 
				
			||||||
, dlgPreloading(0)
 | 
					, dlgPreloading(0)
 | 
				
			||||||
, contactsRequest(0)
 | 
					, contactsRequest(0)
 | 
				
			||||||
, _filter(this, st::dlgFilter, lang(lng_dlg_filter))
 | 
					, _filter(this, st::dlgFilter, lang(lng_dlg_filter))
 | 
				
			||||||
, _stateSwitcher(this, st::dlgState)
 | 
					 | 
				
			||||||
, _newGroup(this, st::btnNewGroup)
 | 
					, _newGroup(this, st::btnNewGroup)
 | 
				
			||||||
, _addContact(this, st::btnAddContact)
 | 
					, _addContact(this, st::btnAddContact)
 | 
				
			||||||
, _cancelSearch(this, st::btnCancelSearch)
 | 
					, _cancelSearch(this, st::btnCancelSearch)
 | 
				
			||||||
| 
						 | 
					@ -883,9 +924,8 @@ DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent)
 | 
				
			||||||
	scroll.setFocusPolicy(Qt::NoFocus);
 | 
						scroll.setFocusPolicy(Qt::NoFocus);
 | 
				
			||||||
	connect(&list, SIGNAL(mustScrollTo(int, int)), &scroll, SLOT(scrollToY(int, int)));
 | 
						connect(&list, SIGNAL(mustScrollTo(int, int)), &scroll, SLOT(scrollToY(int, int)));
 | 
				
			||||||
	connect(&list, SIGNAL(dialogToTopFrom(int)), this, SLOT(onDialogToTopFrom(int)));
 | 
						connect(&list, SIGNAL(dialogToTopFrom(int)), this, SLOT(onDialogToTopFrom(int)));
 | 
				
			||||||
//	connect(&list, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SLOT(onCancel()));
 | 
					 | 
				
			||||||
	connect(&list, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SIGNAL(peerChosen(const PeerId &, MsgId)));
 | 
						connect(&list, SIGNAL(peerChosen(const PeerId &, MsgId)), this, SIGNAL(peerChosen(const PeerId &, MsgId)));
 | 
				
			||||||
	connect(&list, SIGNAL(searchMessages()), this, SLOT(onSearchMessages()));
 | 
						connect(&list, SIGNAL(searchMessages()), this, SLOT(onNeedSearchMessages()));
 | 
				
			||||||
	connect(&scroll, SIGNAL(geometryChanged()), &list, SLOT(onParentGeometryChanged()));
 | 
						connect(&scroll, SIGNAL(geometryChanged()), &list, SLOT(onParentGeometryChanged()));
 | 
				
			||||||
	connect(&scroll, SIGNAL(scrolled()), &list, SLOT(onUpdateSelected()));
 | 
						connect(&scroll, SIGNAL(scrolled()), &list, SLOT(onUpdateSelected()));
 | 
				
			||||||
	connect(&scroll, SIGNAL(scrolled()), this, SLOT(onListScroll()));
 | 
						connect(&scroll, SIGNAL(scrolled()), this, SLOT(onListScroll()));
 | 
				
			||||||
| 
						 | 
					@ -896,16 +936,12 @@ DialogsWidget::DialogsWidget(MainWidget *parent) : QWidget(parent)
 | 
				
			||||||
	connect(&_newGroup, SIGNAL(clicked()), this, SLOT(onNewGroup()));
 | 
						connect(&_newGroup, SIGNAL(clicked()), this, SLOT(onNewGroup()));
 | 
				
			||||||
	connect(&_cancelSearch, SIGNAL(clicked()), this, SLOT(onCancelSearch()));
 | 
						connect(&_cancelSearch, SIGNAL(clicked()), this, SLOT(onCancelSearch()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	_stateSwitcher.addButton(lang(lng_dlg_conversations));
 | 
						_searchTimer.setSingleShot(true);
 | 
				
			||||||
	_stateSwitcher.addButton(lang(lng_dlg_messages));
 | 
						connect(&_searchTimer, SIGNAL(timeout()), this, SLOT(onSearchMessages()));
 | 
				
			||||||
	_stateSwitcher.hide();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	connect(&_stateSwitcher, SIGNAL(changed()), this, SLOT(onStateChange()));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	scroll.show();
 | 
						scroll.show();
 | 
				
			||||||
	_filter.show();
 | 
						_filter.show();
 | 
				
			||||||
	_filter.move(st::dlgPaddingHor, st::dlgFilterPadding);
 | 
						_filter.move(st::dlgPaddingHor, st::dlgFilterPadding);
 | 
				
			||||||
	_stateSwitcher.move(st::dlgPaddingHor, st::dlgFilterPadding * 2 + _filter.height());
 | 
					 | 
				
			||||||
	_filter.setFocusPolicy(Qt::StrongFocus);
 | 
						_filter.setFocusPolicy(Qt::StrongFocus);
 | 
				
			||||||
	_filter.customUpDown(true);
 | 
						_filter.customUpDown(true);
 | 
				
			||||||
	_addContact.hide();
 | 
						_addContact.hide();
 | 
				
			||||||
| 
						 | 
					@ -981,9 +1017,7 @@ void DialogsWidget::onCancel() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::clearFiltered() {
 | 
					void DialogsWidget::clearFiltered() {
 | 
				
			||||||
	if (list.state() != DialogsListWidget::SearchedState) {
 | 
					 | 
				
			||||||
	onCancel();
 | 
						onCancel();
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::unreadCountsReceived(const QVector<MTPDialog> &dialogs) {
 | 
					void DialogsWidget::unreadCountsReceived(const QVector<MTPDialog> &dialogs) {
 | 
				
			||||||
| 
						 | 
					@ -1051,29 +1085,45 @@ bool DialogsWidget::dialogsFailed(const RPCError &e) {
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::onSearchMessages(bool force) {
 | 
					bool DialogsWidget::onSearchMessages(bool searchCache) {
 | 
				
			||||||
	QString q = _filter.text().trimmed();
 | 
						QString q = _filter.text().trimmed();
 | 
				
			||||||
	if (q.isEmpty()) {
 | 
						if (q.isEmpty()) {
 | 
				
			||||||
		if (_searchRequest) {
 | 
							if (_searchRequest) {
 | 
				
			||||||
			MTP::cancel(_searchRequest);
 | 
					 | 
				
			||||||
			_searchRequest = 0;
 | 
								_searchRequest = 0;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (force) {
 | 
							return true;
 | 
				
			||||||
			list.setState(DialogsListWidget::DefaultState);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
		return;
 | 
						if (searchCache) {
 | 
				
			||||||
 | 
							SearchCache::const_iterator i = _searchCache.constFind(q);
 | 
				
			||||||
 | 
							if (i != _searchCache.cend()) {
 | 
				
			||||||
 | 
								_searchQuery = q;
 | 
				
			||||||
 | 
								_searchFull = false;
 | 
				
			||||||
 | 
								_searchRequest = 0;
 | 
				
			||||||
 | 
								searchReceived(true, i.value(), 0);
 | 
				
			||||||
 | 
								return true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	if (force || _searchQuery != q) {
 | 
						} else if (_searchQuery != q) {
 | 
				
			||||||
		if (_searchRequest) MTP::cancel(_searchRequest);
 | 
					 | 
				
			||||||
		_searchQuery = q;
 | 
							_searchQuery = q;
 | 
				
			||||||
		_searchFull = false;
 | 
							_searchFull = false;
 | 
				
			||||||
		_searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, true), rpcFail(&DialogsWidget::searchFailed));
 | 
							_searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, true), rpcFail(&DialogsWidget::searchFailed));
 | 
				
			||||||
 | 
							_searchQueries.insert(_searchRequest, _searchQuery);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return false;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void DialogsWidget::onNeedSearchMessages() {
 | 
				
			||||||
 | 
						if (!onSearchMessages(true)) {
 | 
				
			||||||
 | 
							_searchTimer.start(AutoSearchTimeout);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::onSearchMore(MsgId minMsgId) {
 | 
					void DialogsWidget::onSearchMore(MsgId minMsgId) {
 | 
				
			||||||
	if (!_searchRequest && !_searchFull) {
 | 
						if (!_searchRequest && !_searchFull) {
 | 
				
			||||||
		_searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minMsgId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, !minMsgId), rpcFail(&DialogsWidget::searchFailed));
 | 
							_searchRequest = MTP::send(MTPmessages_Search(MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minMsgId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, !minMsgId), rpcFail(&DialogsWidget::searchFailed));
 | 
				
			||||||
 | 
							if (!minMsgId) {
 | 
				
			||||||
 | 
								_searchQueries.insert(_searchRequest, _searchQuery);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1108,13 +1158,21 @@ bool DialogsWidget::contactsFailed() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::searchReceived(bool fromStart, const MTPmessages_Messages &result, mtpRequestId req) {
 | 
					void DialogsWidget::searchReceived(bool fromStart, const MTPmessages_Messages &result, mtpRequestId req) {
 | 
				
			||||||
 | 
						if (fromStart && (list.state() == DialogsListWidget::FilteredState || list.state() == DialogsListWidget::SearchedState)) {
 | 
				
			||||||
 | 
							SearchQueries::iterator i = _searchQueries.find(req);
 | 
				
			||||||
 | 
							if (i != _searchQueries.cend()) {
 | 
				
			||||||
 | 
								_searchCache[i.value()] = result;
 | 
				
			||||||
 | 
								_searchQueries.erase(i);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (_searchRequest == req) {
 | 
						if (_searchRequest == req) {
 | 
				
			||||||
		switch (result.type()) {
 | 
							switch (result.type()) {
 | 
				
			||||||
		case mtpc_messages_messages: {
 | 
							case mtpc_messages_messages: {
 | 
				
			||||||
			App::feedUsers(result.c_messages_messages().vusers);
 | 
								App::feedUsers(result.c_messages_messages().vusers);
 | 
				
			||||||
			App::feedChats(result.c_messages_messages().vchats);
 | 
								App::feedChats(result.c_messages_messages().vchats);
 | 
				
			||||||
			const QVector<MTPMessage> &msgs(result.c_messages_messages().vmessages.c_vector().v);
 | 
								const QVector<MTPMessage> &msgs(result.c_messages_messages().vmessages.c_vector().v);
 | 
				
			||||||
			list.searchReceived(msgs, fromStart);
 | 
								list.searchReceived(msgs, fromStart, msgs.size());
 | 
				
			||||||
			if (msgs.isEmpty()) {
 | 
								if (msgs.isEmpty()) {
 | 
				
			||||||
				_searchFull = true;
 | 
									_searchFull = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -1124,12 +1182,13 @@ void DialogsWidget::searchReceived(bool fromStart, const MTPmessages_Messages &r
 | 
				
			||||||
			App::feedUsers(result.c_messages_messagesSlice().vusers);
 | 
								App::feedUsers(result.c_messages_messagesSlice().vusers);
 | 
				
			||||||
			App::feedChats(result.c_messages_messagesSlice().vchats);
 | 
								App::feedChats(result.c_messages_messagesSlice().vchats);
 | 
				
			||||||
			const QVector<MTPMessage> &msgs(result.c_messages_messagesSlice().vmessages.c_vector().v);
 | 
								const QVector<MTPMessage> &msgs(result.c_messages_messagesSlice().vmessages.c_vector().v);
 | 
				
			||||||
			list.searchReceived(msgs, fromStart);
 | 
								list.searchReceived(msgs, fromStart, result.c_messages_messagesSlice().vcount.v);
 | 
				
			||||||
			if (msgs.isEmpty()) {
 | 
								if (msgs.isEmpty()) {
 | 
				
			||||||
				_searchFull = true;
 | 
									_searchFull = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} break;
 | 
							} break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		_searchRequest = 0;
 | 
							_searchRequest = 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1167,21 +1226,15 @@ void DialogsWidget::onListScroll() {
 | 
				
			||||||
void DialogsWidget::onFilterUpdate() {
 | 
					void DialogsWidget::onFilterUpdate() {
 | 
				
			||||||
	QString filterText = _filter.text();
 | 
						QString filterText = _filter.text();
 | 
				
			||||||
	list.onFilterUpdate(filterText);
 | 
						list.onFilterUpdate(filterText);
 | 
				
			||||||
	DialogsListWidget::State s = list.state();
 | 
						if (filterText.isEmpty()) {
 | 
				
			||||||
	bool switcherVisible = (s != DialogsListWidget::DefaultState);
 | 
							_searchCache.clear();
 | 
				
			||||||
	if ((switcherVisible && _stateSwitcher.isHidden()) || (!switcherVisible && !_stateSwitcher.isHidden())) {
 | 
							_searchQueries.clear();
 | 
				
			||||||
		if (switcherVisible) {
 | 
							_searchQuery = QString();
 | 
				
			||||||
			_stateSwitcher.show();
 | 
							if (!_cancelSearch.isHidden()) {
 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			_stateSwitcher.hide();
 | 
					 | 
				
			||||||
			_stateSwitcher.setSelected(0);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		resizeEvent(0);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (filterText.isEmpty() && !_cancelSearch.isHidden()) {
 | 
					 | 
				
			||||||
			_cancelSearch.hide();
 | 
								_cancelSearch.hide();
 | 
				
			||||||
			_newGroup.show();
 | 
								_newGroup.show();
 | 
				
			||||||
	} else if (!filterText.isEmpty() && _cancelSearch.isHidden()) {
 | 
							}
 | 
				
			||||||
 | 
						} else if (_cancelSearch.isHidden()) {
 | 
				
			||||||
		_cancelSearch.show();
 | 
							_cancelSearch.show();
 | 
				
			||||||
		_newGroup.hide();
 | 
							_newGroup.hide();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1190,17 +1243,11 @@ void DialogsWidget::onFilterUpdate() {
 | 
				
			||||||
void DialogsWidget::resizeEvent(QResizeEvent *e) {
 | 
					void DialogsWidget::resizeEvent(QResizeEvent *e) {
 | 
				
			||||||
	int32 w = width() - st::dlgShadow;
 | 
						int32 w = width() - st::dlgShadow;
 | 
				
			||||||
	_filter.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding, w - 2 * st::dlgPaddingHor, _filter.height());
 | 
						_filter.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding, w - 2 * st::dlgPaddingHor, _filter.height());
 | 
				
			||||||
	_stateSwitcher.setGeometry(st::dlgPaddingHor, st::dlgFilterPadding * 2 + _filter.height(), _filter.width(), _filter.height());
 | 
					 | 
				
			||||||
	_newGroup.move(w - _newGroup.width() - st::dlgPaddingHor, _filter.y());
 | 
						_newGroup.move(w - _newGroup.width() - st::dlgPaddingHor, _filter.y());
 | 
				
			||||||
	_addContact.move(w - _addContact.width() - st::dlgPaddingHor, _filter.y());
 | 
						_addContact.move(w - _addContact.width() - st::dlgPaddingHor, _filter.y());
 | 
				
			||||||
	_cancelSearch.move(w - _cancelSearch.width() - st::dlgPaddingHor, _filter.y());
 | 
						_cancelSearch.move(w - _cancelSearch.width() - st::dlgPaddingHor, _filter.y());
 | 
				
			||||||
	if (_stateSwitcher.isHidden()) {
 | 
					 | 
				
			||||||
	scroll.move(0, _filter.height() + 2 * st::dlgFilterPadding);
 | 
						scroll.move(0, _filter.height() + 2 * st::dlgFilterPadding);
 | 
				
			||||||
	scroll.resize(w, height() - _filter.y() - _filter.height() - st::dlgFilterPadding - st::dlgPaddingVer);
 | 
						scroll.resize(w, height() - _filter.y() - _filter.height() - st::dlgFilterPadding - st::dlgPaddingVer);
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		scroll.move(0, _filter.height() + _stateSwitcher.height() + 3 * st::dlgFilterPadding);
 | 
					 | 
				
			||||||
		scroll.resize(w, height() - _stateSwitcher.y() - _stateSwitcher.height() - st::dlgFilterPadding - st::dlgPaddingVer);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	list.resize(w, list.height());
 | 
						list.resize(w, list.height());
 | 
				
			||||||
	onListScroll();
 | 
						onListScroll();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1209,7 +1256,7 @@ void DialogsWidget::keyPressEvent(QKeyEvent *e) {
 | 
				
			||||||
	if (e->key() == Qt::Key_Escape) {
 | 
						if (e->key() == Qt::Key_Escape) {
 | 
				
			||||||
		e->ignore();
 | 
							e->ignore();
 | 
				
			||||||
	} else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
 | 
						} else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
 | 
				
			||||||
		if (!list.choosePeer() && list.state() == DialogsListWidget::SearchedState) {
 | 
							if (!list.choosePeer() && (list.state() == DialogsListWidget::SearchedState || list.state() == DialogsListWidget::FilteredState)) {
 | 
				
			||||||
			onSearchMessages();
 | 
								onSearchMessages();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if (e->key() == Qt::Key_Down) {
 | 
						} else if (e->key() == Qt::Key_Down) {
 | 
				
			||||||
| 
						 | 
					@ -1285,25 +1332,6 @@ void DialogsWidget::onCancelSearch() {
 | 
				
			||||||
	onFilterUpdate();
 | 
						onFilterUpdate();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DialogsWidget::onStateChange() {
 | 
					 | 
				
			||||||
	if (!_stateSwitcher.isHidden()) {
 | 
					 | 
				
			||||||
		if (_stateSwitcher.selected() == 0) {
 | 
					 | 
				
			||||||
			list.setState(DialogsListWidget::FilteredState);
 | 
					 | 
				
			||||||
			_searchQuery = QString();
 | 
					 | 
				
			||||||
			if (_searchRequest) {
 | 
					 | 
				
			||||||
				MTP::cancel(_searchRequest);
 | 
					 | 
				
			||||||
				_searchRequest = 0;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			list.setState(DialogsListWidget::SearchedState);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		list.onFilterUpdate(_filter.text());
 | 
					 | 
				
			||||||
		if (list.state() == DialogsListWidget::SearchedState) {
 | 
					 | 
				
			||||||
			onSearchMessages(true);
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void DialogsWidget::onDialogToTopFrom(int movedFrom) {
 | 
					void DialogsWidget::onDialogToTopFrom(int movedFrom) {
 | 
				
			||||||
	if (scroll.scrollTop() > 0) {
 | 
						if (scroll.scrollTop() > 0) {
 | 
				
			||||||
		if (movedFrom > scroll.scrollTop()) {
 | 
							if (movedFrom > scroll.scrollTop()) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ public:
 | 
				
			||||||
	DialogsListWidget(QWidget *parent, MainWidget *main);
 | 
						DialogsListWidget(QWidget *parent, MainWidget *main);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void dialogsReceived(const QVector<MTPDialog> &dialogs);
 | 
						void dialogsReceived(const QVector<MTPDialog> &dialogs);
 | 
				
			||||||
	void searchReceived(const QVector<MTPMessage> &messages, bool fromStart);
 | 
						void searchReceived(const QVector<MTPMessage> &messages, bool fromStart, int32 fullCount);
 | 
				
			||||||
	void showMore(int32 pixels);
 | 
						void showMore(int32 pixels);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void activate();
 | 
						void activate();
 | 
				
			||||||
| 
						 | 
					@ -119,13 +119,10 @@ private:
 | 
				
			||||||
	int32 filteredSel;
 | 
						int32 filteredSel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SearchResults searchResults;
 | 
						SearchResults searchResults;
 | 
				
			||||||
	int32 searchedSel;
 | 
						int32 searchedCount, searchedSel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	State _state;
 | 
						State _state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QTimer _updateSearchTimer;
 | 
					 | 
				
			||||||
	QString _searchQuery;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	QPoint lastMousePos;
 | 
						QPoint lastMousePos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void paintDialog(QPainter &p, DialogRow *dialog);
 | 
						void paintDialog(QPainter &p, DialogRow *dialog);
 | 
				
			||||||
| 
						 | 
					@ -191,10 +188,9 @@ public slots:
 | 
				
			||||||
	void onNewGroup();
 | 
						void onNewGroup();
 | 
				
			||||||
	void onCancelSearch();
 | 
						void onCancelSearch();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void onStateChange();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	void onDialogToTopFrom(int movedFrom);
 | 
						void onDialogToTopFrom(int movedFrom);
 | 
				
			||||||
	void onSearchMessages(bool force = false);
 | 
						bool onSearchMessages(bool searchCache = false);
 | 
				
			||||||
 | 
						void onNeedSearchMessages();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,13 +209,19 @@ private:
 | 
				
			||||||
	mtpRequestId contactsRequest;
 | 
						mtpRequestId contactsRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FlatInput _filter;
 | 
						FlatInput _filter;
 | 
				
			||||||
	Switcher _stateSwitcher;
 | 
					 | 
				
			||||||
	IconedButton _newGroup, _addContact, _cancelSearch;
 | 
						IconedButton _newGroup, _addContact, _cancelSearch;
 | 
				
			||||||
	ScrollArea scroll;
 | 
						ScrollArea scroll;
 | 
				
			||||||
	DialogsListWidget list;
 | 
						DialogsListWidget list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QTimer _searchTimer;
 | 
				
			||||||
	QString _searchQuery;
 | 
						QString _searchQuery;
 | 
				
			||||||
	bool _searchFull;
 | 
						bool _searchFull;
 | 
				
			||||||
	mtpRequestId _searchRequest;
 | 
						mtpRequestId _searchRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						typedef QMap<QString, MTPmessages_Messages> SearchCache;
 | 
				
			||||||
 | 
						SearchCache _searchCache;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						typedef QMap<mtpRequestId, QString> SearchQueries;
 | 
				
			||||||
 | 
						SearchQueries _searchQueries;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -112,7 +112,7 @@ namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const QRegularExpression reDomain(QString::fromUtf8("(?<![A-Za-z\\$0-9А-Яа-яёЁ\\-\\_%=])(?:([a-zA-Z]+)://)?((?:[A-Za-zА-яА-ЯёЁ0-9\\-\\_]+\\.){1,5}([A-Za-zрф\\-\\d]{2,22}))"));
 | 
						const QRegularExpression reDomain(QString::fromUtf8("(?<![A-Za-z\\$0-9А-Яа-яёЁ\\-\\_%=])(?:([a-zA-Z]+)://)?((?:[A-Za-zА-яА-ЯёЁ0-9\\-\\_]+\\.){1,5}([A-Za-zрф\\-\\d]{2,22}))"));
 | 
				
			||||||
	const QRegularExpression reMailName(QString::fromUtf8("[a-zA-Z\\-_\\.0-9]{1,256}$"));
 | 
						const QRegularExpression reMailName(QString::fromUtf8("[a-zA-Z\\-_\\.0-9]{1,256}$"));
 | 
				
			||||||
	const QRegularExpression reMailStart(QString::fromUtf8("[a-zA-Z\\-_\\.0-9]{1,256}\\@"));
 | 
						const QRegularExpression reMailStart(QString::fromUtf8("^[a-zA-Z\\-_\\.0-9]{1,256}\\@"));
 | 
				
			||||||
	QSet<int32> validProtocols, validTopDomains;
 | 
						QSet<int32> validProtocols, validTopDomains;
 | 
				
			||||||
	void initLinkSets();
 | 
						void initLinkSets();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1397,6 +1397,18 @@ void History::loadAround(MsgId msgId) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool History::canShowAround(MsgId msgId) const {
 | 
				
			||||||
 | 
						if (activeMsgId != msgId) {
 | 
				
			||||||
 | 
							if (msgId) {
 | 
				
			||||||
 | 
								HistoryItem *item = App::histItemById(msgId);
 | 
				
			||||||
 | 
								return item && item->block();
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								return loadedAtBottom();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MsgId History::minMsgId() const {
 | 
					MsgId History::minMsgId() const {
 | 
				
			||||||
	for (const_iterator i = cbegin(), e = cend(); i != e; ++i) {
 | 
						for (const_iterator i = cbegin(), e = cend(); i != e; ++i) {
 | 
				
			||||||
		for (HistoryBlock::const_iterator j = (*i)->cbegin(), en = (*i)->cend(); j != en; ++j) {
 | 
							for (HistoryBlock::const_iterator j = (*i)->cbegin(), en = (*i)->cend(); j != en; ++j) {
 | 
				
			||||||
| 
						 | 
					@ -3461,11 +3473,11 @@ void HistoryUnreadBar::setCount(int32 count) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void HistoryUnreadBar::draw(QPainter &p, uint32 selection) const {
 | 
					void HistoryUnreadBar::draw(QPainter &p, uint32 selection) const {
 | 
				
			||||||
	p.fillRect(0, 1, _history->width, st::unreadBarHeight - 2, st::unreadBarBG->b);
 | 
						p.fillRect(0, st::lineWidth, _history->width, st::unreadBarHeight - 2 * st::lineWidth, st::unreadBarBG->b);
 | 
				
			||||||
	p.fillRect(0, st::unreadBarHeight - st::lineWidth, _history->width, st::lineWidth, st::unreadBarBorder->b);
 | 
						p.fillRect(0, st::unreadBarHeight - st::lineWidth, _history->width, st::lineWidth, st::unreadBarBorder->b);
 | 
				
			||||||
	p.setFont(st::unreadBarFont->f);
 | 
						p.setFont(st::unreadBarFont->f);
 | 
				
			||||||
	p.setPen(st::unreadBarColor->p);
 | 
						p.setPen(st::unreadBarColor->p);
 | 
				
			||||||
	p.drawText(QRect(0, 0, _history->width, st::unreadBarHeight - 1), text, style::al_center);
 | 
						p.drawText(QRect(0, 0, _history->width, st::unreadBarHeight - st::lineWidth), text, style::al_center);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int32 HistoryUnreadBar::resize(int32 width) {
 | 
					int32 HistoryUnreadBar::resize(int32 width) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -610,6 +610,7 @@ struct History : public QList<HistoryBlock*> {
 | 
				
			||||||
	void fixLastMessage(bool wasAtBottom);
 | 
						void fixLastMessage(bool wasAtBottom);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void loadAround(MsgId msgId);
 | 
						void loadAround(MsgId msgId);
 | 
				
			||||||
 | 
						bool canShowAround(MsgId msgId) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	MsgId minMsgId() const;
 | 
						MsgId minMsgId() const;
 | 
				
			||||||
	MsgId maxMsgId() const;
 | 
						MsgId maxMsgId() const;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1455,6 +1455,8 @@ HistoryWidget::HistoryWidget(QWidget *parent) : QWidget(parent)
 | 
				
			||||||
    , _scroll(this, st::historyScroll, false)
 | 
					    , _scroll(this, st::historyScroll, false)
 | 
				
			||||||
    , _list(0)
 | 
					    , _list(0)
 | 
				
			||||||
    , hist(0)
 | 
					    , hist(0)
 | 
				
			||||||
 | 
						, _loadingAroundId(-1)
 | 
				
			||||||
 | 
						, _loadingAroundRequest(0)
 | 
				
			||||||
    , _histInited(false)
 | 
					    , _histInited(false)
 | 
				
			||||||
	, _toHistoryEnd(this, st::historyToEnd)
 | 
						, _toHistoryEnd(this, st::historyToEnd)
 | 
				
			||||||
    , _send(this, lang(lng_send_button), st::btnSend)
 | 
					    , _send(this, lang(lng_send_button), st::btnSend)
 | 
				
			||||||
| 
						 | 
					@ -1583,29 +1585,49 @@ void HistoryWidget::chatLoaded(const MTPmessages_ChatFull &res) {
 | 
				
			||||||
	peerUpdated(App::chat(peerId));
 | 
						peerUpdated(App::chat(peerId));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void HistoryWidget::clearLoadingAround() {
 | 
				
			||||||
 | 
						_loadingAroundId = -1;
 | 
				
			||||||
 | 
						if (_loadingAroundRequest) {
 | 
				
			||||||
 | 
							MTP::cancel(_loadingAroundRequest);
 | 
				
			||||||
 | 
							_loadingAroundRequest = 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void HistoryWidget::showPeer(const PeerId &peer, MsgId msgId, bool force, bool leaveActive) {
 | 
					void HistoryWidget::showPeer(const PeerId &peer, MsgId msgId, bool force, bool leaveActive) {
 | 
				
			||||||
	if (App::main()->selectingPeer() && !force) {
 | 
						if (App::main()->selectingPeer() && !force) {
 | 
				
			||||||
		hiderOffered = true;
 | 
							hiderOffered = true;
 | 
				
			||||||
		App::main()->offerPeer(peer);
 | 
							App::main()->offerPeer(peer);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (peer) {
 | 
						if (peer && !msgId) {
 | 
				
			||||||
		App::main()->dialogsClear();
 | 
							App::main()->dialogsClear();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (hist) {
 | 
						if (hist) {
 | 
				
			||||||
		if (histPeer->id == peer) {
 | 
							if (histPeer->id == peer) {
 | 
				
			||||||
			if (hist->unreadBar) hist->unreadBar->destroy();
 | 
					 | 
				
			||||||
			if (msgId != hist->activeMsgId) {
 | 
								if (msgId != hist->activeMsgId) {
 | 
				
			||||||
 | 
									if (!force && !hist->canShowAround(msgId)) {
 | 
				
			||||||
 | 
										if (_loadingAroundId != msgId) {
 | 
				
			||||||
 | 
											clearLoadingAround();
 | 
				
			||||||
 | 
											_loadingAroundId = msgId;
 | 
				
			||||||
 | 
											loadMessagesAround();
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										return;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				hist->loadAround(msgId);
 | 
									hist->loadAround(msgId);
 | 
				
			||||||
				if (histPreloading) MTP::cancel(histPreloading);
 | 
									if (histPreloading) MTP::cancel(histPreloading);
 | 
				
			||||||
				if (histPreloadingDown) MTP::cancel(histPreloadingDown);
 | 
									if (histPreloadingDown) MTP::cancel(histPreloadingDown);
 | 
				
			||||||
				histPreloading = histPreloadingDown = 0;
 | 
									histPreloading = histPreloadingDown = 0;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								if (hist->unreadBar) hist->unreadBar->destroy();
 | 
				
			||||||
			checkUnreadLoaded();
 | 
								checkUnreadLoaded();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								clearLoadingAround();
 | 
				
			||||||
			return activate();
 | 
								return activate();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		updateTyping(false);
 | 
							updateTyping(false);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						clearLoadingAround();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (_list) {
 | 
						if (_list) {
 | 
				
			||||||
		if (!histPreload.isEmpty()) {
 | 
							if (!histPreload.isEmpty()) {
 | 
				
			||||||
			_list->messagesReceived(histPreload);
 | 
								_list->messagesReceived(histPreload);
 | 
				
			||||||
| 
						 | 
					@ -1852,13 +1874,15 @@ bool HistoryWidget::messagesFailed(const RPCError &e, mtpRequestId requestId) {
 | 
				
			||||||
		histPreloading = 0;
 | 
							histPreloading = 0;
 | 
				
			||||||
	} else if (histPreloadingDown == requestId) {
 | 
						} else if (histPreloadingDown == requestId) {
 | 
				
			||||||
		histPreloadingDown = 0;
 | 
							histPreloadingDown = 0;
 | 
				
			||||||
 | 
						} else if (_loadingAroundRequest == requestId) {
 | 
				
			||||||
 | 
							_loadingAroundRequest = 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId) {
 | 
					void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId) {
 | 
				
			||||||
	if (!hist) {
 | 
						if (!hist) {
 | 
				
			||||||
		histPreloading = histPreloadingDown = 0;
 | 
							histPreloading = histPreloadingDown = _loadingAroundRequest = 0;
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1908,6 +1932,17 @@ void HistoryWidget::messagesReceived(const MTPmessages_Messages &messages, mtpRe
 | 
				
			||||||
		histPreloadingDown = 0;
 | 
							histPreloadingDown = 0;
 | 
				
			||||||
		down = true;
 | 
							down = true;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							if (_loadingAroundRequest == requestId) {
 | 
				
			||||||
 | 
								_loadingAroundRequest = 0;
 | 
				
			||||||
 | 
								hist->loadAround(_loadingAroundId);
 | 
				
			||||||
 | 
								if (hist->isEmpty()) {
 | 
				
			||||||
 | 
									addMessagesToFront(*histList);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (histPreloading) MTP::cancel(histPreloading);
 | 
				
			||||||
 | 
								if (histPreloadingDown) MTP::cancel(histPreloadingDown);
 | 
				
			||||||
 | 
								histPreloading = histPreloadingDown = 0;
 | 
				
			||||||
 | 
								showPeer(hist->peer->id, _loadingAroundId, true);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2044,6 +2079,16 @@ void HistoryWidget::loadMessagesDown() {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void HistoryWidget::loadMessagesAround() {
 | 
				
			||||||
 | 
						if (!hist || _loadingAroundRequest || _loadingAroundId < 0) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int32 offset = 0, loadCount = MessagesPerPage;
 | 
				
			||||||
 | 
						if (_loadingAroundId) {
 | 
				
			||||||
 | 
							offset = -loadCount / 2;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						_loadingAroundRequest = MTP::send(MTPmessages_GetHistory(histInputPeer, MTP_int(offset), MTP_int(_loadingAroundId), MTP_int(loadCount)), rpcDone(&HistoryWidget::messagesReceived), rpcFail(&HistoryWidget::messagesFailed));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void HistoryWidget::onListScroll() {
 | 
					void HistoryWidget::onListScroll() {
 | 
				
			||||||
	App::checkImageCacheSize();
 | 
						App::checkImageCacheSize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -272,6 +272,7 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void loadMessages();
 | 
						void loadMessages();
 | 
				
			||||||
	void loadMessagesDown();
 | 
						void loadMessagesDown();
 | 
				
			||||||
 | 
						void loadMessagesAround();
 | 
				
			||||||
	void peerMessagesUpdated(PeerId peer);
 | 
						void peerMessagesUpdated(PeerId peer);
 | 
				
			||||||
	void peerMessagesUpdated();
 | 
						void peerMessagesUpdated();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -352,6 +353,7 @@ public slots:
 | 
				
			||||||
	void onPhotoReady();
 | 
						void onPhotoReady();
 | 
				
			||||||
	void onPhotoFailed(quint64 id);
 | 
						void onPhotoFailed(quint64 id);
 | 
				
			||||||
	void showPeer(const PeerId &peer, MsgId msgId = 0, bool force = false, bool leaveActive = false);
 | 
						void showPeer(const PeerId &peer, MsgId msgId = 0, bool force = false, bool leaveActive = false);
 | 
				
			||||||
 | 
						void clearLoadingAround();
 | 
				
			||||||
	void activate();
 | 
						void activate();
 | 
				
			||||||
	void onTextChange();
 | 
						void onTextChange();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -394,6 +396,9 @@ private:
 | 
				
			||||||
	mtpRequestId histPreloading, histPreloadingDown;
 | 
						mtpRequestId histPreloading, histPreloadingDown;
 | 
				
			||||||
	QVector<MTPMessage> histPreload, histPreloadDown;
 | 
						QVector<MTPMessage> histPreload, histPreloadDown;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						int32 _loadingAroundId;
 | 
				
			||||||
 | 
						mtpRequestId _loadingAroundRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ScrollArea _scroll;
 | 
						ScrollArea _scroll;
 | 
				
			||||||
	HistoryList *_list;
 | 
						HistoryList *_list;
 | 
				
			||||||
	History *hist;
 | 
						History *hist;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -566,6 +566,11 @@ namespace MTP {
 | 
				
			||||||
		return mtpAuthed();
 | 
							return mtpAuthed();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail) {
 | 
				
			||||||
 | 
							mtpRequestId req = MTP::send(MTPauth_LogOut(), onDone, onFail);
 | 
				
			||||||
 | 
							mtpLogoutOtherDCs();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void setGlobalDoneHandler(RPCDoneHandlerPtr handler) {
 | 
						void setGlobalDoneHandler(RPCDoneHandlerPtr handler) {
 | 
				
			||||||
		globalHandler.onDone = handler;
 | 
							globalHandler.onDone = handler;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,6 +93,7 @@ namespace MTP {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void authed(int32 uid);
 | 
						void authed(int32 uid);
 | 
				
			||||||
	int32 authedId();
 | 
						int32 authedId();
 | 
				
			||||||
 | 
						void logoutKeys(RPCDoneHandlerPtr onDone, RPCFailHandlerPtr onFail);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void setGlobalDoneHandler(RPCDoneHandlerPtr handler);
 | 
						void setGlobalDoneHandler(RPCDoneHandlerPtr handler);
 | 
				
			||||||
	void setGlobalFailHandler(RPCFailHandlerPtr handler);
 | 
						void setGlobalFailHandler(RPCFailHandlerPtr handler);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -323,6 +323,19 @@ int32 mtpMainDC() {
 | 
				
			||||||
	return mainDC;
 | 
						return mainDC;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void mtpLogoutOtherDCs() {
 | 
				
			||||||
 | 
						QList<int32> dcs;
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QMutexLocker lock(&_keysMapForWriteMutex);
 | 
				
			||||||
 | 
							dcs = _keysMapForWrite.keys();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for (int32 i = 0, cnt = dcs.size(); i != cnt; ++i) {
 | 
				
			||||||
 | 
							if (dcs[i] != MTP::maindc()) {
 | 
				
			||||||
 | 
								MTP::send(MTPauth_LogOut(), RPCResponseHandler(), dcs[i]);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void mtpSetDC(int32 dc) {
 | 
					void mtpSetDC(int32 dc) {
 | 
				
			||||||
	if (dc != mainDC) {
 | 
						if (dc != mainDC) {
 | 
				
			||||||
		mainDC = dc;
 | 
							mainDC = dc;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -97,6 +97,7 @@ const mtpDcOptions &mtpDCOptions();
 | 
				
			||||||
MTProtoDCMap &mtpDCMap();
 | 
					MTProtoDCMap &mtpDCMap();
 | 
				
			||||||
bool mtpNeedConfig();
 | 
					bool mtpNeedConfig();
 | 
				
			||||||
int32 mtpMainDC();
 | 
					int32 mtpMainDC();
 | 
				
			||||||
 | 
					void mtpLogoutOtherDCs();
 | 
				
			||||||
void mtpSetDC(int32 dc);
 | 
					void mtpSetDC(int32 dc);
 | 
				
			||||||
uint32 mtpMaxChatSize();
 | 
					uint32 mtpMaxChatSize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1528,29 +1528,7 @@
 | 
				
			||||||
    </CustomBuild>
 | 
					    </CustomBuild>
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Image Include="SourceFiles\art\icon.png">
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
    <Image Include="SourceFiles\art\iconf.png">
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
    <Image Include="SourceFiles\art\iconround256.ico" />
 | 
					    <Image Include="SourceFiles\art\iconround256.ico" />
 | 
				
			||||||
    <Image Include="SourceFiles\art\sysicons.png">
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
  </ItemGroup>
 | 
					 | 
				
			||||||
  <ItemGroup>
 | 
					 | 
				
			||||||
    <Font Include="SourceFiles\art\segoe_ui.ttf">
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Deploy|Win32'">true</ExcludedFromBuild>
 | 
					 | 
				
			||||||
    </Font>
 | 
					 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <ResourceCompile Include="Telegram.rc" />
 | 
					    <ResourceCompile Include="Telegram.rc" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -908,22 +908,8 @@
 | 
				
			||||||
    </CustomBuild>
 | 
					    </CustomBuild>
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Image Include="SourceFiles\art\icon.png">
 | 
					 | 
				
			||||||
      <Filter>Resource Files</Filter>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
    <Image Include="SourceFiles\art\sysicons.png">
 | 
					 | 
				
			||||||
      <Filter>Resource Files</Filter>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
    <Image Include="SourceFiles\art\iconf.png">
 | 
					 | 
				
			||||||
      <Filter>Resource Files</Filter>
 | 
					 | 
				
			||||||
    </Image>
 | 
					 | 
				
			||||||
    <Image Include="SourceFiles\art\iconround256.ico" />
 | 
					    <Image Include="SourceFiles\art\iconround256.ico" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					 | 
				
			||||||
    <Font Include="SourceFiles\art\segoe_ui.ttf">
 | 
					 | 
				
			||||||
      <Filter>Resource Files</Filter>
 | 
					 | 
				
			||||||
    </Font>
 | 
					 | 
				
			||||||
  </ItemGroup>
 | 
					 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <ResourceCompile Include="Telegram.rc" />
 | 
					    <ResourceCompile Include="Telegram.rc" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue