add default room
diff --git a/chatdialog.cpp b/chatdialog.cpp
index 0b3d6ad..fdde9df 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -74,7 +74,7 @@
ChatDialog::initializeSync()
{
// create sync socket
- if(!m_user.getChatroom().isEmpty()) {
+ if(!m_user.getChatroom().isEmpty() && !m_user.getNick().isEmpty()) {
std::string syncPrefix = BROADCAST_PREFIX_FOR_SYNC_DEMO;
syncPrefix += "/";
syncPrefix += m_user.getChatroom().toStdString();
@@ -699,6 +699,7 @@
m_minimaniho = s.value("minimaniho", false).toBool();
if (nick == "" || chatroom == "" || originPrefix == "") {
m_user.setOriginPrefix(DEFAULT_LOCAL_PREFIX);
+ m_user.setChatroom("retreat2012");
QTimer::singleShot(500, this, SLOT(buttonPressed()));
return false;
}
@@ -985,6 +986,10 @@
m_historyInitialized = false;
initializeSync();
}
+ else if (m_sock == NULL)
+ {
+ initializeSync();
+ }
else
{
#ifdef __DEBUG
diff --git a/settingdialog.cpp b/settingdialog.cpp
index 284b1a3..23ddc3c 100644
--- a/settingdialog.cpp
+++ b/settingdialog.cpp
@@ -20,7 +20,7 @@
QValidator *validator = new QRegExpValidator(rx, this);
prefixEdit->setValidator(validator);
- if (nick.isEmpty() && chatroom.isEmpty())
+ if (nick.isEmpty())
{
prefixEdit->hide();
prefixLabel->hide();