Merge lp:~cando/zeitgeist-datasources/fix_xchat into lp:zeitgeist-datasources/0.8
Proposed by
Stefano Candori
Status: | Merged |
---|---|
Merged at revision: | 110 |
Proposed branch: | lp:~cando/zeitgeist-datasources/fix_xchat |
Merge into: | lp:zeitgeist-datasources/0.8 |
Diff against target: |
203 lines (+94/-10) 2 files modified
xchat/README (+13/-0) xchat/zeitgeist-dataprovider.c (+81/-10) |
To merge this branch: | bzr merge lp:~cando/zeitgeist-datasources/fix_xchat |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mikkel Kamstrup Erlandsen (community) | Approve | ||
Review via email: mp+46304@code.launchpad.net |
Description of the change
In this branch i've improved the XChat dataprovider.
With these mods when the user quits from XChat, the dps sends LEAVE_EVENTS to Zeitgeist, that's very important because i guess that everybody don't use the /part command(that is handled correctly by the dps)for quitting from the channels...
To post a comment you must log in.
There's something askew with how you use the channel_list GSList.
1) You leak the string passed in to the g_slist_append() method. g_strdup() copies the string you pass to it and you need to free it again somehow. When that entry is removed from the list you need to g_free() the string somehow.
2) You g_slist_remove() call will not match anything in your channel_list. It compares pointer values, not strings, for the lookup. Also - you call g_strdup(channel) which allocates new memory, which doesn't get freed. You need a matching g_free() on the return value of that call somewhere.
3) The 'text' variable you build with g_strconcat() also needs a g_free() before you return. Otherwise you'll leak it.
4) in on_quit() don't g_strdup() the data arg. Just cast it to a 'const gchar*'. In this case you also shouldn't g_free() it
5) in on_quit() you leak the url and text strings. They need a g_free() as you do with 'channel' (unless you do as advised in 4)).