Added three new toasters - private chat, group chat and chat lobby.

Fixed some utf8 issues in toasters and feeds.
Fixed german language.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5065 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-03-30 23:02:52 +00:00
parent 0778e8f691
commit 37986e00a3
35 changed files with 1335 additions and 239 deletions

View file

@ -38,14 +38,16 @@ extern RsNotify *rsNotify;
const uint32_t RS_SYS_ERROR = 0x0001;
const uint32_t RS_SYS_WARNING = 0x0002;
const uint32_t RS_SYS_INFO = 0x0004;
const uint32_t RS_SYS_INFO = 0x0004;
const uint32_t RS_POPUP_MSG = 0x0001;
//const uint32_t RS_POPUP_CHAT = 0x0002;
//const uint32_t RS_POPUP_CALL = 0x0004;
const uint32_t RS_POPUP_CONNECT = 0x0008;
const uint32_t RS_POPUP_MSG = 0x0001;
const uint32_t RS_POPUP_CHAT = 0x0002;
//const uint32_t RS_POPUP_CALL = 0x0004;
const uint32_t RS_POPUP_CONNECT = 0x0008;
const uint32_t RS_SYSTRAY_GROUP_MSG = 0x0010;
const uint32_t RS_POPUP_DOWNLOAD = 0x0020;
const uint32_t RS_POPUP_DOWNLOAD = 0x0020;
const uint32_t RS_POPUP_GROUPCHAT = 0x0040;
const uint32_t RS_POPUP_CHATLOBBY = 0x0080;
/* CHAT flags are here - so they are in the same place as
* other Notify flags... not used by libretroshare though

View file

@ -25,6 +25,7 @@
#include "util/rsdir.h"
#include "util/rsrandom.h"
#include "util/rsstring.h"
#include "retroshare/rsiface.h"
#include "retroshare/rspeers.h"
#include "pqi/pqibin.h"
@ -848,6 +849,8 @@ bool p3ChatService::handleRecvChatMsgItem(RsChatMsgItem *ci)
bool privateChanged = false;
time_t now = time(NULL);
std::string name;
uint32_t popupChatFlag = RS_POPUP_CHAT;
// check if it's a lobby msg, in which case we replace the peer id by the lobby's virtual peer id.
//
@ -878,7 +881,9 @@ bool p3ChatService::handleRecvChatMsgItem(RsChatMsgItem *ci)
//
std::string virtual_peer_id ;
getVirtualPeerId(cli->lobby_id,virtual_peer_id) ;
cli->PeerId(virtual_peer_id) ;
cli->PeerId(virtual_peer_id) ;
name = cli->nick;
popupChatFlag = RS_POPUP_CHATLOBBY;
}
else
{
@ -927,10 +932,14 @@ bool p3ChatService::handleRecvChatMsgItem(RsChatMsgItem *ci)
ci->chatFlags |= RS_CHAT_FLAG_AVATAR_AVAILABLE ;
}
if ((ci->chatFlags & RS_CHAT_FLAG_PRIVATE) == 0) {
std::string message;
librs::util::ConvertUtf16ToUtf8(ci->message, message);
if (ci->chatFlags & RS_CHAT_FLAG_PRIVATE) {
/* notify private chat message */
getPqiNotify()->AddPopupMessage(popupChatFlag, ci->PeerId(), name, message);
} else {
/* notify public chat message */
std::string message;
message.assign(ci->message.begin(), ci->message.end());
getPqiNotify()->AddPopupMessage(RS_POPUP_GROUPCHAT, ci->PeerId(), "", message);
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_CHAT_NEW, ci->PeerId(), message, "");
}

View file

@ -35,6 +35,7 @@
#include "util/rsdebug.h"
#include "util/rsdir.h"
#include "util/rsstring.h"
#include <sstream>
#include <iomanip>
@ -150,10 +151,10 @@ void p3MsgService::processMsg(RsMsgItem *mi)
pqiNotify *notify = getPqiNotify();
if (notify)
{
std::string message , title;
notify->AddPopupMessage(RS_POPUP_MSG, mi->PeerId(),
title.assign(mi->subject.begin(), mi->subject.end()),
message.assign(mi->message.begin(),mi->message.end()));
std::string title, message;
librs::util::ConvertUtf16ToUtf8(mi->subject, title);
librs::util::ConvertUtf16ToUtf8(mi->message, message);
notify->AddPopupMessage(RS_POPUP_MSG, mi->PeerId(), title, message);
std::ostringstream out;
out << mi->msgId;