version 0.9.2 prepared

This commit is contained in:
John Preston 2015-09-25 10:47:32 +03:00
parent 5808c4bc02
commit 5b811500f6
18 changed files with 66 additions and 377 deletions

View File

@ -1,24 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinuxupd$AppVersion" ]; then
echo "tlinuxupd$AppVersion not found!";
exit 1
fi
if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.tar.xz" ]; then
echo "tsetup.$AppVersionStrFull.tar.xz not found!"
exit 1
fi
scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinuxupd$AppVersion tmaster:tdesktop/www/tlinux/
scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.tar.xz tmaster:tdesktop/www/tlinux/

View File

@ -1,25 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinux32upd$AppVersion" ]; then
echo "tlinux32upd$AppVersion not found!"
exit 1
fi
if [ ! -f "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.tar.xz" ]; then
echo "tsetup32.$AppVersionStrFull.zip not found!"
exit 1
fi
scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tlinux32upd$AppVersion tmaster:tdesktop/www/tlinux32/
scp ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.tar.xz tmaster:tdesktop/www/tlinux32/

View File

@ -1,68 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion" ]; then
echo "tmacupd$AppVersion not found!"
exit 1
fi
if [ ! -f "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg" ]; then
echo "tsetup.$AppVersionStrFull.dmg not found!"
exit 1
fi
if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion" ]; then
echo "tmac32upd$AppVersion not found!"
exit 1
fi
if [ ! -f "./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg" ]; then
echo "tsetup32.$AppVersionStrFull.dmg not found!"
exit 1
fi
if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tupdate$AppVersion" ]; then
echo "tupdate$AppVersion not found!"
exit 1
fi
if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tportable.$AppVersionStrFull.zip" ]; then
echo "tportable.$AppVersionStrFull.zip not found!"
exit 1
fi
if [ ! -f "./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.exe" ]; then
echo "tsetup.$AppVersionStrFull.exe not found!"
exit 1
fi
if [ ! -d "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" ]; then
mkdir "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
fi
scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion tmaster:tdesktop/www/tmac/
scp ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg tmaster:tdesktop/www/tmac/
scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion tmaster:tdesktop/www/tmac32/
scp ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg tmaster:tdesktop/www/tmac32/
scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tupdate$AppVersion tmaster:tdesktop/www/tsetup/
scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tportable.$AppVersionStrFull.zip tmaster:tdesktop/www/tsetup/
scp ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.exe tmaster:tdesktop/www/tsetup/
mv -v ./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/
cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tmacupd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cp -v ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cp -rv ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tmac32upd$AppVersion ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cp -v ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/tsetup32.$AppVersionStrFull.dmg ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cp -rv ./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull/Telegram.app.dSYM ./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram32.app.dSYM

View File

@ -1,58 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ -d "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr.dev" ]; then
echo "Deploy folder for version $AppVersionStr.dev already exists!"
exit 1
fi
if [ -d "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
exit 1
fi
if [ -f "./../Linux/Release/tlinuxupd$AppVersion" ]; then
echo "Update file for version $AppVersion already exists!"
exit 1
fi
if [ ! -f "./../Linux/Release/Telegram" ]; then
echo "Telegram not found!"
exit 1
fi
if [ ! -f "./../Linux/Release/Updater" ]; then
echo "Updater not found!"
exit 1
fi
echo "Preparing version $AppVersionStrFull, executing Packer.."
cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
echo "Packer done!"
if [ ! -d "./../Linux/Release/deploy" ]; then
mkdir "./../Linux/Release/deploy"
fi
if [ ! -d "./../Linux/Release/deploy/$AppVersionStrMajor" ]; then
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor"
fi
echo "Copying Telegram, Updater and tlinuxupd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
mv ./../Linux/Release/tlinuxupd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull && tar -cJvf tsetup.$AppVersionStrFull.tar.xz Telegram/ && cd ./../../../../../Telegram
echo "Version $AppVersionStrFull prepared!";

View File

@ -1,58 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ -d "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr.dev" ]; then
echo "Deploy folder for version $AppVersionStr.dev already exists!"
exit 1
fi
if [ -d "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
exit 1
fi
if [ -f "./../Linux/Release/tlinux32upd$AppVersion" ]; then
echo "Update file for version $AppVersion already exists!"
exit 1
fi
if [ ! -f "./../Linux/Release/Telegram" ]; then
echo "Telegram not found!"
exit 1
fi
if [ ! -f "./../Linux/Release/Updater" ]; then
echo "Updater not found!"
exit 1
fi
echo "Preparing version $AppVersionStrFull, executing Packer.."
cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
echo "Packer done!"
if [ ! -d "./../Linux/Release/deploy" ]; then
mkdir "./../Linux/Release/deploy"
fi
if [ ! -d "./../Linux/Release/deploy/$AppVersionStrMajor" ]; then
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor"
fi
echo "Copying Telegram, Updater and tlinux32upd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStrFull..";
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
mkdir "./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
mv ./../Linux/Release/tlinux32upd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
cd ./../Linux/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull && tar -cJvf tsetup32.$AppVersionStrFull.tar.xz Telegram/ && cd ./../../../../../Telegram
echo "Version $AppVersionStrFull prepared!";

View File

@ -1,98 +0,0 @@
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
echo ""
echo "Preparing version $AppVersionStrFull.."
echo ""
if [ -d "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr.dev" ]; then
echo "Deploy folder for version $AppVersionStr.dev already exists!"
exit 1
fi
if [ -d "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
exit 1
fi
if [ -f "./../Mac/Release/tmacupd$AppVersion" ]; then
echo "Update file for version $AppVersion already exists!"
exit 1
fi
if [ ! -d "./../Mac/Release/Telegram.app" ]; then
echo "Telegram.app not found!"
exit 1
fi
if [ ! -d "./../Mac/Release/Telegram.app.dSYM" ]; then
echo "Telegram.app.dSYM not found!"
exit 1
fi
AppUUID=`dwarfdump -u "./../Mac/Release/Telegram.app/Contents/MacOS/Telegram" | awk -F " " '{print $2}'`
DsymUUID=`dwarfdump -u "./../Mac/Release/Telegram.app.dSYM" | awk -F " " '{print $2}'`
if [ "$AppUUID" != "$DsymUUID" ]; then
echo "UUID of binary '$AppUUID' and dSYM '$DsymUUID' differ!"
exit 1
fi
if [ ! -f "./../Mac/Release/Telegram.app/Contents/Resources/Icon.icns" ]; then
echo "Icon.icns not found in Resources!"
exit 1
fi
if [ ! -f "./../Mac/Release/Telegram.app/Contents/MacOS/Telegram" ]; then
echo "Telegram not found in MacOS!"
exit 1
fi
if [ ! -f "./../Mac/Release/Telegram.app/Contents/Frameworks/Updater" ]; then
echo "Updater not found in Frameworks!"
exit 1
fi
if [ ! -d "./../Mac/Release/Telegram.app/Contents/_CodeSignature" ]; then
echo "Telegram signature not found!"
exit 1
fi
cd ./../Mac/Release
temppath=`hdiutil attach -readwrite tsetup.dmg | awk -F "\t" 'END {print $3}'`
cp -R ./Telegram.app "$temppath/"
bless --folder "$temppath/" --openfolder "$temppath/"
hdiutil detach "$temppath"
hdiutil convert tsetup.dmg -format UDZO -imagekey zlib-level=9 -ov -o tsetup.$AppVersionStrFull.dmg
cd ./../../Telegram
cd ./../Mac/Release && ./Packer.app/Contents/MacOS/Packer -path Telegram.app -version $AppVersion $DevParam && cd ./../../Telegram
if [ ! -d "./../Mac/Release/deploy" ]; then
mkdir "./../Mac/Release/deploy"
fi
if [ ! -d "./../Mac/Release/deploy/$AppVersionStrMajor" ]; then
mkdir "./../Mac/Release/deploy/$AppVersionStrMajor"
fi
echo "Copying Telegram.app and tmacupd$AppVersion to deploy/$AppVersionStrMajor/$AppVersionStr..";
mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull"
mkdir "./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram"
cp -r ./../Mac/Release/Telegram.app ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/Telegram/
mv ./../Mac/Release/Telegram.app.dSYM ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
rm ./../Mac/Release/Telegram.app/Contents/MacOS/Telegram
rm ./../Mac/Release/Telegram.app/Contents/Frameworks/Updater
rm -rf ./../Mac/Release/Telegram.app/Contents/_CodeSignature
mv ./../Mac/Release/tmacupd$AppVersion ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/
mv ./../Mac/Release/tsetup.$AppVersionStrFull.dmg ./../Mac/Release/deploy/$AppVersionStrMajor/$AppVersionStrFull/tsetup.$AppVersionStrFull.dmg
echo "Version $AppVersionStrFull prepared!";

View File

@ -1357,16 +1357,7 @@ PeerData *chatOrChannelCreated(const MTPUpdates &updates, const QImage &photo) {
switch (updates.type()) { switch (updates.type()) {
case mtpc_updates: v = &updates.c_updates().vchats.c_vector().v; break; case mtpc_updates: v = &updates.c_updates().vchats.c_vector().v; break;
case mtpc_updatesCombined: v = &updates.c_updatesCombined().vchats.c_vector().v; break; case mtpc_updatesCombined: v = &updates.c_updatesCombined().vchats.c_vector().v; break;
case mtpc_updateShort: { default: LOG(("API Error: unexpected update cons %1 (chatOrChannelCreated)").arg(updates.type())); break;
} break;
case mtpc_updateShortMessage: {
} break;
case mtpc_updateShortChatMessage: {
} break;
case mtpc_updateShortSentMessage: {
} break;
case mtpc_updatesTooLong: {
} break;
} }
if (v && !v->isEmpty() && v->front().type() == mtpc_chat) { if (v && !v->isEmpty() && v->front().type() == mtpc_chat) {
ChatData *chat = App::chat(v->front().c_chat().vid.v); ChatData *chat = App::chat(v->front().c_chat().vid.v);
@ -1871,6 +1862,8 @@ _addBox(0) {
connect(&_inner, SIGNAL(mustScrollTo(int, int)), &_scroll, SLOT(scrollToY(int, int))); connect(&_inner, SIGNAL(mustScrollTo(int, int)), &_scroll, SLOT(scrollToY(int, int)));
connect(&_inner, SIGNAL(loaded()), this, SLOT(onLoaded())); connect(&_inner, SIGNAL(loaded()), this, SLOT(onLoaded()));
connect(&_loadTimer, SIGNAL(timeout()), &_inner, SLOT(load()));
prepare(); prepare();
} }
@ -1933,7 +1926,7 @@ void MembersBox::onAdminAdded() {
if (!_addBox) return; if (!_addBox) return;
_addBox->onClose(); _addBox->onClose();
_addBox = 0; _addBox = 0;
_inner.load(); _loadTimer.start(ReloadChannelMembersTimeout);
} }
void MembersBox::hideAll() { void MembersBox::hideAll() {

View File

@ -270,7 +270,6 @@ public:
ChannelData *channel() const; ChannelData *channel() const;
MembersFilter filter() const; MembersFilter filter() const;
void load();
bool isLoaded() const { bool isLoaded() const {
return !_loading; return !_loading;
} }
@ -287,6 +286,8 @@ signals:
public slots: public slots:
void load();
void updateSel(); void updateSel();
void peerUpdated(PeerData *peer); void peerUpdated(PeerData *peer);
void onPeerNameChanged(PeerData *peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars); void onPeerNameChanged(PeerData *peer, const PeerData::Names &oldNames, const PeerData::NameFirstChars &oldChars);
@ -386,6 +387,8 @@ private:
FlatButton _add, _done; FlatButton _add, _done;
ContactsBox *_addBox; ContactsBox *_addBox;
SingleTimer _loadTimer;
}; };
class NewGroupBox : public AbstractBox { class NewGroupBox : public AbstractBox {

View File

@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
static const int32 AppVersion = 9001; static const int32 AppVersion = 9002;
static const wchar_t *AppVersionStr = L"0.9.1"; static const wchar_t *AppVersionStr = L"0.9.2";
static const bool DevVersion = false; static const bool DevVersion = false;
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
@ -147,6 +147,7 @@ enum {
SessionsShortPollTimeout = 60000, SessionsShortPollTimeout = 60000,
ChoosePeerByDragTimeout = 1000, // 1 second mouse not moved to choose dialog when dragging a file ChoosePeerByDragTimeout = 1000, // 1 second mouse not moved to choose dialog when dragging a file
ReloadChannelMembersTimeout = 1000, // 1 second wait before reload members in channel after adding
}; };
inline bool isNotificationsUser(uint64 id) { inline bool isNotificationsUser(uint64 id) {

View File

@ -687,7 +687,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) {
if (lastSeenDateItem && lastSeenDateItem->date.date() == inviteDate.date()) { if (lastSeenDateItem && lastSeenDateItem->date.date() == inviteDate.date()) {
lastSeenDateItem->destroy(); lastSeenDateItem->destroy();
} }
if (!lastMsgDate.isNull() && inviteDate >= lastMsgDate) { if (lastMsgDate.isNull() || inviteDate >= lastMsgDate) {
setLastMessage(_joinedMessage); setLastMessage(_joinedMessage);
if (unread) { if (unread) {
newItemAdded(_joinedMessage); newItemAdded(_joinedMessage);
@ -771,11 +771,11 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) {
return _joinedMessage; return _joinedMessage;
} }
void ChannelHistory::checkJoinedMessage() { void ChannelHistory::checkJoinedMessage(bool createUnread) {
if (_joinedMessage || peer->asChannel()->inviter <= 0) return; if (_joinedMessage || peer->asChannel()->inviter <= 0) return;
if (isEmpty()) { if (isEmpty()) {
if (loadedAtTop() && loadedAtBottom()) { if (loadedAtTop() && loadedAtBottom()) {
if (insertJoinedMessage(false)) { if (insertJoinedMessage(createUnread)) {
setLastMessage(_joinedMessage); setLastMessage(_joinedMessage);
} }
return; return;
@ -813,7 +813,8 @@ void ChannelHistory::checkJoinedMessage() {
} }
if (!firstDate.isNull() && !lastDate.isNull() && (firstDate <= inviteDate || loadedAtTop()) && (lastDate > inviteDate || loadedAtBottom())) { if (!firstDate.isNull() && !lastDate.isNull() && (firstDate <= inviteDate || loadedAtTop()) && (lastDate > inviteDate || loadedAtBottom())) {
if (insertJoinedMessage(false) && inviteDate >= lastDate) { bool willBeLastMsg = (inviteDate >= lastDate);
if (insertJoinedMessage(createUnread && willBeLastMsg) && willBeLastMsg) {
setLastMessage(_joinedMessage); setLastMessage(_joinedMessage);
} }
} }
@ -857,7 +858,13 @@ HistoryItem *ChannelHistory::addNewToBlocks(const MTPMessage &msg, NewMessageTyp
if (item && isImportant) { if (item && isImportant) {
setLastMessage(item); setLastMessage(item);
if (type == NewMessageUnread) { if (type == NewMessageUnread) {
newItemAdded(item); if (item->unread()) {
newItemAdded(item);
} else if (item->out()) {
outboxRead(item);
} else {
inboxRead(item);
}
} }
} }
return item; return item;
@ -1534,7 +1541,13 @@ HistoryItem *History::addNewMessage(const MTPMessage &msg, NewMessageType type)
if (item) { if (item) {
setLastMessage(item); setLastMessage(item);
if (type == NewMessageUnread) { if (type == NewMessageUnread) {
newItemAdded(item); if (item->unread()) {
newItemAdded(item);
} else if (item->out()) {
outboxRead(item);
} else {
inboxRead(item);
}
} }
} }
return item; return item;
@ -1640,7 +1653,13 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a
height += dh; height += dh;
} }
if (newMsg) { if (newMsg) {
newItemAdded(adding); if (adding->unread()) {
newItemAdded(adding);
} else if (adding->out()) {
outboxRead(adding);
} else {
inboxRead(adding);
}
} }
if (!isChannel() || adding->fromChannel()) { if (!isChannel() || adding->fromChannel()) {
@ -2105,6 +2124,7 @@ void History::updateShowFrom() {
} }
MsgId History::inboxRead(MsgId upTo) { MsgId History::inboxRead(MsgId upTo) {
if (upTo < 0) return upTo;
if (unreadCount) { if (unreadCount) {
if (upTo && loadedAtBottom()) App::main()->historyToDown(this); if (upTo && loadedAtBottom()) App::main()->historyToDown(this);
setUnreadCount(upTo ? countUnread(upTo) : 0); setUnreadCount(upTo ? countUnread(upTo) : 0);
@ -2128,6 +2148,7 @@ MsgId History::inboxRead(HistoryItem *wasRead) {
} }
MsgId History::outboxRead(int32 upTo) { MsgId History::outboxRead(int32 upTo) {
if (upTo < 0) return upTo;
if (!upTo) upTo = msgIdForRead(); if (!upTo) upTo = msgIdForRead();
if (outboxReadBefore < upTo + 1) outboxReadBefore = upTo + 1; if (outboxReadBefore < upTo + 1) outboxReadBefore = upTo + 1;

View File

@ -390,7 +390,7 @@ public:
} }
HistoryJoined *insertJoinedMessage(bool unread); HistoryJoined *insertJoinedMessage(bool unread);
void checkJoinedMessage(); void checkJoinedMessage(bool createUnread = false);
const QDateTime &maxReadMessageDate(); const QDateTime &maxReadMessageDate();
private: private:
@ -827,7 +827,7 @@ public:
} }
bool unread() const { bool unread() const {
if ((out() && (id > 0 && id < _history->outboxReadBefore)) || (!out() && id > 0 && id < _history->inboxReadBefore)) return false; if ((out() && (id > 0 && id < _history->outboxReadBefore)) || (!out() && id > 0 && id < _history->inboxReadBefore)) return false;
return (id > 0 && !out()) ? true : (_flags & MTPDmessage_flag_unread); return (id > 0 && !out() && channelId() != NoChannel) ? true : (_flags & MTPDmessage_flag_unread);
} }
bool notifyByFrom() const { bool notifyByFrom() const {
return _flags & MTPDmessage_flag_notify_by_from; return _flags & MTPDmessage_flag_notify_by_from;

View File

@ -4232,7 +4232,7 @@ void HistoryWidget::sendBotCommand(const QString &cmd, MsgId replyTo) { // reply
toSend += '@' + username; toSend += '@' + username;
} }
App::main()->sendPreparedText(_history, toSend, false, replyTo ? ((!_peer->isUser()/* && (botStatus == 0 || botStatus == 2)*/) ? replyTo : -1) : 0); App::main()->sendPreparedText(_history, toSend, replyTo ? ((!_peer->isUser()/* && (botStatus == 0 || botStatus == 2)*/) ? replyTo : -1) : 0, false);
if (replyTo) { if (replyTo) {
cancelReply(); cancelReply();
if (_keyboard.singleUse() && _keyboard.hasMarkup() && lastKeyboardUsed) { if (_keyboard.singleUse() && _keyboard.hasMarkup() && lastKeyboardUsed) {

View File

@ -504,6 +504,10 @@ void MainWidget::updateForwardingTexts() {
QVector<PeerData*> fromUsers; QVector<PeerData*> fromUsers;
fromUsers.reserve(_toForward.size()); fromUsers.reserve(_toForward.size());
for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) { for (SelectedItemSet::const_iterator i = _toForward.cbegin(), e = _toForward.cend(); i != e; ++i) {
PeerData *from = i.value()->from();
if (HistoryForwarded *fwd = i.value()->toHistoryForwarded()) {
from = fwd->fromForwarded();
}
if (!fromUsersMap.contains(i.value()->from())) { if (!fromUsersMap.contains(i.value()->from())) {
fromUsersMap.insert(i.value()->from(), true); fromUsersMap.insert(i.value()->from(), true);
fromUsers.push_back(i.value()->from()); fromUsers.push_back(i.value()->from());
@ -2645,7 +2649,13 @@ void MainWidget::sentUpdatesReceived(uint64 randomId, const MTPUpdates &result)
void MainWidget::inviteToChannelDone(ChannelData *channel, const MTPUpdates &updates) { void MainWidget::inviteToChannelDone(ChannelData *channel, const MTPUpdates &updates) {
sentUpdatesReceived(updates); sentUpdatesReceived(updates);
channel->updateFull(true); QTimer::singleShot(ReloadChannelMembersTimeout, this, SLOT(onActiveChannelUpdateFull()));
}
void MainWidget::onActiveChannelUpdateFull() {
if (activePeer() && activePeer()->isChannel()) {
activePeer()->asChannel()->updateFull(true);
}
} }
void MainWidget::msgUpdated(PeerId peer, const HistoryItem *msg) { void MainWidget::msgUpdated(PeerId peer, const HistoryItem *msg) {
@ -3549,7 +3559,7 @@ void MainWidget::onSelfParticipantUpdated(ChannelData *channel) {
if ((h ? h : App::history(channel->id))->isEmpty()) { if ((h ? h : App::history(channel->id))->isEmpty()) {
checkPeerHistory(channel); checkPeerHistory(channel);
} else { } else {
h->asChannelHistory()->checkJoinedMessage(); h->asChannelHistory()->checkJoinedMessage(true);
history.peerMessagesUpdated(channel->id); history.peerMessagesUpdated(channel->id);
} }
} else if (h) { } else if (h) {
@ -3654,16 +3664,7 @@ void MainWidget::inviteImportDone(const MTPUpdates &updates) {
switch (updates.type()) { switch (updates.type()) {
case mtpc_updates: v = &updates.c_updates().vchats.c_vector().v; break; case mtpc_updates: v = &updates.c_updates().vchats.c_vector().v; break;
case mtpc_updatesCombined: v = &updates.c_updatesCombined().vchats.c_vector().v; break; case mtpc_updatesCombined: v = &updates.c_updatesCombined().vchats.c_vector().v; break;
case mtpc_updateShort: { default: LOG(("API Error: unexpected update cons %1 (MainWidget::inviteImportDone)").arg(updates.type())); break;
} break;
case mtpc_updateShortMessage: {
} break;
case mtpc_updateShortChatMessage: {
} break;
case mtpc_updateShortSentMessage: {
} break;
case mtpc_updatesTooLong: {
} break;
} }
if (v && !v->isEmpty()) { if (v && !v->isEmpty()) {
if (v->front().type() == mtpc_chat) { if (v->front().type() == mtpc_chat) {

View File

@ -468,6 +468,7 @@ public slots:
void onFullPeerUpdated(PeerData *peer); void onFullPeerUpdated(PeerData *peer);
void onViewsIncrement(); void onViewsIncrement();
void onActiveChannelUpdateFull();
private: private:

View File

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

Binary file not shown.

View File

@ -1697,7 +1697,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.1; CURRENT_PROJECT_VERSION = 0.9.2;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
@ -1715,7 +1715,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.9.1; CURRENT_PROJECT_VERSION = 0.9.2;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast; GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@ -1741,10 +1741,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.1; CURRENT_PROJECT_VERSION = 0.9.2;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.9; DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.1; DYLIB_CURRENT_VERSION = 0.9.2;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@ -1875,10 +1875,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.1; CURRENT_PROJECT_VERSION = 0.9.2;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.9; DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.1; DYLIB_CURRENT_VERSION = 0.9.2;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;

View File

@ -1,5 +1,5 @@
AppVersion 9001 AppVersion 9002
AppVersionStrMajor 0.9 AppVersionStrMajor 0.9
AppVersionStrSmall 0.9.1 AppVersionStrSmall 0.9.2
AppVersionStr 0.9.1 AppVersionStr 0.9.2
DevChannel 0 DevChannel 0