summaryrefslogtreecommitdiffstats
path: root/network/qTox/patches/load_friend_name_with_history.diff
blob: 33dd69d115a8add1ce87802bf16747b98af758ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff -urN qTox-3223707.orig/src/friend.cpp qTox-3223707/src/friend.cpp
--- qTox-3223707.orig/src/friend.cpp	2015-04-05 22:37:15.000000000 +0200
+++ qTox-3223707/src/friend.cpp	2015-04-16 05:55:03.531187202 +0200
@@ -40,6 +40,11 @@
         chatForm->loadHistory(QDateTime::currentDateTime().addDays(-7), true);
         widget->historyLoaded = true;
     }
+    if (Settings::getInstance().getEnableLogging())
+    {
+        chatForm->loadHistory(QDateTime::currentDateTime().addDays(-7), true);
+        widget->historyLoaded = true;
+    }
 }
 
 Friend::~Friend()
diff -urN qTox-3223707.orig/src/widget/form/genericchatform.cpp qTox-3223707/src/widget/form/genericchatform.cpp
--- qTox-3223707.orig/src/widget/form/genericchatform.cpp	2015-04-05 22:37:15.000000000 +0200
+++ qTox-3223707/src/widget/form/genericchatform.cpp	2015-04-16 05:57:01.339540592 +0200
@@ -374,6 +374,15 @@
                 return res;
         }
     }
+    // try load alias from settings
+    QString lastTry = Settings::getInstance().getFriendAlias(id);
+    if (!lastTry.isEmpty())
+        return lastTry;
+
+    // try load name from tox
+    lastTry = Core::getInstance()->getPeerName(id);
+    if (!lastTry.isEmpty())
+        return lastTry;
 
     return QString();
 }