diff --git a/libretroshare/src/services/p3Qblog.cc b/libretroshare/src/services/p3Qblog.cc index 04f319702..48259bc6c 100644 --- a/libretroshare/src/services/p3Qblog.cc +++ b/libretroshare/src/services/p3Qblog.cc @@ -61,6 +61,12 @@ bool p3Qblog::setFilterSwitch(bool &filterSwitch) bool p3Qblog::getFriendList(std::list &friendList) { + if(FriendList.empty()) + { + std::cerr << "FriendList empty!" << std::endl; + return false; + } + friendList = FriendList; return true; } @@ -149,10 +155,10 @@ void p3Qblog::loadDummy(void) { /* load usr list */ FriendList.push_back("Usr1"); // home usr/server - FriendList.push_back("mike2"); - FriendList.push_back("mike3"); - FriendList.push_back("mike4"); - FriendList.push_back("mike5"); + FriendList.push_back("Mike2"); + FriendList.push_back("Mike3"); + FriendList.push_back("Mike4"); + FriendList.push_back("Mike5"); /* set usr status: need to create usr/status set or just add to profile object */ Status = "I'm chilling homey"; @@ -167,28 +173,30 @@ void p3Qblog::loadDummy(void) FriendSongset.insert(std::make_pair("Mike4", "revolvers")); FriendSongset.insert(std::make_pair("Mike5", "pepolvers")); - /* load could usr blogs, not all tho */ + /* load usr blogs */ + /* the usr dummy usr blogs */ std::string usrBlog = "I think we should eat more cheese"; - std::string Blog2 = "today was so cool, i got attacked by fifty ninja while buying a loaf so i used my paper bag to suffocate each of them to death at hyper speed"; - + std::string Blog3 = "Nuthins up"; + std::string Blog4 = "stop bothering me"; std::string Blog5 = "I'm really a boring person and having nothin interesting to say"; + - long int time1, time2, time5; - time1 = 12123121; - time2 = 1213212; - time5 = 522133131; + time_t time1, time2, time3, time4, time5; // times of blogs - /*** time blog multimaps ****/ - - std::multimap timeBlog1, timeBlog2, timeBlog5; + /*** populate time/blog multimaps and usrBlog map ****/ + std::multimap timeBlog1, timeBlog2, timeBlog3, timeBlog4, timeBlog5; timeBlog1.insert(std::make_pair(time1, usrBlog)); timeBlog2.insert(std::make_pair(time2, Blog2)); + timeBlog3.insert(std::make_pair(time3, Blog3)); + timeBlog4.insert(std::make_pair(time4, Blog4)); timeBlog5.insert(std::make_pair(time5, Blog5)); UsrBlogSet.insert(std::make_pair("Usr1", timeBlog1)); UsrBlogSet.insert(std::make_pair("Mike2", timeBlog2)); + UsrBlogSet.insert(std::make_pair("Mike3", timeBlog2)); + UsrBlogSet.insert(std::make_pair("Mike4", timeBlog2)); UsrBlogSet.insert(std::make_pair("Mike5", timeBlog5)); } diff --git a/libretroshare/src/services/p3Qblog.h b/libretroshare/src/services/p3Qblog.h index e283e2152..bcca14e61 100644 --- a/libretroshare/src/services/p3Qblog.h +++ b/libretroshare/src/services/p3Qblog.h @@ -43,6 +43,7 @@ /*! * contains definitions of the interface and blog information to be manipulated + * See RsQblog class for virtual methods documentation */ class p3Qblog : public RsQblog { @@ -65,16 +66,25 @@ private: - std::list FilterList; /// contains the list of ids usr only wants to see - bool FilterSwitch; /// determines whether filter is activated or not - std::string Status; /// the status of the user - std::string FavSong; /// favorite song of usr, consider sending pathfile to d/l - std::list FriendList; /// list of friends - std::map FriendSongset; // - //std::multimap blogs; /// blogs recorded - std::map< std::string, std::multimap > UsrBlogSet; /// contain usr and their blogs + /// contains the list of ids usr only wants to see + std::list FilterList; + /// determines whether filter is activated or not + bool FilterSwitch; + /// the status of the user + std::string Status; + /// favorite song of usr, consider sending pathfile to d/l + std::string FavSong; + /// list of friends + std::list FriendList; + /// usr and fav song + std::map FriendSongset; + /// usr and current status + std::map FriendStatusSet; + /// contain usr and their blogs + std::map< std::string, std::multimap > UsrBlogSet; - void loadDummy(void); /// loads dummy data for testing + /// loads dummy data for testing + void loadDummy(void); };