aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/callhistory
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2011-01-27 12:37:06 +0000
committerYana Stamcheva <yana@jitsi.org>2011-01-27 12:37:06 +0000
commiteff3452de89ce845b0da5eda71f3ec0380d8bcee (patch)
tree7e02547c93792ef4292d2641bb412ba7a8979c19 /src/net/java/sip/communicator/impl/callhistory
parentb8960fe67b8d7ef8a4ea792a1894d9799ffd2765 (diff)
downloadjitsi-eff3452de89ce845b0da5eda71f3ec0380d8bcee.zip
jitsi-eff3452de89ce845b0da5eda71f3ec0380d8bcee.tar.gz
jitsi-eff3452de89ce845b0da5eda71f3ec0380d8bcee.tar.bz2
Fixes disappearing call history on search in the contact list.
Call history records shown last.
Diffstat (limited to 'src/net/java/sip/communicator/impl/callhistory')
-rw-r--r--src/net/java/sip/communicator/impl/callhistory/CallHistoryContactSource.java19
-rw-r--r--src/net/java/sip/communicator/impl/callhistory/CallHistoryQueryImpl.java23
2 files changed, 42 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryContactSource.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryContactSource.java
index ac03042..91c3373 100644
--- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryContactSource.java
+++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryContactSource.java
@@ -117,6 +117,9 @@ public class CallHistoryContactSource implements ContactSourceService
{
public void callRecordReceived(CallRecordEvent event)
{
+ if (getStatus() == ContactQuery.QUERY_CANCELED)
+ return;
+
SourceContact contact = new CallHistorySourceContact(
CallHistoryContactSource.this,
event.getCallRecord());
@@ -131,6 +134,17 @@ public class CallHistoryContactSource implements ContactSourceService
fireQueryStatusEvent(status);
}
});
+
+ Iterator<CallRecord> callRecords
+ = callHistoryQuery.getCallRecords().iterator();
+
+ while (callRecords.hasNext())
+ {
+ SourceContact contact = new CallHistorySourceContact(
+ CallHistoryContactSource.this,
+ callRecords.next());
+ sourceContacts.add(contact);
+ }
}
/**
@@ -240,6 +254,11 @@ public class CallHistoryContactSource implements ContactSourceService
for (ContactQueryListener l : listeners)
l.queryStatusChanged(event);
}
+
+ public String getQueryString()
+ {
+ return callHistoryQuery.getQueryString();
+ }
}
/**
diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryQueryImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryQueryImpl.java
index 5ee98a2..b2b0ceb 100644
--- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryQueryImpl.java
+++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryQueryImpl.java
@@ -12,6 +12,7 @@ import net.java.sip.communicator.service.callhistory.*;
import net.java.sip.communicator.service.callhistory.event.*;
import net.java.sip.communicator.service.history.*;
import net.java.sip.communicator.service.history.event.*;
+import net.java.sip.communicator.service.history.records.*;
/**
*
@@ -53,6 +54,18 @@ public class CallHistoryQueryImpl
fireQueryStatusEvent(event.getEventType());
}
});
+
+ Iterator<HistoryRecord> historyRecords
+ = historyQuery.getHistoryRecords().iterator();
+
+ while (historyRecords.hasNext())
+ {
+ CallRecord callRecord
+ = CallHistoryServiceImpl.convertHistoryRecordToCallRecord(
+ historyRecords.next());
+
+ callRecords.add(callRecord);
+ }
}
/**
@@ -142,4 +155,14 @@ public class CallHistoryQueryImpl
}
}
}
+
+ /**
+ * Returns the query string, this query was created for.
+ *
+ * @return the query string, this query was created for
+ */
+ public String getQueryString()
+ {
+ return historyQuery.getQueryString();
+ }
}