[-]
[+]
|
Added |
_service:tar_git:telegram-qt.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,7 +1,7 @@
<services>
<service name="tar_git">
<param name="url">https://github.com/Kaffeine/telegram-qt.git</param>
- <param name="branch">master-staging</param>
+ <param name="branch">master</param>
<param name="revision">HEAD</param>
<param name="token"/>
<param name="debian">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/ContactsApi.cpp
^
|
@@ -112,6 +112,15 @@
emit q->contactStatusChanged(userId, getApiContactStatus(status.tlType));
}
+void ContactsApiPrivate::onUserPhotoChanged(quint32 userId, const TLUserProfilePhoto &photo)
+{
+ Q_Q(ContactsApi);
+ if (!dataInternalApi()->updateUserPhoto(userId, photo)) {
+ return;
+ }
+ emit q->contactPhotoChanged(userId);
+}
+
void ContactsApiPrivate::onContactsImported(PendingContactsOperation *operation,
ContactsRpcLayer::PendingContactsImportedContacts *rpcOperation)
{
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/ContactsApi.hpp
^
|
@@ -64,6 +64,7 @@
Q_SIGNALS:
void contactStatusChanged(quint32 userId, Telegram::Namespace::ContactStatus status);
+ void contactPhotoChanged(quint32 userId);
protected:
Q_DECLARE_PRIVATE_D(d, ContactsApi)
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/ContactsApi_p.hpp
^
|
@@ -55,6 +55,7 @@
public slots:
void onUserStatusChanged(quint32 userId, const TLUserStatus &status);
+ void onUserPhotoChanged(quint32 userId, const TLUserProfilePhoto &photo);
protected slots:
void onContactsImported(PendingContactsOperation *operation, ContactsRpcLayer::PendingContactsImportedContacts *rpcOperation);
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/DataStorage.cpp
^
|
@@ -579,6 +579,26 @@
return true;
}
+bool DataInternalApi::updateUserPhoto(quint32 userId, const TLUserProfilePhoto &photo)
+{
+ TLUser *existsUser = m_users.value(userId);
+ if (!existsUser) {
+ return false;
+ }
+ if (existsUser->photo.photoId == photo.photoId) {
+ return false;
+ }
+
+ existsUser->photo = photo;
+ if (existsUser->photo.tlType == TLValue::UserProfilePhotoEmpty) {
+ existsUser->flags &= ~TLUser::Photo;
+ } else {
+ existsUser->flags |= TLUser::Photo;
+ }
+
+ return true;
+}
+
TLInputPeer DataInternalApi::toInputPeer(const TLPeer &peer) const
{
return toInputPeer(Utils::toPublicPeer(peer));
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/DataStorage_p.hpp
^
|
@@ -97,6 +97,7 @@
void dequeueMessageRead(const Peer peer, quint32 messageId);
bool updateInboxRead(const Peer peer, quint32 maxId);
bool updateOutboxRead(const Peer peer, quint32 maxId);
+ bool updateUserPhoto(quint32 userId, const TLUserProfilePhoto &photo);
quint32 selfUserId() const { return m_selfUserId; }
|
[-]
[+]
|
Changed |
_service:tar_git:telegram-qt-0.2.0.tar.bz2/TelegramQt/UpdatesLayer.cpp
^
|
@@ -174,6 +174,9 @@
case TLValue::UpdateChatUserTyping:
messagingApi()->onChatUserActionChanged(Peer::fromChatId(update.chatId), update.userId, update.action);
return true;
+ case TLValue::UpdateUserPhoto:
+ contactsApi()->onUserPhotoChanged(update.userId, update.photo);
+ return true;
default:
break;
}
|