- fixed up avatar exchange between peers

- reverted preceding commit about PNG/JPG in popup chat dialog. This only concerns internal data representation and this string has nothing to do with accepted image formats.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1704 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-09-30 20:53:18 +00:00
parent c255ec1a21
commit dee82c5f1b
12 changed files with 31 additions and 28 deletions

View file

@ -204,6 +204,7 @@ class NotifyBase
virtual void notifyCustomState(const std::string& peer_id,const std::string& status_string) {}
virtual void notifyHashingInfo(std::string fileinfo) { (void)fileinfo; return ; }
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; }
virtual void notifyPeerHasNewAvatar(std::string peer_id) { (void)peer_id; }
};
const int NOTIFY_LIST_NEIGHBOURS = 1;

View file

@ -168,13 +168,6 @@ void p3Msgs::initRsChatInfo(RsChatMsgItem *c, ChatInfo &i)
i.chatflags |= RS_CHAT_PUBLIC;
//std::cerr << "RsServer::initRsChatInfo() Chat Public!!!";
}
//std::cerr << std::endl;
if(c->chatFlags & RS_CHAT_FLAG_AVATAR_AVAILABLE)
{
std::cerr << "p3msgs::initRsChatInfo(): new avatar available for peer " << i.rsid << ". Sending above." << std::endl ;
i.chatflags |= RS_CHAT_AVATAR_AVAILABLE;
}
}
void p3Msgs::getOwnAvatarData(unsigned char *& data,int& size)

View file

@ -399,6 +399,12 @@ std::list<RsChatMsgItem *> p3ChatService::getChatQueue()
if(ca != NULL)
{
receiveAvatarJpegData(ca) ;
#ifdef CHAT_DEBUG
std::cerr << "Received avatar data for peer " << ca->PeerId() << ". Notifying." << std::endl ;
#endif
rsicontrol->getNotify().notifyPeerHasNewAvatar(ca->PeerId()) ;
delete item ;
continue ;
}
@ -490,7 +496,7 @@ void p3ChatService::getAvatarJpegData(const std::string& peer_id,unsigned char *
std::map<std::string,AvatarInfo *>::const_iterator it = _avatars.find(peer_id) ;
std::cerr << "p3chatservice:: avatar requested from above. " << std::endl ;
std::cerr << "p3chatservice:: avatar for peer " << peer_id << " requested from above. " << std::endl ;
// has avatar. Return it strait away.
//
if(it!=_avatars.end())