mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
commit
f6b830d5aa
@ -157,7 +157,7 @@ bool DistributedChatService::handleRecvChatLobbyMsgItem(RsChatMsgItem *ci)
|
||||
//name = cli->nick;
|
||||
//popupChatFlag = RS_POPUP_CHATLOBBY;
|
||||
|
||||
RsServer::notify()->AddPopupMessage(RS_POPUP_CHATLOBBY, cli->signature.keyId.toStdString(), cli->nick, cli->message); /* notify private chat message */
|
||||
RsServer::notify()->AddPopupMessage(RS_POPUP_CHATLOBBY, virtual_peer_id.toStdString(), cli->signature.keyId.toStdString(), cli->message); /* notify private chat message */
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "notifyqt.h"
|
||||
#include <retroshare/rsnotify.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsidentity.h>
|
||||
#include <util/rsdir.h>
|
||||
|
||||
#include "RsAutoUpdatePage.h"
|
||||
@ -862,15 +863,9 @@ void NotifyQt::UpdateGUI()
|
||||
case RS_POPUP_CHATLOBBY:
|
||||
if ((popupflags & RS_POPUP_CHATLOBBY) && !_disableAllToaster)
|
||||
{
|
||||
if(RsPeerId::SIZE_IN_BYTES < sizeof(ChatLobbyId))
|
||||
{
|
||||
std::cerr << "NotifyQt::UpdateGUI() Error: ChatLobbyId does not fit into a RsPeerId, this should not happen!" << std::endl;
|
||||
break;
|
||||
}
|
||||
RsPeerId vpid(id); // create virtual peer id
|
||||
ChatLobbyId lobby_id;
|
||||
// copy first bytes of virtual peer id, to make a chat lobby id
|
||||
memcpy(&lobby_id, vpid.toByteArray(), sizeof(ChatLobbyId));
|
||||
if(!rsMsgs->isLobbyId(RsPeerId(id), lobby_id))
|
||||
break;
|
||||
|
||||
ChatDialog *chatDialog = ChatDialog::getChat(ChatId(lobby_id));
|
||||
ChatWidget *chatWidget;
|
||||
@ -880,10 +875,11 @@ void NotifyQt::UpdateGUI()
|
||||
}
|
||||
ChatLobbyDialog *chatLobbyDialog = dynamic_cast<ChatLobbyDialog*>(chatDialog);
|
||||
|
||||
if (!chatLobbyDialog || chatLobbyDialog->isParticipantMuted(RsGxsId(title)))
|
||||
RsGxsId sender(title);
|
||||
if (!chatLobbyDialog || chatLobbyDialog->isParticipantMuted(sender))
|
||||
break; // participant is muted
|
||||
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(lobby_id, QString::fromUtf8(title.c_str()), QString::fromUtf8(msg.c_str())));
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(lobby_id, sender, QString::fromUtf8(msg.c_str())));
|
||||
}
|
||||
break;
|
||||
case RS_POPUP_CONNECT_ATTEMPT:
|
||||
@ -1002,8 +998,13 @@ void NotifyQt::testToasters(uint notifyFlags, /*RshareSettings::enumToasterPosit
|
||||
toaster = new ToasterItem(new GroupChatToaster(id, message));
|
||||
break;
|
||||
case RS_POPUP_CHATLOBBY:
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(0, title, message));
|
||||
{
|
||||
std::list<RsGxsId> gxsid;
|
||||
if(rsIdentity->getOwnIds(gxsid) && (gxsid.size() > 0)){
|
||||
toaster = new ToasterItem(new ChatLobbyToaster(0, gxsid.front(), message));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RS_POPUP_CONNECT_ATTEMPT:
|
||||
toaster = new ToasterItem(new FriendRequestToaster(pgpid, title, id));
|
||||
break;
|
||||
|
@ -22,10 +22,11 @@
|
||||
#include "ChatLobbyToaster.h"
|
||||
#include "gui/chat/ChatDialog.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include <retroshare/rsidentity.h>
|
||||
|
||||
#include <retroshare/rsmsgs.h>
|
||||
|
||||
ChatLobbyToaster::ChatLobbyToaster(const ChatLobbyId &lobby_id, const QString &name, const QString &message):
|
||||
ChatLobbyToaster::ChatLobbyToaster(const ChatLobbyId &lobby_id, const RsGxsId &sender_id, const QString &message):
|
||||
QWidget(NULL), mLobbyId(lobby_id)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
@ -39,7 +40,14 @@ ChatLobbyToaster::ChatLobbyToaster(const ChatLobbyId &lobby_id, const QString &n
|
||||
ui.avatarWidget->setFrameType(AvatarWidget::NORMAL_FRAME);
|
||||
ui.avatarWidget->setDefaultAvatar(":images/chat_64.png");
|
||||
|
||||
QString lobbyName = RsHtml::plainText(name);
|
||||
/* Get sender info */
|
||||
RsIdentityDetails idd;
|
||||
if(!rsIdentity->getIdDetails(sender_id, idd))
|
||||
return;
|
||||
|
||||
ui.avatarWidget->setId(ChatId(sender_id));
|
||||
|
||||
QString lobbyName = RsHtml::plainText(idd.mNickname);
|
||||
|
||||
ChatLobbyInfo clinfo ;
|
||||
if(rsMsgs->getChatLobbyInfo(mLobbyId,clinfo))
|
||||
|
@ -36,7 +36,7 @@ class ChatLobbyToaster : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ChatLobbyToaster(const ChatLobbyId &lobby_id, const QString &name, const QString &message);
|
||||
ChatLobbyToaster(const ChatLobbyId &lobby_id, const RsGxsId &sender_id, const QString &message);
|
||||
|
||||
private slots:
|
||||
void chatButtonSlot();
|
||||
|
@ -681,7 +681,8 @@ static void optimizeHtml(QDomDocument& doc, QDomElement& currentElement, unsigne
|
||||
// remove Qt standard <p> or empty <p>
|
||||
index += element.childNodes().length();
|
||||
removeElement(currentElement, element);
|
||||
addBR = true;
|
||||
// do not add extra <br> after empty paragraph, the paragraph already contains one
|
||||
addBR = ! style.startsWith("-qt-paragraph-type:empty");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user