* #36758: link with displayed name stored in history
diff --git a/res/layout/frag_contact_list.xml b/res/layout/frag_contact_list.xml
index fbcbded..5c7ca1c 100644
--- a/res/layout/frag_contact_list.xml
+++ b/res/layout/frag_contact_list.xml
@@ -32,6 +32,7 @@
 -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:swipe="http://schemas.android.com/apk/res-auto"
     android:id="@+id/drag_view"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -101,4 +102,5 @@
         android:textColor="@color/white"
         android:textSize="30sp" />
 
+
 </LinearLayout>
\ No newline at end of file
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index a383f01..3b1bc11 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -40,6 +40,5 @@
 	
 	<dimen name="bubble_size">100dp</dimen>
 	
-	<dimen name="header_history_detail">400dp</dimen>
 
 </resources>
\ No newline at end of file
diff --git a/src/org/sflphone/client/HomeActivity.java b/src/org/sflphone/client/HomeActivity.java
index 4fc6e9c..f03f80b 100644
--- a/src/org/sflphone/client/HomeActivity.java
+++ b/src/org/sflphone/client/HomeActivity.java
@@ -86,6 +86,7 @@
 import android.view.Gravity;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.WindowManager;
 import android.widget.RelativeLayout;
 import android.widget.Toast;
 
@@ -637,6 +638,14 @@
     }
 
     @Override
+    public void toggleForSearchDrawer() {
+        if (mContactDrawer.isExpanded()) {
+            mContactDrawer.collapsePane();
+        } else
+            mContactDrawer.expandPane();
+    }
+
+    @Override
     public void confCreated(Intent intent) {
         // TODO Auto-generated method stub
 
diff --git a/src/org/sflphone/fragments/ContactListFragment.java b/src/org/sflphone/fragments/ContactListFragment.java
index f6f57a4..5cb5838 100644
--- a/src/org/sflphone/fragments/ContactListFragment.java
+++ b/src/org/sflphone/fragments/ContactListFragment.java
@@ -127,6 +127,10 @@
         public void setDragView(RelativeLayout relativeLayout) {
             
         }
+
+        @Override
+        public void toggleForSearchDrawer() {
+        }
     };
 
     public interface Callbacks {
@@ -144,6 +148,8 @@
 
         void setDragView(RelativeLayout relativeLayout);
 
+        void toggleForSearchDrawer();
+
     }
 
     @Override
@@ -185,7 +191,7 @@
                 mQuickReturnSearchView.setOnQueryTextListener(ContactListFragment.this);
                 mQuickReturnSearchView.setIconified(false);
                 mQuickReturnSearchView.setFocusable(true);
-                mCallbacks.toggleDrawer();
+                mCallbacks.toggleForSearchDrawer();
             }
         });
 
@@ -274,7 +280,7 @@
 
             @Override
             public void onItemClick(AdapterView<?> arg0, View view, int pos, long id) {
-
+                Log.i(TAG, "Opening Item");
                 mSwipeLvTouchListener.openItem(view, pos, id);
             }
         });
diff --git a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java
index e697b7e..4affba3 100644
--- a/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java
+++ b/src/org/sflphone/fragments/DetailsHistoryEntryFragment.java
@@ -66,7 +66,6 @@
     View mheaderView;
     DetailHistoryAdapter mAdapter;
     HistoryEntry toDisplay;
-    @SuppressWarnings("unused")
     private static final String TAG = DetailsHistoryEntryFragment.class.getSimpleName();
     ContactPictureTask tasker;
 
@@ -120,6 +119,11 @@
         super.onCreate(savedInstanceState);
 
         toDisplay = (HistoryEntry) getArguments().get("entry");
+
+        Log.i(TAG, "Ok, we got " + toDisplay.getIncoming_sum() + " incoming calls");
+        Log.i(TAG, "Ok, we got " + toDisplay.getMissed_sum() + " missed calls");
+        Log.i(TAG, "Ok, we got " + toDisplay.getOutgoing_sum() + " outgoing calls");
+
         mAdapter = new DetailHistoryAdapter(toDisplay.getCalls(), getActivity());
     }
 
diff --git a/src/org/sflphone/fragments/HistoryFragment.java b/src/org/sflphone/fragments/HistoryFragment.java
index 94bc3b9..f602020 100644
--- a/src/org/sflphone/fragments/HistoryFragment.java
+++ b/src/org/sflphone/fragments/HistoryFragment.java
@@ -220,7 +220,6 @@
 
             // SipCall call = (SipCall) mCallList.values().toArray()[position];
             entryView.displayName.setText(dataset.get(pos).getContact().getmDisplayName());
-
             infos_fetcher.execute(new ContactPictureTask(mContext, entryView.photo, dataset.get(pos).getContact()));
 
             entryView.incoming.setText(getString(R.string.hist_in_calls, dataset.get(pos).getIncoming_sum()));
diff --git a/src/org/sflphone/loaders/HistoryLoader.java b/src/org/sflphone/loaders/HistoryLoader.java
index 94c01e5..c454cc8 100644
--- a/src/org/sflphone/loaders/HistoryLoader.java
+++ b/src/org/sflphone/loaders/HistoryLoader.java
@@ -46,10 +46,15 @@
             ArrayList<HashMap<String, String>> history = (ArrayList<HashMap<String, String>>) service.getHistory();
             for (HashMap<String, String> entry : history) {
 
+                CallContact contact = null;
+                String contactName = entry.get(ServiceConstants.history.DISPLAY_NAME_KEY);
                 String number_called = entry.get(ServiceConstants.history.PEER_NUMBER_KEY);
+                if (contactName.isEmpty()) {
+                    contact = ContactBuilder.buildUnknownContact(number_called);
+                } else {
+                    contact = ContactBuilder.getInstance().buildSimpleContact(contactName, number_called);
+                }
 
-//                Log.w(TAG, "----------------------Number" + number_called);
-                CallContact c = null;
                 if (historyEntries.containsKey(number_called)) {
                     // It's a direct match
                     historyEntries.get(number_called).addHistoryCall(new HistoryCall(entry));
@@ -59,19 +64,17 @@
                     Matcher m = p.matcher(number_called);
                     if (m.find()) {
 
-//                        Log.i(TAG, "Pattern found:" + m.group(1));
                         if (historyEntries.containsKey(m.group(1) + "@" + m.group(2))) {
                             historyEntries.get(m.group(1) + "@" + m.group(2)).addHistoryCall(new HistoryCall(entry));
                         } else {
-                            c = ContactBuilder.buildUnknownContact(m.group(1) + "@" + m.group(2));
-                            HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), c);
+                            HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact);
                             e.addHistoryCall(new HistoryCall(entry));
                             historyEntries.put(m.group(1) + "@" + m.group(2), e);
                         }
 
                     } else {
-                        c = ContactBuilder.buildUnknownContact(number_called);
-                        HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), c);
+
+                        HistoryEntry e = new HistoryEntry(entry.get(ServiceConstants.history.ACCOUNT_ID_KEY), contact);
                         e.addHistoryCall(new HistoryCall(entry));
                         historyEntries.put(number_called, e);
                     }
diff --git a/src/org/sflphone/model/CallContact.java b/src/org/sflphone/model/CallContact.java
index adb7474..fd70395 100644
--- a/src/org/sflphone/model/CallContact.java
+++ b/src/org/sflphone/model/CallContact.java
@@ -182,6 +182,13 @@
             return result;
         }
 
+        public CallContact buildSimpleContact(String name, String number_called) {
+            ArrayList<Phone> phones = new ArrayList<Phone>();
+            phones.add(new Phone(number_called, 0));
+
+            return new CallContact(-1, name, 0, phones, new ArrayList<CallContact.Phone>(), "", false);
+        }
+
     }
 
     @Override
diff --git a/src/org/sflphone/model/HistoryEntry.java b/src/org/sflphone/model/HistoryEntry.java
index 578a030..278277b 100644
--- a/src/org/sflphone/model/HistoryEntry.java
+++ b/src/org/sflphone/model/HistoryEntry.java
@@ -85,11 +85,13 @@
 
     public void addHistoryCall(HistoryCall historyCall) {
         calls.put(historyCall.call_start, historyCall);
-        if (historyCall.getDirection().contentEquals(ServiceConstants.history.OUTGOING_STRING)) {
-            ++outgoing_sum;
-        } else if (historyCall.isIncoming()) {
+        if (historyCall.isIncoming()) {
             ++incoming_sum;
+        } else {
+            ++outgoing_sum;
         }
+        if (historyCall.isMissed())
+            missed_sum++;
     }
 
     public String getNumber() {
@@ -134,7 +136,6 @@
         dest.writeList(new ArrayList<HistoryCall>(calls.values()));
         dest.writeList(new ArrayList<Long>(calls.keySet()));
 
-        dest.writeMap(calls);
         dest.writeString(accountID);
         dest.writeInt(missed_sum);
         dest.writeInt(outgoing_sum);
@@ -242,7 +243,7 @@
         }
 
         public String getDisplayName() {
-            return displayName;
+            return displayName.substring(0, displayName.indexOf('@'));
         }
 
         @Override