summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircserver.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircserver.cpp b/noncore/net/opieirc/ircserver.cpp
index 7e7e412..abb770b 100644
--- a/noncore/net/opieirc/ircserver.cpp
+++ b/noncore/net/opieirc/ircserver.cpp
@@ -1,7 +1,12 @@
+#include <qpe/global.h>
+#include <qpe/contact.h>
+
+#include <qobject.h>
+#include <qfile.h>
+
#include "ircserver.h"
#include "ircversion.h"
-#include <qobject.h>
IRCServer::IRCServer() {
m_port = 6667;
@@ -73,8 +78,16 @@ QString IRCServer::nick() {
QString IRCServer::realname() {
if(!m_realname.isEmpty())
return m_realname;
+ // Try to fetch realname from addressbook
+ QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" );
+ if ( QFile::exists( file ) ) {
+ Contact cont = Contact::readVCard( file )[0];
+ QString realName = cont.fullName();
+ if(!realName.isEmpty())
+ return realName;
+ }
- return QString(QObject::tr("Using")) + " " + QString(APP_VERSION);
+ return QString(APP_VERSION + QObject::tr(" User"));
}
QString IRCServer::channels() {