new history loading (one-request loading always), fixed audio unlistened status on media send, fixed flac playing, fixed os x crashes, version 0.8.40.dev

This commit is contained in:
John Preston 2015-07-17 22:17:37 +03:00
parent e193a86eaa
commit c786a2bf9c
32 changed files with 1014 additions and 1097 deletions

View File

@ -134,7 +134,7 @@ Open **VS2013 x86 Native Tools Command Prompt.bat** (should be in **\\Program Fi
PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
./configure --toolchain=msvc --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:/d/TBuild/Libraries/opus/win32/VS2010/Win32/Release celt.lib silk_common.lib silk_float.lib"
./configure --toolchain=msvc --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-decoder=flac --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-parser=flac --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=flac --enable-muxer=ogg --enable-muxer=opus --extra-ldflags="-libpath:/d/TBuild/Libraries/opus/win32/VS2010/Win32/Release celt.lib silk_common.lib silk_float.lib"
make
make install

View File

@ -50,7 +50,7 @@ Download sources [ffmpeg-2.6.3.tar.bz2](http://ffmpeg.org/releases/ffmpeg-2.6.3.
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev
sudo apt-get install yasm
./configure --prefix=/usr/local --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-muxer=ogg --enable-muxer=opus
./configure --prefix=/usr/local --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-decoder=flac --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-parser=flac --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=flac --enable-muxer=ogg --enable-muxer=opus
make
sudo make install

View File

@ -1,10 +1,10 @@
@echo OFF
set "AppVersionStrMajor=0.8"
set "AppVersion=8039"
set "AppVersionStrSmall=0.8.39"
set "AppVersionStr=0.8.39"
set "AppVersionStrFull=0.8.39.0"
set "AppVersion=8040"
set "AppVersionStrSmall=0.8.40"
set "AppVersionStr=0.8.40"
set "AppVersionStrFull=0.8.40.0"
set "DevChannel=1"
if %DevChannel% neq 0 goto preparedev

View File

@ -654,8 +654,8 @@ void Application::checkMapVersion() {
psRegisterCustomScheme();
if (Local::oldMapVersion()) {
QString versionFeatures;
if (DevChannel && Local::oldMapVersion() < 8039) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Moved to Qt 5.5\n\xe2\x80\x94 Some bugfixes and optimizations\n\xe2\x80\x94 In OS X 10.10.3 location marks sent from mobile should be displayed now");// .replace('@', qsl("@") + QChar(0x200D));
if (DevChannel && Local::oldMapVersion() < 8040) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Fixed critical Qt bug in image scale\n\xe2\x80\x94 Huge amount of unread messages are loaded much faster\n\xe2\x80\x94 Flac audio files are played in-app\n\xe2\x80\x94 Some bugfixes and optimizations");// .replace('@', qsl("@") + QChar(0x200D));
} else if (!DevChannel && Local::oldMapVersion() < 8038) {
versionFeatures = lang(lng_new_version_text).trimmed();
}

View File

@ -1072,6 +1072,8 @@ public:
int res = 0;
char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
if ((res = avformat_open_input(&fmtContext, 0, 0, 0)) < 0) {
ioBuffer = 0;
LOG(("Audio Error: Unable to avformat_open_input for file '%1', data size '%2', error %3, %4").arg(fname).arg(data.size()).arg(res).arg(av_make_error_string(err, sizeof(err), res)));
return false;
}

View File

@ -285,7 +285,7 @@ void AddContactBox::onImportDone(const MTPcontacts_ImportedContacts &res) {
}
if (uid) {
App::main()->addNewContact(uid);
App::main()->showPeer(App::peerFromUser(uid));
App::main()->choosePeer(App::peerFromUser(uid), ShowAtUnreadMsgId);
App::wnd()->hideLayer();
} else {
_addButton.hide();

View File

@ -96,7 +96,7 @@ void ContactsInner::onAddBot() {
MTP::send(MTPmessages_StartBot(_bot->inputUser, MTP_int(App::chatFromPeer(_addToChat->id)), MTP_long(randomId), MTP_string(_bot->botInfo->startGroupToken)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _bot));
App::wnd()->hideLayer();
App::main()->showPeer(_addToChat->id, 0, false);
App::main()->showPeerHistory(_addToChat->id, ShowAtUnreadMsgId);
} else {
App::main()->addParticipants(_addToChat, QVector<UserData*>(1, _bot));
}
@ -461,7 +461,7 @@ void ContactsInner::chooseParticipant() {
App::wnd()->replaceLayer(box);
} else {
App::wnd()->hideSettings(true);
App::main()->showPeer(peer->id, 0, false, true);
App::main()->choosePeer(peer->id, ShowAtUnreadMsgId);
App::wnd()->hideLayer();
}
}
@ -1149,7 +1149,7 @@ void ContactsBox::onNext() {
_filter.setFocus();
_filter.notaBene();
} else if (v.size() == 1) {
App::main()->showPeer(_inner.selectedUser()->id);
App::main()->showPeerHistory(_inner.selectedUser()->id, ShowAtUnreadMsgId);
} else {
App::wnd()->replaceLayer(new CreateGroupBox(users));
}
@ -1258,7 +1258,7 @@ void CreateGroupBox::created(const MTPUpdates &updates) {
} break;
}
if (v && !v->isEmpty() && v->front().type() == mtpc_chat) {
App::main()->showPeer(App::peerFromChat(v->front().c_chat().vid.v));
App::main()->choosePeer(App::peerFromChat(v->front().c_chat().vid.v), ShowAtUnreadMsgId);
}
}

View File

@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
*/
#pragma once
static const int32 AppVersion = 8039;
static const wchar_t *AppVersionStr = L"0.8.39";
static const int32 AppVersion = 8040;
static const wchar_t *AppVersionStr = L"0.8.40";
static const bool DevChannel = true;
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";

View File

@ -1094,7 +1094,7 @@ void DialogsListWidget::loadPeerPhotos(int32 yFrom) {
bool DialogsListWidget::choosePeer() {
History *history = 0;
MsgId msgId = 0;
MsgId msgId = ShowAtUnreadMsgId;
if (_state == DefaultState) {
if (sel) history = sel->history;
} else if (_state == FilteredState || _state == SearchedState) {
@ -1133,11 +1133,11 @@ bool DialogsListWidget::choosePeer() {
}
}
if (history) {
if (msgId) {
if (msgId > 0) {
saveRecentHashtags(filter);
}
bool chosen = (!App::main()->selectingPeer(true) && (_state == FilteredState || _state == SearchedState) && filteredSel >= 0 && filteredSel < filterResults.size());
App::main()->showPeer(history->peer->id, msgId);
App::main()->choosePeer(history->peer->id, msgId);
if (chosen) {
emit searchResultChosen();
}
@ -1204,11 +1204,11 @@ void DialogsListWidget::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData
}
if (i.value()->prev) {
outPeer = i.value()->prev->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
} else if (dialogs.list.count) {
outPeer = dialogs.list.end->prev->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
outPeer = 0;
@ -1217,7 +1217,7 @@ void DialogsListWidget::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData
}
if (i.value()->prev) {
outPeer = i.value()->prev->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
} else if (_state == FilteredState || _state == SearchedState) {
@ -1231,7 +1231,7 @@ void DialogsListWidget::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData
}
}
if (searchResults.at(0)->_item->history()->peer == inPeer && searchResults.at(0)->_item->id == inMsg) {
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
if (peopleResults.isEmpty()) {
if (filterResults.isEmpty()) {
outPeer = 0;
@ -1246,14 +1246,14 @@ void DialogsListWidget::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData
}
if (!peopleResults.isEmpty() && peopleResults.at(0) == inPeer) {
outPeer = filterResults.isEmpty() ? 0 : filterResults.back()->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
if (!peopleResults.isEmpty()) {
for (PeopleResults::const_iterator b = peopleResults.cbegin(), i = b + 1, e = peopleResults.cend(); i != e; ++i) {
if ((*i) == inPeer) {
outPeer = (*(i - 1));
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
}
@ -1267,7 +1267,7 @@ void DialogsListWidget::peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData
for (FilteredDialogs::const_iterator b = filterResults.cbegin(), i = b + 1, e = filterResults.cend(); i != e; ++i) {
if ((*i)->history->peer == inPeer) {
outPeer = (*(i - 1))->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
}
@ -1288,7 +1288,7 @@ void DialogsListWidget::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData
}
if (i.value()->next != contactsNoDialogs.list.end) {
outPeer = i.value()->next->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
outPeer = 0;
@ -1298,11 +1298,11 @@ void DialogsListWidget::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData
if (i.value()->next != dialogs.list.end) {
outPeer = i.value()->next->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
} else if (contactsNoDialogs.list.count) {
outPeer = contactsNoDialogs.list.begin->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
return;
}
} else if (_state == FilteredState || _state == SearchedState) {
@ -1324,7 +1324,7 @@ void DialogsListWidget::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData
outMsg = searchResults.front()->_item->id;
} else {
outPeer = (i == e) ? 0 : (*i);
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
}
return;
}
@ -1334,13 +1334,13 @@ void DialogsListWidget::peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData
++i;
if (i == e && !peopleResults.isEmpty()) {
outPeer = peopleResults.front();
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
} else if (i == e && !searchResults.isEmpty()) {
outPeer = searchResults.front()->_item->history()->peer;
outMsg = searchResults.front()->_item->id;
} else {
outPeer = (i == e) ? 0 : (*i)->history->peer;
outMsg = 0;
outMsg = ShowAtUnreadMsgId;
}
return;
}
@ -1454,10 +1454,6 @@ void DialogsWidget::dialogsToUp() {
}
}
void DialogsWidget::setInnerFocus() {
_filter.setFocus();
}
void DialogsWidget::animShow(const QPixmap &bgAnimCache) {
_bgAnimCache = bgAnimCache;
_animCache = myGrab(this, rect());

View File

@ -193,8 +193,6 @@ public:
void animShow(const QPixmap &bgAnimCache);
bool animStep(float64 ms);
void setInnerFocus();
void destroyData();
void peerBefore(const PeerData *inPeer, MsgId inMsg, PeerData *&outPeer, MsgId &outMsg) const;

View File

@ -47,7 +47,7 @@ ScrollBar::ScrollBar(ScrollArea *parent, bool vert, const style::flatScroll *st)
_hideTimer.setSingleShot(true);
connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(onHideTimer()));
connect(_connected, SIGNAL(valueChanged(int)), this, SLOT(updateBar()));
connect(_connected, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged()));
connect(_connected, SIGNAL(rangeChanged(int, int)), this, SLOT(updateBar()));
updateBar();
@ -57,6 +57,11 @@ void ScrollBar::recountSize() {
setGeometry(_vertical ? QRect(rtl() ? 0 : (_area->width() - _st->width), _st->deltat, _st->width, _area->height() - _st->deltat - _st->deltab) : QRect(_st->deltat, _area->height() - _st->width, _area->width() - _st->deltat - _st->deltab, _st->width));
}
void ScrollBar::onValueChanged() {
_area->onScrolled();
updateBar();
}
void ScrollBar::updateBar(bool force) {
QRect newBar;
if (_connected->maximum() != _scrollMax) {
@ -266,8 +271,6 @@ _touchScrollState(TouchScrollManual), _touchPrevPosValid(false), _touchWaitingAc
_touchSpeedTime(0), _touchAccelerationTime(0), _touchTime(0), _widgetAcceptsTouch(false) {
setLayoutDirection(cLangDir());
connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(onScrolled()));
connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(onScrolled()));
connect(&vert, SIGNAL(topShadowVisibility(bool)), &topSh, SLOT(changeVisibility(bool)));
connect(&vert, SIGNAL(bottomShadowVisibility(bool)), &bottomSh, SLOT(changeVisibility(bool)));
vert.updateBar(true);
@ -297,6 +300,8 @@ void ScrollArea::touchDeaccelerate(int32 elapsed) {
}
void ScrollArea::onScrolled() {
myEnsureResized(widget());
bool em = false;
int32 horValue = horizontalScrollBar()->value(), vertValue = verticalScrollBar()->value();
if (_horValue != horValue) {
@ -325,27 +330,29 @@ void ScrollArea::onScrolled() {
}
int ScrollArea::scrollWidth() const {
return scrollLeftMax() + width();
QWidget *w(widget());
return w ? qMax(w->width(), width()) : width();
}
int ScrollArea::scrollHeight() const {
return scrollTopMax() + height();
QWidget *w(widget());
return w ? qMax(w->height(), height()) : height();
}
int ScrollArea::scrollLeftMax() const {
return horizontalScrollBar()->maximum();
return scrollWidth() - width();
}
int ScrollArea::scrollTopMax() const {
return verticalScrollBar()->maximum();
return scrollHeight() - height();
}
int ScrollArea::scrollLeft() const {
return horizontalScrollBar()->value();
return _horValue;
}
int ScrollArea::scrollTop() const {
return verticalScrollBar()->value();
return _vertValue;
}
void ScrollArea::onTouchTimer() {
@ -612,6 +619,8 @@ void ScrollArea::leaveEvent(QEvent *e) {
}
void ScrollArea::scrollToY(int toTop, int toBottom) {
myEnsureResized(widget());
int toMin = 0, toMax = scrollTopMax();
if (toTop < toMin) {
toTop = toMin;

View File

@ -70,6 +70,7 @@ public:
public slots:
void onValueChanged();
void updateBar(bool force = false);
void onHideTimer();

View File

@ -34,12 +34,16 @@ namespace {
}
}
void myEnsureResized(QWidget *target) {
if (target && (target->testAttribute(Qt::WA_PendingResizeEvent) || !target->testAttribute(Qt::WA_WState_Created))) {
_sendResizeEvents(target);
}
}
QPixmap myGrab(QWidget *target, const QRect &rect) {
if (!cRetina()) return target->grab(rect);
if (target->testAttribute(Qt::WA_PendingResizeEvent) || !target->testAttribute(Qt::WA_WState_Created)) {
_sendResizeEvents(target);
}
myEnsureResized(target);
qreal dpr = App::app()->devicePixelRatio();
QPixmap result(rect.size() * dpr);

View File

@ -174,4 +174,5 @@ private:
};
void myEnsureResized(QWidget *target);
QPixmap myGrab(QWidget *target, const QRect &rect);

View File

@ -305,10 +305,10 @@ History::History(const PeerId &peerId) : width(0), height(0)
, oldLoaded(false)
, newLoaded(true)
, lastMsg(0)
, activeMsgId(0)
, draftToId(0)
, lastWidth(0)
, lastScrollTop(History::ScrollMax)
, lastShowAtMsgId(ShowAtUnreadMsgId)
, mute(isNotifyMuted(peer->notify))
, lastKeyboardInited(false)
, lastKeyboardUsed(false)
@ -1010,7 +1010,7 @@ void History::addToFront(const QVector<MTPMessage> &slice) {
block->height += dayItem->resize(width);
}
if (block->size()) {
if (wasMsgCount < unreadCount && msgCount >= unreadCount && !activeMsgId) {
if (loadedAtBottom() && wasMsgCount < unreadCount && msgCount >= unreadCount) {
for (int32 i = block->size(); i > 0; --i) {
if ((*block)[i - 1]->itemType() == HistoryItem::MsgType) {
++wasMsgCount;
@ -1233,6 +1233,7 @@ void History::inboxRead(int32 upTo) {
if (!dialogs.isEmpty()) {
if (App::main()) App::main()->dlgUpdated(dialogs[0]);
}
showFrom = 0;
App::wnd()->notifyClear(this);
clearNotifications();
}
@ -1254,7 +1255,7 @@ void History::outboxRead(HistoryItem *wasRead) {
void History::setUnreadCount(int32 newUnreadCount, bool psUpdate) {
if (unreadCount != newUnreadCount) {
if (!unreadCount && newUnreadCount == 1 && loadedAtBottom()) {
if (newUnreadCount == 1 && loadedAtBottom()) {
showFrom = isEmpty() ? 0 : back()->back();
} else if (!newUnreadCount) {
showFrom = 0;
@ -1283,10 +1284,6 @@ void History::setMsgCount(int32 newMsgCount) {
}
void History::getNextShowFrom(HistoryBlock *block, int32 i) {
if (!loadedAtBottom()) {
showFrom = 0;
return;
}
if (i >= 0) {
int32 l = block->size();
for (++i; i < l; ++i) {
@ -1313,7 +1310,7 @@ void History::getNextShowFrom(HistoryBlock *block, int32 i) {
}
void History::addUnreadBar() {
if (unreadBar || !showFrom || !unreadCount || !loadedAtBottom()) return;
if (unreadBar || !showFrom || showFrom->detached() || !unreadCount) return;
HistoryBlock *block = showFrom->block();
int32 i = block->indexOf(showFrom);
@ -1341,10 +1338,6 @@ void History::clearNotifications() {
notifies.clear();
}
bool History::readyForWork() const {
return activeMsgId ? !isEmpty() : (unreadCount <= msgCount);
}
bool History::loadedAtBottom() const {
return newLoaded;
}
@ -1353,6 +1346,28 @@ bool History::loadedAtTop() const {
return oldLoaded;
}
bool History::isReadyFor(MsgId msgId, bool check) const {
if (msgId == ShowAtTheEndMsgId) {
return loadedAtBottom();
} else if (msgId == ShowAtUnreadMsgId) {
return check ? (loadedAtBottom() && (msgCount >= unreadCount)) : !isEmpty();
} else if (check) {
HistoryItem *item = App::histItemById(msgId);
return item && item->history() == this && !item->detached();
}
return !isEmpty();
}
void History::getReadyFor(MsgId msgId) {
if (!isReadyFor(msgId, true)) {
clear(true);
newLoaded = (msgId == ShowAtTheEndMsgId) || (lastMsg && !lastMsg->detached());
oldLoaded = false;
lastWidth = 0;
lastShowAtMsgId = msgId;
}
}
void History::fixLastMessage(bool wasAtBottom) {
if (wasAtBottom && isEmpty()) {
wasAtBottom = false;
@ -1367,37 +1382,6 @@ void History::fixLastMessage(bool wasAtBottom) {
}
}
void History::loadAround(MsgId msgId) {
if (activeMsgId != msgId) {
activeMsgId = msgId;
lastWidth = 0;
if (activeMsgId) {
HistoryItem *item = App::histItemById(activeMsgId);
if (!item || !item->block()) {
clear(true);
}
newLoaded = lastMsg && !lastMsg->detached();
} else {
if (!loadedAtBottom()) {
clear(true);
}
newLoaded = isEmpty() || (lastMsg && !lastMsg->detached());
}
}
}
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 {
for (const_iterator i = cbegin(), e = cend(); i != e; ++i) {
for (HistoryBlock::const_iterator j = (*i)->cbegin(), en = (*i)->cend(); j != en; ++j) {
@ -5184,18 +5168,16 @@ void HistoryMessage::setMedia(const MTPmessageMedia &media) {
void HistoryMessage::draw(QPainter &p, uint32 selection) const {
textstyleSet(&(out() ? st::outTextStyle : st::inTextStyle));
if (id == _history->activeMsgId) {
uint64 ms = App::main() ? App::main()->animActiveTime() : 0;
if (ms) {
if (ms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
float64 dt = (ms > st::activeFadeInDuration) ? (1 - (ms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (ms / float64(st::activeFadeInDuration));
float64 o = p.opacity();
p.setOpacity(o * dt);
p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b);
p.setOpacity(o);
}
uint64 ms = App::main() ? App::main()->animActiveTime(id) : 0;
if (ms) {
if (ms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
float64 dt = (ms > st::activeFadeInDuration) ? (1 - (ms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (ms / float64(st::activeFadeInDuration));
float64 o = p.opacity();
p.setOpacity(o * dt);
p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b);
p.setOpacity(o);
}
}
@ -6108,19 +6090,17 @@ QString HistoryServiceMsg::inReplyText() const {
}
void HistoryServiceMsg::draw(QPainter &p, uint32 selection) const {
if (id == _history->activeMsgId) {
uint64 ms = App::main() ? App::main()->animActiveTime() : 0;
if (ms) {
if (ms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
textstyleSet(&st::inTextStyle);
float64 dt = (ms > st::activeFadeInDuration) ? (1 - (ms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (ms / float64(st::activeFadeInDuration));
float64 o = p.opacity();
p.setOpacity(o * dt);
p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b);
p.setOpacity(o);
}
uint64 ms = App::main() ? App::main()->animActiveTime(id) : 0;
if (ms) {
if (ms > st::activeFadeInDuration + st::activeFadeOutDuration) {
App::main()->stopAnimActive();
} else {
textstyleSet(&st::inTextStyle);
float64 dt = (ms > st::activeFadeInDuration) ? (1 - (ms - st::activeFadeInDuration) / float64(st::activeFadeOutDuration)) : (ms / float64(st::activeFadeInDuration));
float64 o = p.opacity();
p.setOpacity(o * dt);
p.fillRect(0, 0, _history->width, _height, textstyleCurrent()->selectOverlay->b);
p.setOpacity(o);
}
}

View File

@ -180,15 +180,13 @@ struct History : public QList<HistoryBlock*> {
void addUnreadBar();
void clearNotifications();
bool readyForWork() const; // all unread loaded or loaded around activeMsgId
bool loadedAtBottom() const; // last message is in the list
bool loadedAtTop() const; // nothing was added after loading history back
bool isReadyFor(MsgId msgId, bool check = false) const; // has messages for showing history at msgId
void getReadyFor(MsgId msgId);
void fixLastMessage(bool wasAtBottom);
void loadAround(MsgId msgId);
bool canShowAround(MsgId msgId) const;
MsgId minMsgId() const;
MsgId maxMsgId() const;
@ -201,7 +199,6 @@ struct History : public QList<HistoryBlock*> {
PeerData *peer;
bool oldLoaded, newLoaded;
HistoryItem *lastMsg;
MsgId activeMsgId;
typedef QList<HistoryItem*> NotifyQueue;
NotifyQueue notifies;
@ -251,6 +248,7 @@ struct History : public QList<HistoryBlock*> {
MessageCursor draftCursor;
bool draftPreviewCancelled;
int32 lastWidth, lastScrollTop;
MsgId lastShowAtMsgId;
bool mute;
bool lastKeyboardInited, lastKeyboardUsed;

File diff suppressed because it is too large Load Diff

View File

@ -82,6 +82,7 @@ public:
void updateBotInfo(bool recount = true);
bool wasSelectedText() const;
void setFirstLoading(bool loading);
~HistoryList();
@ -130,6 +131,8 @@ private:
ScrollArea *scrollArea;
int32 currentBlock, currentItem;
bool _firstLoading;
QTimer linkTipTimer;
Qt::CursorShape _cursor;
@ -343,6 +346,7 @@ public:
void start();
void messagesReceived(const MTPmessages_Messages &messages, mtpRequestId requestId);
void historyLoaded();
void windowShown();
bool isActive() const;
@ -369,7 +373,8 @@ public:
void loadMessages();
void loadMessagesDown();
void loadMessagesAround();
void firstLoadMessages();
void delayedShowAt(MsgId showAtMsgId);
void peerMessagesUpdated(PeerId peer);
void peerMessagesUpdated();
@ -397,7 +402,6 @@ public:
void confirmSendImage(const ReadyLocalMedia &img);
void cancelSendImage();
void checkUnreadLoaded(bool checkOnlyShow = false);
void updateControlsVisibility();
void updateOnlineDisplay(int32 x, int32 w);
void updateOnlineDisplayTimer();
@ -408,10 +412,7 @@ public:
void shareContact(const PeerId &peer, const QString &phone, const QString &fname, const QString &lname, MsgId replyTo, int32 userId = 0);
PeerData *peer() const;
PeerData *activePeer() const;
MsgId activeMsgId() const;
int32 lastWidth() const;
int32 lastScrollTop() const;
MsgId msgId() const;
void animShow(const QPixmap &bgAnimCache, const QPixmap &bgAnimTopBarCache, bool back = false);
bool showStep(float64 ms);
@ -427,7 +428,7 @@ public:
QString prepareMessage(QString text);
uint64 animActiveTime() const;
uint64 animActiveTime(MsgId id) const;
void stopAnimActive();
void fillSelectedItems(SelectedItemSet &sel, bool forDelete = true);
@ -470,6 +471,11 @@ public:
DragState getDragState(const QMimeData *d);
void fastShowAtEnd(History *h);
void showPeerHistory(const PeerId &peer, MsgId showAtMsgId);
void clearDelayedShowAt();
void clearAllLoadRequests();
~HistoryWidget();
signals:
@ -523,8 +529,7 @@ public slots:
void onSendConfirmed();
void onSendCancelled();
void onPhotoFailed(quint64 id);
void showPeer(const PeerId &peer, MsgId msgId = 0, bool force = false, bool leaveActive = false);
void clearLoadingAround();
void activate();
void onMentionHashtagOrBotCommandInsert(QString str);
void onTextChange();
@ -595,6 +600,8 @@ private:
void addMessagesToFront(const QVector<MTPMessage> &messages);
void addMessagesToBack(const QVector<MTPMessage> &messages);
void countHistoryShowFrom();
void updateToEndVisibility();
void stickersGot(const MTPmessages_AllStickers &stickers);
@ -609,21 +616,20 @@ private:
void updateDragAreas();
bool _loadingMessages;
int32 histRequestsCount;
PeerData *histPeer;
History *_activeHist;
MTPinputPeer histInputPeer;
mtpRequestId histPreloading, histPreloadingDown;
QVector<MTPMessage> histPreload, histPreloadDown;
PeerData *_peer;
MsgId _showAtMsgId;
int32 _loadingAroundId;
mtpRequestId _loadingAroundRequest;
mtpRequestId _firstLoadRequest, _preloadRequest, _preloadDownRequest;
MsgId _delayedShowAtMsgId;
mtpRequestId _delayedShowAtRequest;
MsgId _activeAnimMsgId;
ScrollArea _scroll;
HistoryList *_list;
History *hist;
bool _histInited, _histNeedUpdate; // initial updateListSize() called
History *_history;
bool _histInited; // initial updateListSize() called
IconedButton _toHistoryEnd;
@ -656,19 +662,17 @@ private:
int32 _selCount; // < 0 - text selected, focus list, not _field
LocalImageLoader imageLoader;
LocalImageLoader _imageLoader;
bool _synthedTextUpdate;
int64 serviceImageCacheSize;
QImage confirmImage;
PhotoId confirmImageId;
bool confirmWithText;
QString confirmSource;
int64 _serviceImageCacheSize;
QImage _confirmImage;
PhotoId _confirmImageId;
bool _confirmWithText;
QString _confirmSource;
QString titlePeerText;
int32 titlePeerTextWidth;
bool hiderOffered;
QString _titlePeerText;
int32 _titlePeerTextWidth;
Animation _showAnim;
QPixmap _animCache, _bgAnimCache, _animTopBarCache, _bgAnimTopBarCache;

View File

@ -100,7 +100,7 @@ void TopBarWidget::onDeleteContactSure() {
PeerData *p = App::main() ? App::main()->profilePeer() : 0;
UserData *u = (p && !p->chat) ? p->asUser() : 0;
if (u) {
App::main()->showPeer(0, 0, true);
App::main()->showDialogs();
App::wnd()->hideLayer();
MTP::send(MTPcontacts_DeleteContact(u->inputUser), App::main()->rpcDone(&MainWidget::deletedContact, u));
}
@ -120,7 +120,7 @@ void TopBarWidget::onDeleteAndExitSure() {
PeerData *p = App::main() ? App::main()->profilePeer() : 0;
ChatData *c = (p && p->chat) ? p->asChat() : 0;
if (c) {
App::main()->showPeer(0, 0, true);
App::main()->showDialogs();
App::wnd()->hideLayer();
MTP::send(MTPmessages_DeleteChatUser(MTP_int(p->id & 0xFFFFFFFF), App::self()->inputUser), App::main()->rpcDone(&MainWidget::deleteHistory, p), App::main()->rpcFail(&MainWidget::leaveChatFailed, p));
}
@ -353,7 +353,8 @@ MainWidget *TopBarWidget::main() {
MainWidget::MainWidget(Window *window) : QWidget(window),
_started(0), failedObjId(0), _toForwardNameVersion(0), _dialogsWidth(st::dlgMinWidth),
dialogs(this), history(this), profile(0), overview(0), _player(this), _topBar(this),
_forwardConfirm(0), hider(0), _playerHeight(0), _contentScrollAddToY(0), _mediaType(this), _mediaTypeMask(0),
_forwardConfirm(0), _hider(0), _peerInStack(0), _msgIdInStack(0),
_playerHeight(0), _contentScrollAddToY(0), _mediaType(this), _mediaTypeMask(0),
updGoodPts(0), updLastPts(0), updPtsCount(0), updDate(0), updQts(-1), updSeq(0), updInited(false), updSkipPtsUpdateLevel(0),
_onlineRequest(0), _lastWasOnline(false), _lastSetOnline(0), _isIdle(false),
_failDifferenceTimeout(1), _lastUpdateTime(0), _cachedX(0), _cachedY(0), _background(0), _api(new ApiWrap(this)) {
@ -377,7 +378,7 @@ _failDifferenceTimeout(1), _lastUpdateTime(0), _cachedX(0), _cachedY(0), _backgr
connect(&_topBar, SIGNAL(clicked()), this, SLOT(onTopBarClick()));
connect(&history, SIGNAL(peerShown(PeerData*)), this, SLOT(onPeerShown(PeerData*)));
connect(&updateNotifySettingTimer, SIGNAL(timeout()), this, SLOT(onUpdateNotifySettings()));
connect(this, SIGNAL(showPeerAsync(quint64,qint32,bool,bool)), this, SLOT(showPeer(quint64,qint32,bool,bool)), Qt::QueuedConnection);
connect(this, SIGNAL(showPeerAsync(quint64,qint32)), this, SLOT(showPeerHistory(quint64,qint32)), Qt::QueuedConnection);
if (audioPlayer()) {
connect(audioPlayer(), SIGNAL(updated(const AudioMsgId&)), this, SLOT(audioPlayProgress(const AudioMsgId&)));
connect(audioPlayer(), SIGNAL(stopped(const AudioMsgId&)), this, SLOT(audioPlayProgress(const AudioMsgId&)));
@ -402,10 +403,7 @@ _failDifferenceTimeout(1), _lastUpdateTime(0), _cachedX(0), _cachedY(0), _backgr
_player.hide();
_topBar.raise();
_player.raise();
dialogs.raise();
_mediaType.raise();
orderWidgets();
MTP::setGlobalFailHandler(rpcFail(&MainWidget::updateFail));
@ -441,7 +439,7 @@ void MainWidget::onForward(const PeerId &peer, ForwardWhatMessages what) {
}
}
updateForwardingTexts();
showPeer(peer, 0, false, true);
showPeerHistory(peer, ShowAtUnreadMsgId);
history.onClearSelected();
history.updateForwarding();
}
@ -602,14 +600,14 @@ void MainWidget::onFilesOrForwardDrop(const PeerId &peer, const QMimeData *data)
} else if (data->hasFormat(qsl("application/x-td-forward-pressed"))) {
onForward(peer, ForwardPressedMessage);
} else {
showPeer(peer, 0, false, true);
showPeerHistory(peer, ShowAtTheEndMsgId);
history.onFilesDrop(data);
}
}
void MainWidget::noHider(HistoryHider *destroyed) {
if (hider == destroyed) {
hider = 0;
if (_hider == destroyed) {
_hider = 0;
if (cWideMode()) {
if (_forwardConfirm) {
_forwardConfirm->deleteLater();
@ -650,16 +648,16 @@ void MainWidget::hiderLayer(HistoryHider *h) {
return;
}
hider = h;
connect(hider, SIGNAL(forwarded()), &dialogs, SLOT(onCancelSearch()));
_hider = h;
connect(_hider, SIGNAL(forwarded()), &dialogs, SLOT(onCancelSearch()));
if (cWideMode()) {
hider->show();
_hider->show();
resizeEvent(0);
dialogs.activate();
} else {
dialogsToUp();
hider->hide();
_hider->hide();
dialogs.enableShadow(false);
QPixmap animCache = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight));
dialogs.enableShadow();
@ -700,13 +698,14 @@ void MainWidget::shareContactLayer(UserData *contact) {
}
bool MainWidget::selectingPeer(bool withConfirm) {
return hider ? (withConfirm ? hider->withConfirm() : true) : false;
return _hider ? (withConfirm ? _hider->withConfirm() : true) : false;
}
void MainWidget::offerPeer(PeerId peer) {
if (hider->offerPeer(peer) && !cWideMode()) {
_forwardConfirm = new ConfirmBox(hider->offeredText(), lang(lng_forward));
connect(_forwardConfirm, SIGNAL(confirmed()), hider, SLOT(forward()));
App::wnd()->hideLayer();
if (_hider->offerPeer(peer) && !cWideMode()) {
_forwardConfirm = new ConfirmBox(_hider->offeredText(), lang(lng_forward));
connect(_forwardConfirm, SIGNAL(confirmed()), _hider, SLOT(forward()));
connect(_forwardConfirm, SIGNAL(cancelled()), this, SLOT(onForwardCancel()));
connect(_forwardConfirm, SIGNAL(destroyed(QObject*)), this, SLOT(onForwardCancel(QObject*)));
App::wnd()->showLayer(_forwardConfirm);
@ -719,14 +718,10 @@ void MainWidget::onForwardCancel(QObject *obj) {
if (!obj) _forwardConfirm->startHide();
_forwardConfirm = 0;
}
if (hider) hider->offerPeer(0);
if (_hider) _hider->offerPeer(0);
}
}
void MainWidget::focusPeerSelect() {
hider->setFocus();
}
void MainWidget::dialogsActivate() {
dialogs.activate();
}
@ -740,7 +735,7 @@ bool MainWidget::leaveChatFailed(PeerData *peer, const RPCError &error) {
if (error.type() == "CHAT_ID_INVALID") { // left this chat already
if ((profile && profile->peer() == peer) || (overview && overview->peer() == peer) || _stack.contains(peer) || history.peer() == peer) {
showPeer(0, 0, false, true);
showDialogs();
}
dialogs.removePeer(peer);
App::histories().remove(peer->id);
@ -753,7 +748,7 @@ bool MainWidget::leaveChatFailed(PeerData *peer, const RPCError &error) {
void MainWidget::deleteHistory(PeerData *peer, const MTPUpdates &updates) {
sentUpdatesReceived(updates);
if ((profile && profile->peer() == peer) || (overview && overview->peer() == peer) || _stack.contains(peer) || history.peer() == peer) {
showPeer(0, 0, false, true);
showDialogs();
}
dialogs.removePeer(peer);
App::histories().remove(peer->id);
@ -788,7 +783,7 @@ void MainWidget::deleteHistoryAndContact(UserData *user, const MTPcontacts_Link
App::emitPeerUpdated();
if ((profile && profile->peer() == user) || (overview && overview->peer() == user) || _stack.contains(user) || history.peer() == user) {
showPeer(0);
showDialogs();
}
dialogs.removePeer(user);
MTP::send(MTPmessages_DeleteHistory(user->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, (PeerData*)user));
@ -813,7 +808,7 @@ void MainWidget::addParticipants(ChatData *chat, const QVector<UserData*> &users
MTP::send(MTPmessages_AddChatUser(MTP_int(chat->id & 0xFFFFFFFF), (*i)->inputUser, MTP_int(ForwardOnAdd)), rpcDone(&MainWidget::sentUpdatesReceived), rpcFail(&MainWidget::addParticipantFail, *i), 0, 5);
}
App::wnd()->hideLayer();
showPeer(chat->id, 0, false);
showPeerHistory(chat->id, ShowAtTheEndMsgId);
}
bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) {
@ -831,7 +826,7 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) {
void MainWidget::kickParticipant(ChatData *chat, UserData *user) {
MTP::send(MTPmessages_DeleteChatUser(MTP_int(chat->id & 0xFFFFFFFF), user->inputUser), rpcDone(&MainWidget::sentUpdatesReceived), rpcFail(&MainWidget::kickParticipantFail, chat));
App::wnd()->hideLayer();
showPeer(chat->id, 0, false);
showPeerHistory(chat->id, ShowAtTheEndMsgId);
}
bool MainWidget::kickParticipantFail(ChatData *chat, const RPCError &error) {
@ -862,7 +857,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu
if (v->isEmpty()) {
if ((profile && profile->peer() == peer) || (overview && overview->peer() == peer) || _stack.contains(peer) || history.peer() == peer) {
showPeer(0);
showDialogs();
}
dialogs.removePeer(peer);
} else {
@ -1015,9 +1010,8 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl
}
void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo) {
hist->getReadyFor(ShowAtTheEndMsgId);
readServerHistory(hist, false);
hist->loadAround(0);
if (history.peer())
sendPreparedText(hist, history.prepareMessage(text), replyTo);
}
@ -1050,7 +1044,7 @@ void MainWidget::saveRecentHashtags(const QString &text) {
}
void MainWidget::readServerHistory(History *hist, bool force) {
if (!hist || (!force && (!hist->unreadCount || !hist->readyForWork()))) return;
if (!hist || (!force && !hist->unreadCount)) return;
ReadRequests::const_iterator i = _readRequests.constFind(hist->peer);
if (i == _readRequests.cend()) {
@ -1059,8 +1053,8 @@ void MainWidget::readServerHistory(History *hist, bool force) {
}
}
uint64 MainWidget::animActiveTime() const {
return history.animActiveTime();
uint64 MainWidget::animActiveTime(MsgId id) const {
return history.animActiveTime(id);
}
void MainWidget::stopAnimActive() {
@ -1078,7 +1072,7 @@ void MainWidget::insertBotCommand(const QString &cmd) {
void MainWidget::searchMessages(const QString &query) {
App::wnd()->hideMediaview();
dialogs.searchMessages(query);
if (!cWideMode()) onShowDialogs();
if (!cWideMode()) showDialogs();
}
void MainWidget::preloadOverviews(PeerData *peer) {
@ -1724,13 +1718,11 @@ void MainWidget::cancelSendImage() {
}
void MainWidget::dialogsCancelled() {
if (hider) {
hider->startHide();
noHider(hider);
history.activate();
} else {
history.activate();
if (_hider) {
_hider->startHide();
noHider(_hider);
}
history.activate();
}
void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia &media, bool unread) {
@ -1870,15 +1862,15 @@ void MainWidget::pushReplyReturn(HistoryItem *item) {
}
void MainWidget::setInnerFocus() {
if (hider || !history.peer()) {
if (hider && hider->wasOffered()) {
hider->setFocus();
if (_hider || !history.peer()) {
if (_hider && _hider->wasOffered()) {
_hider->setFocus();
} else if (overview) {
overview->activate();
} else if (profile) {
profile->activate();
} else {
dialogs.setInnerFocus();
dialogsActivate();
}
} else if (profile) {
profile->setFocus();
@ -1891,88 +1883,104 @@ void MainWidget::createDialogAtTop(History *history, int32 unreadCount) {
dialogs.createDialogAtTop(history, unreadCount);
}
void MainWidget::showPeer(quint64 peerId, qint32 msgId, bool back, bool force) {
if (!back && _stack.size() == 1 && _stack[0]->type() == HistoryStackItem && _stack[0]->peer->id == peerId) {
if (cWideMode() || !selectingPeer()) {
back = true;
}
void MainWidget::choosePeer(PeerId peerId, MsgId showAtMsgId) {
if (selectingPeer()) {
offerPeer(peerId);
} else {
showPeerHistory(peerId, showAtMsgId);
}
}
void MainWidget::clearBotStartToken(PeerData *peer) {
if (peer && !peer->chat && peer->asUser()->botInfo) {
peer->asUser()->botInfo->startToken = QString();
}
}
void MainWidget::showPeerHistory(quint64 peerId, qint32 showAtMsgId, bool back) {
if (!back && (!peerId || (_stack.size() == 1 && _stack[0]->type() == HistoryStackItem && _stack[0]->peer->id == peerId))) {
back = true;
}
App::wnd()->hideLayer();
if (_hider) {
_hider->startHide();
_hider = 0;
}
QPixmap animCache, animTopBarCache;
if (force && hider) {
hider->startHide();
hider = 0;
}
if (force || !selectingPeer()) {
if (!animating() && ((history.isHidden() && history.activePeer() && (profile || overview)) || (!cWideMode() && (history.isHidden() || !peerId)))) {
dialogs.enableShadow(false);
if (peerId) {
_topBar.enableShadow(false);
if (cWideMode()) {
animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight + st::topBarHeight, width() - _dialogsWidth, height() - _playerHeight - st::topBarHeight));
} else {
animCache = myGrab(this, QRect(0, _playerHeight + st::topBarHeight, _dialogsWidth, height() - _playerHeight - st::topBarHeight));
}
} else if (cWideMode()) {
animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight, width() - _dialogsWidth, height() - _playerHeight));
if (!animating() && ((history.isHidden() && (profile || overview)) || (!cWideMode() && (history.isHidden() || !peerId)))) {
dialogs.enableShadow(false);
if (peerId) {
_topBar.enableShadow(false);
if (cWideMode()) {
animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight + st::topBarHeight, width() - _dialogsWidth, height() - _playerHeight - st::topBarHeight));
} else {
animCache = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight));
}
if (peerId || cWideMode()) {
animTopBarCache = myGrab(this, QRect(_topBar.x(), _topBar.y(), _topBar.width(), st::topBarHeight));
}
dialogs.enableShadow();
_topBar.enableShadow();
history.show();
}
}
history.showPeer(peerId, msgId, force);
if (force || !selectingPeer()) {
bool noPeer = (!history.peer() || !history.peer()->id), onlyDialogs = noPeer && !cWideMode();
if (profile || overview) {
if (profile) {
profile->hide();
profile->clear();
profile->deleteLater();
profile->rpcInvalidate();
profile = 0;
}
if (overview) {
overview->hide();
overview->clear();
overview->deleteLater();
overview->rpcInvalidate();
overview = 0;
}
_stack.clear();
}
if (onlyDialogs) {
_topBar.hide();
history.hide();
if (!animating()) {
dialogs.show();
if (!animCache.isNull()) {
dialogs.animShow(animCache);
}
animCache = myGrab(this, QRect(0, _playerHeight + st::topBarHeight, _dialogsWidth, height() - _playerHeight - st::topBarHeight));
}
} else if (cWideMode()) {
animCache = myGrab(this, QRect(_dialogsWidth, _playerHeight, width() - _dialogsWidth, height() - _playerHeight));
} else {
if (noPeer) {
_topBar.hide();
resizeEvent(0);
animCache = myGrab(this, QRect(0, _playerHeight, _dialogsWidth, height() - _playerHeight));
}
if (peerId || cWideMode()) {
animTopBarCache = myGrab(this, QRect(_topBar.x(), _topBar.y(), _topBar.width(), st::topBarHeight));
}
dialogs.enableShadow();
_topBar.enableShadow();
history.show();
}
if (history.peer() && history.peer()->id != peerId) clearBotStartToken(history.peer());
history.showPeerHistory(peerId, showAtMsgId);
bool noPeer = (!history.peer() || !history.peer()->id), onlyDialogs = noPeer && !cWideMode();
if (profile || overview) {
if (profile) {
profile->hide();
profile->clear();
profile->deleteLater();
profile->rpcInvalidate();
profile = 0;
}
if (overview) {
overview->hide();
overview->clear();
overview->deleteLater();
overview->rpcInvalidate();
overview = 0;
}
clearBotStartToken(_peerInStack);
_peerInStack = 0;
_msgIdInStack = 0;
_stack.clear();
}
if (onlyDialogs) {
_topBar.hide();
history.hide();
if (!animating()) {
dialogs.show();
if (!animCache.isNull()) {
dialogs.animShow(animCache);
}
if (!cWideMode()) dialogs.hide();
if (!animating()) {
history.show();
if (!animCache.isNull()) {
history.animShow(animCache, animTopBarCache, back);
} else {
QTimer::singleShot(0, this, SLOT(setInnerFocus()));
}
}
} else {
if (noPeer) {
_topBar.hide();
resizeEvent(0);
}
if (!cWideMode() && !dialogs.isHidden()) dialogs.hide();
if (!animating()) {
if (history.isHidden()) history.show();
if (!animCache.isNull()) {
history.animShow(animCache, animTopBarCache, back);
} else {
QTimer::singleShot(0, this, SLOT(setInnerFocus()));
}
}
}
if (!dialogs.isHidden()) {
dialogs.scrollToPeer(peerId, msgId);
dialogs.scrollToPeer(peerId, showAtMsgId);
dialogs.update();
}
App::wnd()->getTitle()->updateBackButton();
@ -2005,11 +2013,11 @@ PeerData *MainWidget::peer() {
}
PeerData *MainWidget::activePeer() {
return history.activePeer();
return history.peer() ? history.peer() : _peerInStack;
}
MsgId MainWidget::activeMsgId() {
return history.activeMsgId();
return history.peer() ? history.msgId() : _msgIdInStack;
}
PeerData *MainWidget::profilePeer() {
@ -2059,7 +2067,9 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool
} else if (profile) {
_stack.push_back(new StackItemProfile(profile->peer(), profile->lastScrollTop(), profile->allMediaShown()));
} else if (history.peer()) {
_stack.push_back(new StackItemHistory(history.peer(), history.lastWidth(), history.lastScrollTop(), history.replyReturns(), history.kbWasHidden()));
_peerInStack = history.peer();
_msgIdInStack = history.msgId();
_stack.push_back(new StackItemHistory(_peerInStack, _msgIdInStack, history.replyReturns(), history.kbWasHidden()));
}
}
if (overview) {
@ -2086,14 +2096,13 @@ void MainWidget::showMediaOverview(PeerData *peer, MediaOverviewType type, bool
overview->fastShow();
}
history.animStop();
history.showPeer(0, 0, false, true);
if (back) clearBotStartToken(history.peer());
history.showPeerHistory(0, 0);
history.hide();
if (!cWideMode()) dialogs.hide();
_topBar.raise();
_player.raise();
dialogs.raise();
_mediaType.raise();
if (hider) hider->raise();
orderWidgets();
App::wnd()->getTitle()->updateBackButton();
}
@ -2112,7 +2121,9 @@ void MainWidget::showPeerProfile(PeerData *peer, bool back, int32 lastScrollTop,
} else if (profile) {
_stack.push_back(new StackItemProfile(profile->peer(), profile->lastScrollTop(), profile->allMediaShown()));
} else {
_stack.push_back(new StackItemHistory(history.peer(), history.lastWidth(), history.lastScrollTop(), history.replyReturns(), history.kbWasHidden()));
_peerInStack = history.peer();
_msgIdInStack = history.msgId();
_stack.push_back(new StackItemHistory(_peerInStack, _msgIdInStack, history.replyReturns(), history.kbWasHidden()));
}
}
if (overview) {
@ -2133,32 +2144,36 @@ void MainWidget::showPeerProfile(PeerData *peer, bool back, int32 lastScrollTop,
resizeEvent(0);
profile->animShow(animCache, animTopBarCache, back, lastScrollTop, allMediaShown);
history.animStop();
history.showPeer(0, 0, false, true);
if (back) clearBotStartToken(history.peer());
history.showPeerHistory(0, 0);
history.hide();
_topBar.raise();
_player.raise();
dialogs.raise();
_mediaType.raise();
if (hider) hider->raise();
orderWidgets();
App::wnd()->getTitle()->updateBackButton();
}
void MainWidget::showBackFromStack() {
if (selectingPeer()) return;
if (_stack.isEmpty()) {
if (cWideMode()) {
showPeer(0, 0, false, true);
QTimer::singleShot(0, this, SLOT(setInnerFocus()));
} else {
onShowDialogs();
}
showDialogs();
QTimer::singleShot(0, this, SLOT(setInnerFocus()));
return;
}
StackItem *item = _stack.back();
_stack.pop_back();
if (item->type() == HistoryStackItem) {
_peerInStack = 0;
_msgIdInStack = 0;
for (int32 i = _stack.size(); i > 0;) {
if (_stack.at(--i)->type() == HistoryStackItem) {
_peerInStack = static_cast<StackItemHistory*>(_stack.at(i))->peer;
_msgIdInStack = static_cast<StackItemHistory*>(_stack.at(i))->msgId;
break;
}
}
StackItemHistory *histItem = static_cast<StackItemHistory*>(item);
showPeer(histItem->peer->id, App::main()->activeMsgId(), true);
showPeerHistory(histItem->peer->id, App::main()->activeMsgId(), true);
history.setReplyReturns(histItem->peer->id, histItem->replyReturns);
if (histItem->kbWasHidden) history.setKbWasHidden();
} else if (item->type() == ProfileStackItem) {
@ -2171,6 +2186,14 @@ void MainWidget::showBackFromStack() {
delete item;
}
void MainWidget::orderWidgets() {
_topBar.raise();
_player.raise();
dialogs.raise();
_mediaType.raise();
if (_hider) _hider->raise();
}
QRect MainWidget::historyRect() const {
QRect r(history.historyRect());
r.moveLeft(r.left() + history.x());
@ -2340,8 +2363,8 @@ void MainWidget::showAll() {
App::wnd()->showLayer(new ConfirmBox(lang(lng_signin_password_removed), true, lang(lng_continue)));
}
if (cWideMode()) {
if (hider) {
hider->show();
if (_hider) {
_hider->show();
if (_forwardConfirm) {
App::wnd()->hideLayer(true);
_forwardConfirm = 0;
@ -2360,11 +2383,11 @@ void MainWidget::showAll() {
_topBar.show();
}
} else {
if (hider) {
hider->hide();
if (!_forwardConfirm && hider->wasOffered()) {
_forwardConfirm = new ConfirmBox(hider->offeredText(), lang(lng_forward));
connect(_forwardConfirm, SIGNAL(confirmed()), hider, SLOT(forward()));
if (_hider) {
_hider->hide();
if (!_forwardConfirm && _hider->wasOffered()) {
_forwardConfirm = new ConfirmBox(_hider->offeredText(), lang(lng_forward));
connect(_forwardConfirm, SIGNAL(confirmed()), _hider, SLOT(forward()));
connect(_forwardConfirm, SIGNAL(cancelled()), this, SLOT(onForwardCancel()));
App::wnd()->showLayer(_forwardConfirm, true);
}
@ -2402,14 +2425,14 @@ void MainWidget::resizeEvent(QResizeEvent *e) {
_player.setGeometry(_dialogsWidth, 0, width() - _dialogsWidth, _player.height());
_topBar.setGeometry(_dialogsWidth, _playerHeight, width() - _dialogsWidth, st::topBarHeight + st::titleShadow);
history.setGeometry(_dialogsWidth, _playerHeight + tbh, width() - _dialogsWidth, height() - _playerHeight - tbh);
if (hider) hider->setGeometry(QRect(_dialogsWidth, 0, width() - _dialogsWidth, height()));
if (_hider) _hider->setGeometry(QRect(_dialogsWidth, 0, width() - _dialogsWidth, height()));
} else {
_dialogsWidth = width();
_player.setGeometry(0, 0, _dialogsWidth, _player.height());
dialogs.setGeometry(0, _playerHeight, _dialogsWidth + st::dlgShadow, height() - _playerHeight);
_topBar.setGeometry(0, _playerHeight, _dialogsWidth, st::topBarHeight + st::titleShadow);
history.setGeometry(0, _playerHeight + tbh, _dialogsWidth, height() - _playerHeight - tbh);
if (hider) hider->setGeometry(QRect(0, 0, _dialogsWidth, height()));
if (_hider) _hider->setGeometry(QRect(0, 0, _dialogsWidth, height()));
}
_mediaType.move(width() - _mediaType.width(), _playerHeight + st::topBarHeight);
if (profile) profile->setGeometry(history.geometry());
@ -2433,8 +2456,8 @@ bool MainWidget::needBackButton() {
return overview || profile || (history.peer() && history.peer()->id);
}
void MainWidget::onShowDialogs() {
showPeer(0, 0, false, true);
void MainWidget::showDialogs() {
showPeerHistory(0, 0);
}
void MainWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
@ -2450,9 +2473,9 @@ void MainWidget::paintTopBar(QPainter &p, float64 over, int32 decreaseWidth) {
void MainWidget::topBarShadowParams(int32 &x, float64 &o) {
if (!cWideMode() && dialogs.isHidden()) {
if (profile) {
if (!history.activePeer()) profile->topBarShadowParams(x, o);
if (!_peerInStack) profile->topBarShadowParams(x, o);
} else if (overview) {
if (!history.activePeer()) overview->topBarShadowParams(x, o);
if (!_peerInStack) overview->topBarShadowParams(x, o);
} else {
history.topBarShadowParams(x, o);
}
@ -2787,7 +2810,7 @@ void MainWidget::openUserByName(const QString &username, bool toProfile, const Q
history.resizeEvent(0);
}
}
emit showPeerAsync(user->id, 0, false, true);
emit showPeerAsync(user->id, 0);
}
} else {
MTP::send(MTPcontacts_ResolveUsername(MTP_string(username)), rpcDone(&MainWidget::usernameResolveDone, qMakePair(toProfile, startToken)), rpcFail(&MainWidget::usernameResolveFail, username));
@ -2829,7 +2852,7 @@ void MainWidget::usernameResolveDone(QPair<bool, QString> toProfileStartToken, c
history.resizeEvent(0);
}
}
showPeer(user->id, 0, false, true);
showPeerHistory(user->id, ShowAtUnreadMsgId);
}
}
@ -2862,7 +2885,7 @@ void MainWidget::inviteCheckDone(QString hash, const MTPChatInvite &invite) {
connect(box, SIGNAL(confirmed()), this, SLOT(onInviteImport()));
App::wnd()->showLayer(box);
} else {
showPeer(chat->id, 0, false, true);
showPeerHistory(chat->id, ShowAtUnreadMsgId);
}
}
} break;
@ -2906,7 +2929,7 @@ void MainWidget::inviteImportDone(const MTPUpdates &updates) {
} break;
}
if (v && !v->isEmpty() && v->front().type() == mtpc_chat) {
App::main()->showPeer(App::peerFromChat(v->front().c_chat().vid.v));
App::main()->showPeerHistory(App::peerFromChat(v->front().c_chat().vid.v), ShowAtTheEndMsgId);
}
}
@ -3114,9 +3137,9 @@ void MainWidget::incrementSticker(DocumentData *sticker) {
void MainWidget::activate() {
if (!profile && !overview) {
if (hider) {
if (hider->wasOffered()) {
hider->setFocus();
if (_hider) {
if (_hider->wasOffered()) {
_hider->setFocus();
} else {
dialogs.activate();
}
@ -3144,7 +3167,7 @@ void MainWidget::updateOnlineDisplayIn(int32 msecs) {
void MainWidget::addNewContact(int32 uid, bool show) {
if (dialogs.addNewContact(uid, show)) {
showPeer(App::peerFromUser(uid));
showPeerHistory(App::peerFromUser(uid), ShowAtTheEndMsgId);
}
}
@ -3169,11 +3192,11 @@ int32 MainWidget::dlgsWidth() const {
}
MainWidget::~MainWidget() {
if (App::main() == this) history.showPeer(0, 0, true);
if (App::main() == this) history.showPeerHistory(0, 0);
delete _background;
delete hider;
delete _hider;
MTP::clearGlobalHandlers();
delete _api;
if (App::wnd()) App::wnd()->noMain(this);

View File

@ -111,13 +111,14 @@ public:
class StackItemHistory : public StackItem {
public:
StackItemHistory(PeerData *peer, int32 lastWidth, int32 lastScrollTop, QList<MsgId> replyReturns, bool kbWasHidden) : StackItem(peer), replyReturns(replyReturns), lastWidth(lastWidth), lastScrollTop(lastScrollTop), kbWasHidden(kbWasHidden) {
StackItemHistory(PeerData *peer, MsgId msgId, QList<MsgId> replyReturns, bool kbWasHidden) : StackItem(peer),
msgId(msgId), replyReturns(replyReturns), kbWasHidden(kbWasHidden) {
}
StackItemType type() const {
return HistoryStackItem;
}
MsgId msgId;
QList<MsgId> replyReturns;
int32 lastWidth, lastScrollTop;
bool kbWasHidden;
};
@ -184,7 +185,7 @@ public:
void updateWideMode();
bool needBackButton();
void onShowDialogs();
void showDialogs();
void paintTopBar(QPainter &p, float64 over, int32 decreaseWidth);
void topBarShadowParams(int32 &x, float64 &o);
@ -234,14 +235,17 @@ public:
void peerAfter(const PeerData *inPeer, MsgId inMsg, PeerData *&outPeer, MsgId &outMsg);
PeerData *historyPeer();
PeerData *peer();
PeerData *activePeer();
MsgId activeMsgId();
PeerData *profilePeer();
PeerData *overviewPeer();
bool mediaTypeSwitch();
void showPeerProfile(PeerData *peer, bool back = false, int32 lastScrollTop = -1, bool allMediaShown = false);
void showMediaOverview(PeerData *peer, MediaOverviewType type, bool back = false, int32 lastScrollTop = -1);
void showBackFromStack();
void orderWidgets();
QRect historyRect() const;
void confirmShareContact(bool ctrlShiftEnter, const QString &phone, const QString &fname, const QString &lname, MsgId replyTo);
@ -272,7 +276,6 @@ public:
void onFilesOrForwardDrop(const PeerId &peer, const QMimeData *data);
bool selectingPeer(bool withConfirm = false);
void offerPeer(PeerId peer);
void focusPeerSelect();
void dialogsActivate();
DragState getDragState(const QMimeData *mime);
@ -310,7 +313,7 @@ public:
void readServerHistory(History *history, bool force = true);
uint64 animActiveTime() const;
uint64 animActiveTime(MsgId id) const;
void stopAnimActive();
void sendBotCommand(const QString &cmd, MsgId msgId);
@ -369,6 +372,9 @@ public:
void updateStickers();
void botCommandsChanged(UserData *bot);
void choosePeer(PeerId peerId, MsgId showAtMsgId); // does offerPeer or showPeerHistory
void clearBotStartToken(PeerData *peer);
~MainWidget();
signals:
@ -379,7 +385,7 @@ signals:
void dialogRowReplaced(DialogRow *oldRow, DialogRow *newRow);
void dialogToTop(const History::DialogLinks &links);
void dialogsUpdated();
void showPeerAsync(quint64 peer, qint32 msgId, bool back, bool force);
void showPeerAsync(quint64 peerId, qint32 showAtMsgId);
void stickersUpdated();
public slots:
@ -411,7 +417,7 @@ public slots:
void checkIdleFinish();
void updateOnlineDisplay();
void showPeer(quint64 peer, qint32 msgId = 0, bool back = false, bool force = false); // PeerId, MsgId
void showPeerHistory(quint64 peer, qint32 msgId, bool back = false);
void onTopBarClick();
void onPeerShown(PeerData *peer);
@ -500,10 +506,11 @@ private:
PlayerWidget _player;
TopBarWidget _topBar;
ConfirmBox *_forwardConfirm; // for narrow mode
HistoryHider *hider;
HistoryHider *_hider;
StackItems _stack;
QPixmap profileAnimCache;
PeerData *_peerInStack;
MsgId _msgIdInStack;
int32 _playerHeight;
int32 _contentScrollAddToY;

View File

@ -446,7 +446,7 @@ void MediaView::onToMessage() {
if (HistoryItem *item = _msgid ? App::histItemById(_msgid) : 0) {
if (App::wnd()) {
close();
if (App::main()) App::main()->showPeer(item->history()->peer->id, _msgid, false, true);
if (App::main()) App::main()->showPeerHistory(item->history()->peer->id, _msgid);
}
}
}

View File

@ -1367,7 +1367,7 @@ void OverviewInner::goToMessage() {
HistoryItem *item = App::contextItem();
if (!item) return;
App::main()->showPeer(item->history()->peer->id, item->id, true, true);
App::main()->showPeerHistory(item->history()->peer->id, item->id);
}
void OverviewInner::forwardMessage() {

View File

@ -178,7 +178,7 @@ void ProfileInner::onInviteToGroup() {
}
void ProfileInner::onSendMessage() {
App::main()->showPeer(_peer->id);
App::main()->showPeerHistory(_peer->id, ShowAtUnreadMsgId);
}
void ProfileInner::onEnableNotifications() {
@ -250,7 +250,7 @@ void ProfileInner::onClearHistory() {
}
void ProfileInner::onClearHistorySure() {
App::main()->showPeer(0, 0, true);
App::main()->showDialogs();
App::wnd()->hideLayer();
App::main()->clearHistory(_peer);
}
@ -358,7 +358,7 @@ void ProfileInner::onBotSettings() {
for (int32 i = 0, l = _peerUser->botInfo->commands.size(); i != l; ++i) {
QString cmd = _peerUser->botInfo->commands.at(i).command;
if (!cmd.compare(qsl("settings"), Qt::CaseInsensitive)) {
App::main()->showPeer(_peer->id);
App::main()->showPeerHistory(_peer->id, ShowAtTheEndMsgId);
App::main()->sendBotCommand('/' + cmd, 0);
return;
}
@ -370,7 +370,7 @@ void ProfileInner::onBotHelp() {
for (int32 i = 0, l = _peerUser->botInfo->commands.size(); i != l; ++i) {
QString cmd = _peerUser->botInfo->commands.at(i).command;
if (!cmd.compare(qsl("help"), Qt::CaseInsensitive)) {
App::main()->showPeer(_peer->id);
App::main()->showPeerHistory(_peer->id, ShowAtTheEndMsgId);
App::main()->sendBotCommand('/' + cmd, 0);
return;
}
@ -766,7 +766,7 @@ void ProfileInner::mouseReleaseEvent(QMouseEvent *e) {
textlnkDown(TextLinkPtr());
if (lnk == textlnkOver()) {
if (reBotCommand().match(lnk->encoded()).hasMatch()) {
App::main()->showPeer(_peer->id);
App::main()->showPeerHistory(_peer->id, ShowAtTheEndMsgId);
}
lnk->onClick(e->button());
}

View File

@ -76,7 +76,7 @@ void MacPrivate::notifyClicked(unsigned long long peer, int msgid) {
tomsg = false;
}
}
App::main()->showPeer(history->peer->id, tomsg ? msgid : 0, false, true);
App::main()->showPeerHistory(history->peer->id, tomsg ? msgid : ShowAtUnreadMsgId);
App::wnd()->notifyClear(history);
}
}

View File

@ -775,7 +775,7 @@ void MessageLink::onClick(Qt::MouseButton button) const {
if (current && current->history()->peer->id == peer()) {
App::main()->pushReplyReturn(current);
}
App::main()->showPeer(peer(), msgid());
App::main()->showPeerHistory(peer(), msgid());
}
}

View File

@ -25,6 +25,9 @@ typedef uint64 DocumentId;
typedef uint64 WebPageId;
typedef int32 MsgId;
static const MsgId ShowAtTheEndMsgId = -0x40000000;
static const MsgId ShowAtUnreadMsgId = 0;
struct NotifySettings {
NotifySettings() : mute(0), sound("default"), previews(true), events(1) {
}

View File

@ -287,7 +287,7 @@ void NotifyWindow::mousePressEvent(QMouseEvent *e) {
App::wnd()->notifyClear();
} else {
App::wnd()->hideSettings();
App::main()->showPeer(peer, (history->peer->chat && item && item->notifyByFrom() && item->id > 0) ? item->id : 0, false, true);
App::main()->showPeerHistory(peer, (history->peer->chat && item && item->notifyByFrom() && item->id > 0) ? item->id : ShowAtUnreadMsgId);
}
e->ignore();
}

View File

@ -11,7 +11,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.39</string>
<string>0.8.40</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>CFBundleSignature</key>

Binary file not shown.

View File

@ -1705,7 +1705,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.39;
CURRENT_PROJECT_VERSION = 0.8.40;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1723,7 +1723,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.8.39;
CURRENT_PROJECT_VERSION = 0.8.40;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@ -1749,10 +1749,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.39;
CURRENT_PROJECT_VERSION = 0.8.40;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.39;
DYLIB_CURRENT_VERSION = 0.8.40;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@ -1886,10 +1886,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.39;
CURRENT_PROJECT_VERSION = 0.8.40;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.39;
DYLIB_CURRENT_VERSION = 0.8.40;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;

View File

@ -1,2 +1,2 @@
echo 0.8 8039 0.8.39 1
echo 0.8 8040 0.8.40 1
# AppVersionStrMajor AppVersion AppVersionStr DevChannel

View File

@ -131,7 +131,7 @@ Then in Terminal go to **/Users/user/TBuild/Libraries/ffmpeg-2.6.3** and run
LDFLAGS=`freetype-config --libs`
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
./configure --prefix=/usr/local --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-muxer=ogg --enable-muxer=opus --extra-cflags="-mmacosx-version-min=10.7" --extra-cxxflags="-mmacosx-version-min=10.7" --extra-ldflags="-mmacosx-version-min=10.7"
./configure --prefix=/usr/local --disable-programs --disable-everything --enable-libopus --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=aasc --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3float --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wavpack --enable-decoder=opus --enable-decoder=vorbis --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-decoder=flac --enable-encoder=libopus --enable-parser=aac --enable-parser=aac_latm --enable-parser=mpegaudio --enable-parser=opus --enable-parser=vorbis --enable-parser=flac --enable-demuxer=aac --enable-demuxer=wav --enable-demuxer=mp3 --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=flac --enable-muxer=ogg --enable-muxer=opus --extra-cflags="-mmacosx-version-min=10.7" --extra-cxxflags="-mmacosx-version-min=10.7" --extra-ldflags="-mmacosx-version-min=10.7"
make
sudo make install