Added new functions to support profile and favourite files in Blog.

Added Dummy information too.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@587 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-06-08 18:32:40 +00:00
parent 6b4d072bb0
commit 4a58c71f9e
3 changed files with 87 additions and 2 deletions

View File

@ -30,6 +30,8 @@
#include <string>
#include <list>
#include <map>
#include "rsiface/rstypes.h"
/* delcare interafce for everyone o use */
@ -104,7 +106,36 @@ extern RsQblog *rsQblog;
* @param blogs contains the blog msgs of usr along with time posted for sorting
*/
virtual bool getBlogs(std::map< std::string, std::multimap<long int, std:: string> > &blogs) = 0;
/**
* Stuff DrBob Added for Profile View!
*/
/**
* get users Latest Blog Post.
* @param id the usr whose idetails you want to get.
* @param ts Timestamp of the Blog Post.
* @param post the actual Blog Post.
*/
virtual bool getPeerLatestBlog(std::string id, uint32_t &ts, std::wstring &post) = 0;
/**
* get users Profile.
* @param id the user id
* @param entries set of profile information.
*/
virtual bool getPeerProfile(std::string id, std::list< std::pair<std::wstring, std::wstring> > &entries) = 0;
/**
* get users fav files
* @param id the user whose info you want.
* @param favs list of Files
*/
virtual bool getPeerFavourites(std::string id, std::list<FileInfo> &favs) = 0;
};
#endif /*RSQBLOG_H_*/

View File

@ -89,3 +89,55 @@ bool p3Blog::removeFiltFriend(std::string &usrId)
return mQblog->removeFiltFriend(usrId);
}
bool p3Blog::getPeerLatestBlog(std::string id, uint32_t &ts, std::wstring &post)
{
//return mQblog->getPeerLatestBlog(id, ts, post);
// dummy info.
ts = time(NULL);
post = L"Hmmm, not much, just eating prawn crackers at the moment... but I'll post this every second if you want ;)";
return true;
}
bool p3Blog::getPeerProfile(std::string id, std::list< std::pair<std::wstring, std::wstring> > &entries)
{
//return mQblog->getPeerProfile(id, entries);
std::wstring a = L"phone number";
std::wstring b = L"0845 XXX 43639434363878735453";
entries.push_back(make_pair(a,b));
a = L"Favourite Film";
b = L"Prawn Crackers revenge";
entries.push_back(make_pair(a,b));
a = L"Favourite Music";
b = L"Eric Clapton, Neil Diamond, Folk, Country and Western";
entries.push_back(make_pair(a,b));
return true;
}
bool p3Blog::getPeerFavourites(std::string id, std::list<FileInfo> &favs)
{
//return mQblog->getPeerFavourites(id, favs);
FileInfo a;
a.fname = "Prawn Crackers - Full Script.txt";
a.size = 1000553;
a.hash = "XXXXXXXXXXXXXXXXXXXXXX";
favs.push_back(a);
return true;
}

View File

@ -54,7 +54,9 @@ class p3Blog : public RsQblog
virtual bool sendBlog(const std::string &msg);
virtual bool getBlogs(std::map< std::string, std::multimap<long int, std:: string> > &blogs);
virtual bool getPeerLatestBlog(std::string id, uint32_t &ts, std::wstring &post);
virtual bool getPeerProfile(std::string id, std::list< std::pair<std::wstring, std::wstring> > &entries);
virtual bool getPeerFavourites(std::string id, std::list<FileInfo> &favs);
private: