mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-30 04:16:40 -05:00
Don't add a ChatMsgItem as feed on own public chat message.
Moved the handling of the avatar from PeerItem::updateItem and ChatMsgItem::updateItem called with QTimer to connect to the signal peerHasNewAvatar. Fixed compiler warning. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3419 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b01c6bf3d1
commit
af4667232b
6 changed files with 44 additions and 37 deletions
|
|
@ -27,6 +27,8 @@
|
|||
#include "../RsAutoUpdatePage.h"
|
||||
#include "gui/msgs/MessageComposer.h"
|
||||
|
||||
#include "gui/notifyqt.h"
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
|
|
@ -55,9 +57,12 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint
|
|||
//connect( addButton, SIGNAL( clicked( void ) ), this, SLOT( addFriend ( void ) ) );
|
||||
//connect( removeButton, SIGNAL( clicked( void ) ), this, SLOT( removeFriend ( void ) ) );
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&)));
|
||||
|
||||
small();
|
||||
updateItemStatic();
|
||||
updateItem();
|
||||
updateAvatar(QString::fromStdString(mPeerId));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -212,13 +217,10 @@ void PeerItem::updateItem()
|
|||
/* slow Tick */
|
||||
int msec_rate = 10129;
|
||||
|
||||
loadAvatar();
|
||||
|
||||
QTimer::singleShot( msec_rate, this, SLOT(updateItem( void ) ));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void PeerItem::small()
|
||||
{
|
||||
expandFrame->hide();
|
||||
|
|
@ -320,8 +322,12 @@ void PeerItem::openChat()
|
|||
}
|
||||
}
|
||||
|
||||
void PeerItem::loadAvatar()
|
||||
void PeerItem::updateAvatar(const QString &peer_id)
|
||||
{
|
||||
if (peer_id.toStdString() != mPeerId) {
|
||||
/* it 's not me */
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char *data = NULL;
|
||||
int size = 0 ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue