summaryrefslogtreecommitdiff
path: root/telepathy-logger/log-store-xml.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add a test for log-iter-xml/get-eventsDebarshi Ray2015-04-201-1/+2
| | | | | | | | ... to cover files with invalid XML. Since WARNINGs interfere with the test, we suppress them when testmode is on. https://bugs.freedesktop.org/show_bug.cgi?id=40675 https://bugs.freedesktop.org/show_bug.cgi?id=89595
* logger: fix several string and date leaksSimon McVittie2014-03-181-2/+9
| | | | | Reviewed-by: Guillaume Desmottes (cherry picked from commit a4103cf87192a7e57d1b762438f53cef3c3e61fa)
* Ask libxml2 to recover from errors of possibleSjoerd Simons2014-01-051-1/+1
| | | | | | | Let libxml2 try and recover on parse error instead to avoid crashes in case logs can't be parsed fully. Works around https://bugs.freedesktop.org/show_bug.cgi?id=40675
* log-store-xml: fix reason leaksGuillaume Desmottes2013-09-301-0/+2
|
* include telepathy-glib-dbus.hGuillaume Desmottes2013-09-271-0/+1
| | | | Not needed for now but will be for 1.0
* use account's normalized name instead of its account idGuillaume Desmottes2013-09-271-29/+13
| | | | | | It doesn't make sense to use the account opaque ID as 'self id'. Fix fdo#69814.
* ignore deprecation warning when calling tp_account_parse_object_path()Guillaume Desmottes2013-09-251-0/+3
| | | | | | It's not that clear how to fix this for now. https://bugs.freedesktop.org/show_bug.cgi?id=69797
* stop using tp_account_manager_get_valid_accounts()Guillaume Desmottes2013-09-251-2/+2
| | | | | | | | The code example in log-walker.c was wrong as get_valid_accounts() is (transfer container). dup_valid_accounts() is (transfer full) so it's correct now. https://bugs.freedesktop.org/show_bug.cgi?id=69797
* log_store_xml_get_events_for_file: fix self_id leakGuillaume Desmottes2013-05-011-0/+1
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=54814
* Split legacy Empathy log reader into its own classWill Thompson2013-01-161-26/+1
| | | | | | | | | | | | My commit eaefb26 introduced a regression: by assuming that any class that implements add_event is writable, logs were being written to the legacy Empathy location. By splitting the legacy location handling into a subclass, we can override add_event to un-implement it and make the subclass read-only, as well as removing special cases from the XML store itself. Thanks to Debarshi Ray for catching this!
* log-store-xml: use _tpl_log_store_get_name()Will Thompson2013-01-161-3/+2
| | | | | By consistently using the wrapper function rather than calling our implementation directly, subclassing won't break.
* log-store-xml: simplify choosing basedirWill Thompson2013-01-161-3/+2
| | | | | | | log_store_xml_get_name() makes the same Empathy vs. TpLogger decision as the test_mode path was making. Since the log store's name is used to find the real directory, it also seems better to use the same code path in the test suite.
* log-walker: Run the filter synchronously in the walkerDebarshi Ray2013-01-091-5/+2
| | | | | | | | | | This ensures that the TplLogEventFilter is always run from the same thread which invoked the walker. This is implemented by keeping track of skipped events in the history instead of silently ignoring them within the LogIters. This has the nice side effect that we do not need to run the filter while rewinding. Fixes: https://bugs.freedesktop.org/54270
* TplLogStore: remove :name property entirely.Will Thompson2012-09-251-6/+0
| | | | | Given that _tpl_log_store_get_name exists, there's really no reason to have a property as well.
* Make TplLogStore:name immutable.Will Thompson2012-09-251-23/+6
| | | | | | For all log stores except the Xml one, this is always set to the same thing. For the Xml one, the name of the store depends entirely on the value of empathy-legacy.
* TplLogStore: make :readable property immutableWill Thompson2012-09-251-16/+1
| | | | | Again, it's meaningless to have this be a writeable construct-only property—a store is either readable or it's not.
* TplLogStore: remove writable property.Will Thompson2012-09-251-20/+0
| | | | | | This property was defined by the interface to be readwrite, but this doesn't make any sense: if the object implements the add_event method, then it is writable, and if not, it doesn't.
* log-store-xml: Filter out duplicate dates in get_datesNicolas Dufresne2012-08-281-0/+13
| | | | Fixes: https://bugs.freedesktop.org/53345
* log-store-xml: Implement create_iterDebarshi Ray2012-08-281-0/+19
| | | | Fixes: https://bugs.freedesktop.org/41772
* Disable single include of telepathy-glib headersXavier Claessens2012-07-031-5/+2
|
* Port TplCallChannel to Call1 APINicolas Dufresne2012-03-281-7/+2
| | | | | This include a API break in the unstable Call code. Code using the unstable call log feature will need porting.
* Replace g_hash_table_destroy with g_hash_table_unrefCosimo Alfarano2011-11-181-1/+1
|
* Avoid dereferencing NULL pointersVincent Penquerc'h2011-07-151-25/+39
| | | | | Use empty strings where a given string cannot be known due to a NULL sender or actor.
* Use gint64 for timestamps (not guint64)David Laban2011-05-261-5/+5
|
* Add edit-timestamp, and remove original-timestampDavid Laban2011-05-261-18/+18
| | | | | | | | | log-store-xml: * store/save edit-timestamp rather than original-timestamp * Also don't let the edit timestamp override the timestamp for where messages are saved (as was the case for original-message). text-event: * s/original/edit/
* Move event_queue_insert_sorted_after() to utilNicolas Dufresne2011-05-261-36/+4
|
* Style fix two empty line between functionNicolas Dufresne2011-05-261-0/+8
|
* Fixed initial call event_queue_insert_sorted_after()Nicolas Dufresne2011-05-261-12/+24
| | | | The current code would always insert after the first element.
* log-store-xml.c: fix uninitialised variable warningDavid Laban2011-05-251-1/+1
|
* add_text_event/parse_text_node: use original-timestamp for editsDavid Laban2011-05-241-4/+31
| | | | | | | * Store/parse original-timestamp prop in xml. * Put the event in the file pointed to by original-timestamp * If it doesn't exist, fall back to the message's timestamp.
* add_{text,call}_event: s/timestamp/time_str/David Laban2011-05-241-10/+10
| | | | | I expect "timestamp" to be a uint64 or a GDateTime, so I'm renaming this variable to avoid confusing name collisions later.
* log_store_xml_format_timestamp()David Laban2011-05-241-2/+8
| | | | | * factor out log_store_xml_format_timestamp, since we need it for original-timestamp as well
* fixup! fixup! Store, save and test message-token and supersedes-tokenDavid Laban2011-05-191-2/+2
| | | | oops: inverted boolean expression
* fixup! fixup! log_store_xml_get_events_for_file: replace edited messages.David Laban2011-05-191-4/+4
| | | | event_queue_replace_and_supersede: correct type and s/l/index/
* fixup! Store events in the correct file according to their timestampDavid Laban2011-05-191-1/+1
| | | | | | > > + date = g_date_time_new_from_unix_local (timestamp); > > Timestamp in TplEvent are always UTC.
* fixup! log_store_xml_get_events_for_file: replace edited messages.David Laban2011-05-191-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update to private _tpl_text_event_add_supersedes Also addresses: > I think you don't have to call g_hash_table_insert() here ? And same in next > for loop. Actually, this is for the chained supersedes use-case, but yeah: it's wrong. Fixed it when I implemented event_queue_replace_and_supersede (), and fixed the comment on superseded_links > Use g_list_previous(). > Is that suppose to be funny ? (apparently it wasn't funny; fixed) > Your leaking a reference on the dumm_event. Maybe you want to rework you > _add_supersedes() method into something like link_supersedes() that would take > ownership ? Created method event_queue_replace_and_supersede with similar feel to event_queue_insert_sorted_after. This is something that I wanted to do, but couldn't see a clean way to do. Fixing the semantics of superseded_links made this easier. > You don't check anymore if parsing event worked. A corrupted XML file will > cause your code to crash. > *_parse_*() will currently only return NULL if g_object_new() does, but you're right: if someone changes this behaviour later, I should be resilient to it. Fixed.
* fixup! Store, save and test message-token and supersedes-tokenDavid Laban2011-05-191-8/+8
| | | | | | | | | | Addresses: > > + if (token_str != NULL) > You might want to use TPL_STR_EMPTY() instead. > We should be a little more robust, and ignore supersedes if there is no > token. I assume that by this, you mean only record it if message-token also exists?
* Store events in the correct file according to their timestampDavid Laban2011-05-181-16/+22
|
* log_store_xml_get_events_for_file: replace edited messages.David Laban2011-05-171-6/+78
| | | | | | | | | | | | | | | | This should support "b supersedes a ; c supersedes a" as well as "b supersedes a ; c supersedes b" Also, the list of returned events should only contain the most recent version (for backwards compat with dumb log viewers, as suggested by sjoerd). * make a event_queue_add_text_event responsible for adding the event to the returned gqueue (replacing the event it supersedes as needed). * use a GHashTable of {token: place to put message} for already edited messages, and check that first, then walk through the queue (starting at the most recent event) trying to find it. * add a dummy event if none can be found.
* Extract an event_queue_insert_sorted_after utility functionDavid Laban2011-05-171-16/+23
| | | | | | Like g_queue_insert_sorted, but with the shortcut of not having to search from the beginning of the queue all the time, and the simplification of knowing that we are always dealing with TplEvents.
* Store, save and test message-token and supersedes-tokenDavid Laban2011-05-171-10/+36
|
* log-store-xml: fix -Wuninitialized warningsJonny Lamb2011-05-111-4/+4
| | | | Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
* Port search_new() to multi file designNicolas Dufresne2011-05-051-12/+18
|
* Port _get_events_for_date() to multi file designNicolas Dufresne2011-05-051-24/+57
|
* Port _get_dates() to multi file designNicolas Dufresne2011-05-041-40/+17
| | | | | This should improve significantly the performance as we not longer have to look inside the file.
* Extract filename regex creation for reuseNicolas Dufresne2011-05-041-20/+36
|
* Store call and text events in seperate filesNicolas Dufresne2011-05-041-10/+26
|
* Set file match pattern into macro for reuseNicolas Dufresne2011-05-041-2/+8
|
* Reimplement _exists for multi-file event storageNicolas Dufresne2011-05-031-9/+82
|
* Cleanup includes fixing usage of " and <Nicolas Dufresne2011-05-031-11/+12
|