summaryrefslogtreecommitdiff
path: root/libpurple/accounts.c
Commit message (Collapse)AuthorAgeFilesLines
* Use g_clear_handle_id everywhereElliott Sales de Andrade2023-03-211-4/+2
| | | | | | | Testing Done: Compiled and ran tests in valgrind. Reviewed at https://reviews.imfreedom.org/r/2374/
* Fix leaks when loading accountsElliott Sales de Andrade2023-02-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two leaks in account parser: ``` 512 bytes in 4 blocks are definitely lost in loss record 30,342 of 33,863 at 0x484378A: malloc (vg_replace_malloc.c:392) by 0x484870B: realloc (vg_replace_malloc.c:1451) by 0x498071F: g_realloc (gmem.c:201) by 0x499A343: g_string_maybe_expand (gstring.c:92) by 0x499A3BF: g_string_sized_new (gstring.c:116) by 0x499A7AA: UnknownInlinedFun (gstring.c:176) by 0x499A7AA: g_string_new_len (gstring.c:167) by 0x4D577C6: purple_xmlnode_get_data (xmlnode.c:460) by 0x4CCD5D8: parse_account (accounts.c:338) by 0x4CCD98B: load_accounts (accounts.c:449) by 0x4CCE234: purple_accounts_init (accounts.c:667) by 0x4CE3AC2: purple_core_init (core.c:174) by 0x48A380A: pidgin_application_startup (pidginapplication.c:820) 512 bytes in 4 blocks are definitely lost in loss record 30,343 of 33,863 at 0x484378A: malloc (vg_replace_malloc.c:392) by 0x484870B: realloc (vg_replace_malloc.c:1451) by 0x498071F: g_realloc (gmem.c:201) by 0x499A343: g_string_maybe_expand (gstring.c:92) by 0x499A3BF: g_string_sized_new (gstring.c:116) by 0x499A7AA: UnknownInlinedFun (gstring.c:176) by 0x499A7AA: g_string_new_len (gstring.c:167) by 0x4D577C6: purple_xmlnode_get_data (xmlnode.c:460) by 0x4CCD610: parse_account (accounts.c:343) by 0x4CCD98B: load_accounts (accounts.c:449) by 0x4CCE234: purple_accounts_init (accounts.c:667) by 0x4CE3AC2: purple_core_init (core.c:174) by 0x48A380A: pidgin_application_startup (pidginapplication.c:820) ``` and one in the demo protocol: ``` 16,008 (56 direct, 15,952 indirect) bytes in 1 blocks are definitely lost in loss record 33,622 of 33,863 at 0x4DDF1EF: g_type_create_instance (gtype.c:1909) by 0x4DC4C1F: g_object_new_internal (gobject.c:2228) by 0x4DC6972: g_object_new_valist (gobject.c:2567) by 0x4DC6FCC: g_object_new (gobject.c:2040) by 0x57CF444: g_resource_open_stream (gresource.c:764) by 0x1CAA54A2: purple_demo_contacts_load (purpledemocontacts.c:233) by 0x1CAA4CD0: purple_demo_connection_connect (purpledemoconnection.c:43) by 0x4CE1540: purple_connection_connect (connection.c:955) by 0x4CC7F5E: purple_account_real_connect (account.c:179) by 0x4CC85B0: no_password_cb (account.c:355) by 0x49784C7: g_timeout_dispatch (gmain.c:5007) by 0x4977CBE: UnknownInlinedFun (gmain.c:3444) by 0x4977CBE: g_main_context_dispatch (gmain.c:4162) ``` Testing Done: Ran in valgrind and confirmed above leaks were gone. Reviewed at https://reviews.imfreedom.org/r/2299/
* Export Account::errorGary Kramlich2023-02-081-2/+2
| | | | | | | | | | | I can't think of a good reason why we shouldn't expose the error property on Accounts. But I would like to be able to set the error from the UI when there is an error in the settings for example. Testing Done: Built the docs, ran the tests, used the prune connection action in the demo protocol plugin and verified everything was still working. Reviewed at https://reviews.imfreedom.org/r/2216/
* Replace the account-actions-changed signal with an actions-changed signal on ↵Gary Kramlich2023-01-061-4/+0
| | | | | | | | | | | | | | | PurpleProtocolActions We also propagate the PurpleProtocolActions::actions-changed signal from the PurpleProtocolManager::account-actions-changed signal if the protocol implements the PurpleProtocolActions interface. Testing Done: Build the docs and ran the unit tests. I also put a temporary action in the demo protocol plugin and called `purple_protocol_actions_changed` after the demo protocol connected. I will have another pull request that makes this a permenent action, but I want to convert the demo protocol plugin to subclass PurpleConnection before doing so as that will be accounting of everything *much* easier. Reviewed at https://reviews.imfreedom.org/r/2168/
* Update libpurple for the deprecations in the account apiGary Kramlich2022-12-141-10/+16
| | | | | | | Testing Done: Compiled and ran the unit tests. Reviewed at https://reviews.imfreedom.org/r/2133/
* Bump C standard to C99 for libpurple files and fix warningsElliott Sales de Andrade2022-12-111-8/+7
| | | | | | | Testing Done: Touched all source files and compiled; saw no new warnings. Reviewed at https://reviews.imfreedom.org/r/2122/
* Remove the privacy apiGary Kramlich2022-12-051-41/+0
| | | | | | | | | | | This API has been needing a rewrite for as long as I've been working on Gaim / Pidgin and nothing has come of it. Therefore, I'm am removing it for a much more simplified approach in the future. Testing Done: Sent some messages with the demo protocol plugin. Reviewed at https://reviews.imfreedom.org/r/2065/
* Fix cleanup of acconut password on deletionElliott Sales de Andrade2022-11-061-2/+2
| | | | | | | | | The callback expects the account as its callback data, but none was passed. Testing Done: Deleted an account and saw no failing `G_IS_OBJECT` critical. Reviewed at https://reviews.imfreedom.org/r/2041/
* Add PurpleAccount::error property and remove "account-error-changed" and ↵Gary Kramlich2022-11-051-11/+0
| | | | | | | | | | | | | | "account-status-changing" signals. Also sorted the account signal changes in ChangeLog.API. The account-error-changed signal is easily replaced by the notify signal for the new property, and account-status_changing wasn't used by anything. Testing Done: Used the account actions of the demo protocol plugin to disconnect the account without issue. Reviewed at https://reviews.imfreedom.org/r/2036/
* Port PurpleBlist to use PurpleAccountManager::added and ::removed signals ↵Gary Kramlich2022-11-051-8/+0
| | | | | | | | | and remove the old purple signals Testing Done: Connected a Bonjour and Demo account without issue. Reviewed at https://reviews.imfreedom.org/r/2034/
* Propagate the PurpleAccount::notify signal via ↵Gary Kramlich2022-11-041-8/+0
| | | | | | | | | | | | | | PurpleAccountManager::account-changed This new signal supports details and works just like notify does on the account instances, but it will be emitted for any account that the manager instance knows about which means we can remove the old purple signals. Testing Done: Enabled and disabled accounts in Pidgin via the menus to make sure things were working right, and verified via the console that the accounts were being enabled and disabled. Ran Finch, but I ran into the infinite loop bug in the buddy list clean when disabling an account which is a known issue. Reviewed at https://reviews.imfreedom.org/r/2032/
* Remove C99-obsoleted constructsElliott Sales de Andrade2022-10-261-1/+1
| | | | | | | | | See [this development thread for a future Fedora change](https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/CJXKTLXJUPZ4F2C2VQOTNMEA5JAUPMBD/) or [the proposed change page](https://fedoraproject.org/wiki/Changes/PortingToModernC). These may be made stronger errors in GCC 14. Testing Done: Configured with `-Dc_args='-Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition'` and compiled. Reviewed at https://reviews.imfreedom.org/r/1974/
* Work around an issue where accounts were attempting to connect when they ↵Gary Kramlich2022-10-251-1/+2
| | | | | | | | | | | were deserialized This is a short term fix until we rewrite the serialization method. Testing Done: Set a break point on `pidgin_account_connect` and verified it didn't get call from `purple_accounts_init`. Reviewed at https://reviews.imfreedom.org/r/1966/
* Remove unused account signalsElliott Sales de Andrade2022-10-091-45/+0
| | | | | | | Testing Done: Compiled Reviewed at https://reviews.imfreedom.org/r/1914/
* Add a require-password property to PurpleAccountGary Kramlich2022-10-011-0/+7
| | | | | | | | | | | | This will be able to be to set the a user so that an account so that an account with an optional password will require a password for login. Testing Done: Compiled Bugs closed: PIDGIN-17688 Reviewed at https://reviews.imfreedom.org/r/1876/
* Rename PurpleContact to PurpleMetaContact.Gary Kramlich2022-09-221-1/+1
| | | | | | | | | | | This is to help facilitate the new blist api that's still being designed but we wanted to use this name for an object. A later review request will rename contact.[ch] which was avoided for now as it would make the diff harder to read. Testing Done: Ran and verified that contacts showed up. Reviewed at https://reviews.imfreedom.org/r/1770/
* Minor cleanup to account cleanup and connection error handlingElliott Sales de Andrade2022-09-201-12/+6
| | | | | | | Testing Done: Compile only. Reviewed at https://reviews.imfreedom.org/r/1812/
* Stop including internal.h everywhere when we really don't need it.Gary Kramlich2022-09-121-1/+0
| | | | | | | Testing Done: Compiled, but didn't test on windows. As such I left all the networking stuff untouched as that's where windows will really need it and that can be done in another rr. Reviewed at https://reviews.imfreedom.org/r/1764/
* Remove the account error scrollbook from the blist as notifications have ↵Gary Kramlich2022-07-061-1/+0
| | | | | | | | | | | | | | replaced it. Also clear account errors when we attempt a new connection which made clearing the errors after the account has connected redundant. Testing Done: Caused the same account to get disconnected between pidgin 2 and 3 to verify notifications were working as expected. Bugs closed: PIDGIN-17640 Reviewed at https://reviews.imfreedom.org/r/1521/
* Remove the account ui settings as it was only used for whether or not an ↵Gary Kramlich2022-05-201-22/+7
| | | | | | | | | account was enabled Testing Done: Ran and verified the demo account connected without issue. Reviewed at https://reviews.imfreedom.org/r/1460/
* Remove the ui parameter from purple_account_[gs]et_enabledGary Kramlich2022-05-201-2/+9
| | | | | | | Testing Done: Enabled and disabled the demo account a bunch of times, including restarts, and the like. Reviewed at https://reviews.imfreedom.org/r/1458/
* Move PurpleProxyInfo from a boxed type to a GObjectGary Kramlich2022-04-011-12/+14
| | | | | | | | | | | | | As well as: * Fix the namespace of the PurpleProxyType members. * Remove the GNOME proxy detection code. * Remove the Windows proxy detection code. Testing Done: Created an account and messed around with the proxy settings and verified they were saved and restored. Reviewed at https://reviews.imfreedom.org/r/1368/
* Replace PURPLE_CALLBACK by G_CALLBACKElliott Sales de Andrade2022-03-251-3/+3
| | | | | | | | | Another straight search-and-replace for 'easy' review. Testing Done: Compile only. Reviewed at https://reviews.imfreedom.org/r/1371/
* Remove some deprecated accounts apiGary Kramlich2022-01-091-46/+0
| | | | | | | Testing Done: Compiled and ran Reviewed at https://reviews.imfreedom.org/r/1222/
* Stop saving status to accounts.xmlGary Kramlich2021-12-161-99/+0
| | | | | | | | | | | | | | | | I suspected this wasn't necessary for awhile, but finally tried it and I can't seem to find anything that broke when I removed it. Fixes PIDGIN-17566 Testing Done: Connected a Bonjour account, set the status to `away` with a message, stopped Pidgin, verified that `status.xml` contained what looked correct, then restarted Pidgin and verified that the status was set to the previous status before exiting. Added an XMPP account, set the status to `do not disturb` with a message, closed pidgin, verified `status.xml` looked mostly correct, then restarted Pidgin and verified that the statuses were set to the previous statuses for both accounts. Bugs closed: PIDGIN-17566 Reviewed at https://reviews.imfreedom.org/r/1190/
* Add an id property to PurpleAccount and make sure it persistsGary Kramlich2021-12-121-1/+17
| | | | | | | | | Testing Done: * Verified that existing accounts were given ids. * Verified that ids persisted in accounts.xml. * Verified that new accounts got ids and were persisted in accounts.xml. Reviewed at https://reviews.imfreedom.org/r/1161/
* Create the PurpleAccountManager APIGary Kramlich2021-12-031-155/+102
| | | | | | | | | | | | | | This replaces most of the purple_accounts_ API, but not quite everything. The functions that have been replaced have been marked as deprecated and libpurple has been updated to use the new API. Testing Done: * Connected an XMPP account * Verified chat and ims worked * Verified that the saved statuses window didn't crash * Ran the new unit tests. Reviewed at https://reviews.imfreedom.org/r/1137/
* Don't error out when trying to remove a password that isn't stored.Gary Kramlich2021-08-231-1/+1
| | | | | | | | | | | | | | | | Both wincred and secretservice return an error if you try to delete a password that they don't know about. We don't care about this scenario and just want to make sure the password is gone, so we changed the expected behavior to be as such and updated wincred and secret service for the change. I also fixed the NULL deference which is how I stumbled across the issue in the first place. Testing Done: * Verfied the issue was fixed in secretservice. * Verfied the issue didn't exist in kwallet. Reviewed at https://reviews.imfreedom.org/r/901/
* Fix the includes for the purpleenums renameGary Kramlich2021-08-031-1/+1
| | | | | | | Testing Done: Full build after a `meson --wipe` Reviewed at https://reviews.imfreedom.org/r/863/
* migrate libpurple to the ConversationManager APIGary Kramlich2021-07-221-6/+13
| | | | | | | Testing Done: Compile only Reviewed at https://reviews.imfreedom.org/r/791/
* Remove the deprecated keyring API.Gary Kramlich2021-04-211-29/+0
| | | | | | | | | | | | I've disable the building of the internal keyring for now but left it so it can be referenced when it is ported to the CredentialProvider API. Testing Done: Ran Pidgin and verified the preferences window worked. Bugs closed: PIDGIN-17486 Reviewed at https://reviews.imfreedom.org/r/624/
* Port the KWallet Keyring to the new CredentialProvider API.Gary Kramlich2021-03-221-3/+7
| | | | | | | | | | | | | | | | Testing Done: * connected account with wallet locked, verified that we weren't prompted for a password until the wallet was unlocked. * connected account, didn't save password, made sure it connected and wasn't stored in kwalletmanager5 * connected account, saved password, made sure it connected and verified the password was stored in kwalletmanager5 * reconnected account, made sure the account connected without prompting * reopened pidgin, made sure the account connected without prompting. * disconnected pidgin from kwalletmanager5, re-connected account, verified it reconnected via debug and kwalletmanager5 * force closed the wallet in kwalletmanager5, re-connected account, unlocked wallet, verified no password prompts and that the account connected. * removed the account and verified the password was removed from kwalletmanager5 Bugs closed: PIDGIN-17488 Reviewed at https://reviews.imfreedom.org/r/575/
* Remove the buddy pounces apiGary Kramlich2021-01-021-4/+0
| | | | | | | | | | | This feature has more or less been stalkerware since its inception and the only useful feature that came of it was offline message emulation which isn't necessary for most networks nowadays. Testing Done: Compiled and ran locally. Reviewed at https://reviews.imfreedom.org/r/322/
* Use PurpleCredentialManager instead of the old keyring api.Gary Kramlich2021-01-021-4/+18
| | | | | | | Testing Done: Connected with bonjour (no password), irc (optional password, non set), and xmpp (password required, not saved, entered manually, not saved) and verified that all of them connected properly. Reviewed at https://reviews.imfreedom.org/r/289/
* remove some old icq server migration codeGary Kramlich2020-10-291-24/+0
| | | | | | | | | Remove some migration code for an icq server since we don't ship and icq plugin anymore Testing Done: Compiled, verified no new warnings. Reviewed at https://reviews.imfreedom.org/r/181/
* Fix some easy compiler warningsGary Kramlich2020-08-161-1/+1
| | | | | | | | | | | | | | | make ggp_date_from_iso8601 use a GDateTime instead of GTimeVal and have it return a gint64 Wrap a signal callback in a G_CALLBACK like it should be Remove some unused variables Only include sysctl.h on platforms where we need it. It's deprecated under gcc now. Testing Done: Compiled on freebsd 12.0, netbsd 9.0, openbsd 6.7, mac, and linux without issues. Reviewed at https://reviews.imfreedom.org/r/69/
* fix some issues that were identified while working on a flatpak buildGary Kramlich2020-08-101-0/+12
| | | | | | | | | | | | | Fix some issues that were discovered while working on a flatpak Testing Done: built a flatpak (that'll be a separate review request) and ran into some issues.. First was bonjour_ft wouldn't build, not sure how/why that isn't happening elsewhere.. but whatever.. Next was the network monitor stuff I moved us to way back in december of 2015 works, but under flatpak the network is initially unavailable but then becomes available. A bunch of our code was __only__ checking network availability at startup and then not listening for changes later. This code is really gross right now, but a lot of it is going to need some major refactoring where as this effort was just to get this going right now. Reviewed at https://reviews.imfreedom.org/r/66/
* Make sure we're not including the gettext macros in header files and deal ↵Gary Kramlich2020-05-211-0/+3
| | | | with the repercussions of that.
* Make sure that internal.h can only be included by libpurple and split out ↵Gary Kramlich2020-05-011-2/+3
| | | | some pieces to purpleprivate.h
* Rename purple_account_set_status_list and ↵qarkai2020-04-081-1/+1
| | | | purple_status_set_active_with_attrs_list
* Replace lists of PurpleAttr with GHashTableqarkai2019-11-261-13/+9
|
* Add PurpleAttr to use in lists instead of consecutive key and value elementsqarkai2019-11-161-7/+8
|
* Rename some buddy list accessor functions.Elliott Sales de Andrade2019-07-021-4/+2
| | | | | | | * `purple_blist_get_buddy_list` moved to `purple_blist_get_default` * `purple_blist_get_root` copied to `purple_blist_get_default_root` * `purple_blist_get_root` takes a list argument now
* Move more libpurple files to ~/.config.Elliott Sales de Andrade2019-02-151-2/+2
|
* libpurple: Remove pointer registration for DBus APIMike Ruprecht2018-10-021-3/+0
|
* Remove purple_timeout_* function usageMike Ruprecht2017-06-151-2/+2
| | | | | | | | | | | | Now that the purple_timeout_* functions internally just use their GLib equivalents, we can just replace them with the GLib equivalents. This patch replaces purple_timeout_* functions with g_timeout_add{_seconds}() and g_source_remove() functions. There are probably places in this which could use g_timeout_add_full() or g_idle_add{_full}(), but this was a straight replacement to keep the functionality identical for now. Further patches can update to use these instead if desired.
* Add "account-status-changing" signal from instantbirdFlorian Qu?ze2016-05-151-0/+5
| | | | | | | It's like "account-status-changed", but emitted before the status change instead of after. Instantbird ticket: https://bugzilla.mozilla.org/show_bug.cgi?id=954403
* Remove Yahoo! JapanMichael McConville2015-06-211-35/+0
|
* Merged default branchAnkit Vani2014-02-231-1/+1
|\
| * Merged default branchAnkit Vani2014-02-151-1/+1
| |\