aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber_util.c
Commit message (Collapse)AuthorAgeLines
* jabber: Fix incoming google talk typing notificationsdequis2015-10-21-1/+5
| | | | | | | | | | | | | | | | | | | | | | | jabber_buddy_by_jid() does the following: head = g_hash_table_lookup(jd->buddies, jid); bud = (head && head->next) ? head->next : head; 'head' has the one without resource, 'bud' has the first resource. So if a resource is available, it uses it and ignores the head. When asked for a bare JID (with no resource) and GET_BUDDY_EXACT, it shouldn't do this, but it should return the head. In other words, the problem was a message in this format: <message from="username@gmail.com" ...> Instead of <message from="username@gmail.com/resource" ...> This only deals with incoming typing notifications. See next commit.
* jabber: Refactor conference message handlingdequis2015-05-28-0/+16
| | | | | | | | - Improve handling of "unknown 'from'" - Try a bit harder to detect the source of the message, and fall back to messages sent from a fake temporary user. - Fix receiving topic when it was set by someone who left the room. - Add jabber_get_bare_jid() utility function
* Fix a bunch of memory leaksdequis2015-03-22-0/+1
| | | | | | | | | | | | | | | | | | | - irc_im.c: - bee_irc_user_msg: strdup leaks when otr swallows messages - bee_irc_user_action_response: GString leak in all ctcp replies - otr.c: - call g_slist_free() on the list of the otr_policy setting - otr_filter_msg_in: call otrl_tlv_free() if "tlvs" are returned - otr_filter_msg_out: don't g_strdup() if the message should be ignored - log_otr_message: g_strdup_vprintf() leaks always - nogaim.c: - imcb_ask_auth/imcb_ask_add: leaks in g_strdup_printf() - imcb_ask_add leaks imcb_ask_cb_data if the user already exists - add imcb_ask_cb_free() to correctly free its data - msn_util.c: add msn_buddy_ask_free(), ditto - storage_xml.c: pass_cr/password if base64_decode or arc_decode fail - ssl_gnutls.c: conn->hostname leak in error conditions, like invalid certs - jabber_util.c: jabber_buddy_by_ext_jid() leaks jid if it's not an ext jid
* Reindent everything to K&R style with tabsIndent2015-02-20-410/+398
| | | | | | | Used uncrustify, with the configuration file in ./doc/uncrustify.cfg Commit author set to "Indent <please@skip.me>" so that it's easier to skip while doing git blame.
* Use glib's GChecksum for md5/sha1dequis2015-01-31-1/+1
| | | | | | | | | | | | | | | | | | | This changes behavior slightly: - md5_init()/sha1_init() allocate a GChecksum - md5_finish()/sha1_finish() close and free() it - md5_digest_keep() was added (no sha1 equivalent needed) And yes, glib has this concept of "closing" the GChecksum, which means it can't be used anymore after g_checksum_get_digest(). jabber_cache_add() actually seems to need to do that to generate some random-ish values, so i kept that working by adding a md5_digest_keep() function that copies the GChecksum before it gets closed GChecksum was introduced in glib 2.16, so the configure script version was bumped. We were already depending on glib 2.16 accidentally (some post-3.2.2 code uses GHashTableIter)
* Add handle_is_self() prpl function to fix JID mismatch confusion bugsdequis2015-01-25-0/+4
| | | | | | | | | When bee_chat needs to check for self messages, it can call this function to let the protocol implementation do the comparison. In the case of jabber, sometimes the server reports a different username after login, this one is stored in jd->internal_jid, and the one that is used for login isn't changed
* Add jabber_normalize_ext() to fix case sensitivity issues with ext jidsdequis2015-01-16-16/+30
| | | | | | Also refactor jabber_normalize() to be UTF8 aware. See trac ticket 1106 for more details
* Replace isdigit/isalpha/.../tolower/toupper with glib variantsdequis2015-01-16-2/+2
| | | | | | | | | | | This fixes warnings about passing signed chars to them (apparently they are implemented as macros that do array lookups without checks in some platforms, yay) Specifically: functions=isalnum|isalpha|isdigit|isspace|isxdigit|tolower|toupper sed -ir "s/$functions/g_ascii_&/g" **/*.c
* Add support for XEP-0203: Delayed delivery (message timestamps)dequis2014-10-10-10/+20
| | | | | | | | Very similar to XEP-0091 which is already supported, but was marked as obsolete, replaced by XEP-0203. The main differences are the tag name and the timestamp format. Due to the similarities, both XEPs are still supported.
* One small comment correction while "merging" stuff.Wilmer van der Gaast2014-09-21-1/+1
|
* Added jabber_compare_jid to fix JID comparison case sensitivityGRMrGecko2014-07-24-0/+22
|
* Fix for rejecting buddy requests on jabber (Ticket #887)kevin8t82014-02-27-1/+1
| | | | Patch from ticket #1112
* jabber_buddy_* stuff *is* a complete memory management hell already. :-(Wilmer van der Gaast2011-12-26-0/+2
| | | | | Hopefully this change fixes a small memory leak.
* Detect JID changes at login time and warn the user about them.Wilmer van der Gaast2011-12-20-0/+18
|
* Change 704 introduced one tiny bug where a Jabber resource doesn't getWilmer van der Gaast2010-10-23-1/+2
| | | | | | deleted properly when it logs out if it's the last one online for that user. Fixing that now.
* Another memory leak fix.Wilmer van der Gaast2010-10-21-1/+2
|
* Merging memory leak fixes from devel, time to find the ui-fix-specificWilmer van der Gaast2010-06-08-0/+26
|\ | | | | | | | | leaks.
| * Fixing some memory leakage.Wilmer van der Gaast2010-06-08-0/+26
| |
* | Merging loads of stuff from mainline.Wilmer van der Gaast2010-04-14-26/+3
|\|
| * Added a mktime_utc() to misc.c using code that used to be in jabber_util.c.Wilmer van der Gaast2010-04-08-26/+3
| | | | | | | | | | I want to use this in the Twitter module.
* | Including DCC stuff again, with a wonderful extra layer of abstraction.Wilmer van der Gaast2010-04-11-4/+4
| | | | | | | | | | | | | | Some hooks are missing so sending files doesn't work yet. Receiving also still seems to have some issues. On the plus side, at least the MSN/Jabber modules work again.
* | Merging in file transfer support. Most important points from my reviewWilmer van der Gaast2010-03-21-1/+5
|\ \ | |/ |/| | | | | are fixed now, time to let it settle in and get people to try it.
| * Merging mainline.Wilmer van der Gaast2010-03-17-2/+7
| |\
| * \ Merging head.Wilmer van der Gaast2009-12-07-2/+2
| |\ \
| * \ \ merged in upstream r410.ulim2008-08-04-24/+40
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Only conflict was the correction of jabber normalization which I had already done.
| * \ \ \ merged in upstream r379 (somewhere after 1.2-3).ulim2008-04-14-2/+6
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Just one trivial conflict in the jabber Makefile, went smoothly.
| * \ \ \ \ Merged with upstream r328ulim2008-02-15-18/+26
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wilmer van der Gaast 2008-02-11 Got rid of some noise at startup: complaining when the default configuration Wilmer van der Gaast 2008-02-10 Added support for password-protected Jabber chatrooms. Wilmer van der Gaast 2008-02-10 Making AI_ADDRCONFIG optional, it doesn't exist on at least NetBSD and Wilmer van der Gaast 2008-02-09 Restored "add -tmp". A bit hackish, but it will do for now. Wilmer van der Gaast 2008-02-07 Fixed getnameinfo() calls, this fixes Solaris stability issues. Thanks to Wilmer van der Gaast 2008-02-04 Added bogus G_GNUC_MALLOC to restore GLib 2.4 compatibility (hopefully). Wilmer van der Gaast 2008-02-03 Messages from the user are also included in backlogs when joining a Jabber Wilmer van der Gaast 2008-02-03 Disabling "Unknown command" warnings since they're very noisy and pretty Wilmer van der Gaast 2008-02-03 Implemented XEP-0115. This adds some info to the <presence/> tags so Wilmer van der Gaast 2008-02-03 Saner garbage collection of cached packets in the Jabber module. Now Wilmer van der Gaast 2008-02-02 Added help_free() and cleaned up some very stale help-related stuff I Wilmer van der Gaast 2008-01-30 Fixed handling of OSCAR multi-part messages... They're not arrays, they're Wilmer van der Gaast 2008-01-24 Keeping track of valid Jabber connections so _connected() events will be Wilmer van der Gaast 2008-01-24 Fixed two valgrind warnings (partially uninitialized "struct tm" vars.) Wilmer van der Gaast 2008-01-20 The Jabber module now uses imcb_chat_log() instead of imcb_log() where Wilmer van der Gaast 2008-01-20 Added imcb_chat_log() for chatroom system messages, so they can be Wilmer van der Gaast 2008-01-20 GET_BUDDY_FIRST wasn't actually implemented, even though it was in use Wilmer van der Gaast 2008-01-19 Using test -f instead of test -e. This breaks if the include files are Wilmer van der Gaast 2008-01-19 Added byte swapping code to the new MD5 checksumming code to make it work Wilmer van der Gaast 2008-01-18 Moving imcb_chat_new() to a saner location (no code changes) and fixing Wilmer van der Gaast 2008-01-17 Apparently ext_yahoo_got_im can be called with msg=NULL, so it should be Wilmer van der Gaast 2008-01-17 Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts Wilmer van der Gaast 2008-01-13 Fixed handing of failed groupchat joins. Wilmer van der Gaast 2008-01-13 Fixed "Conditional jump or move depends on uninitialised value(s)" at Wilmer van der Gaast 2008-01-13 Fixed quickstart2. (Bug #349.) Wilmer van der Gaast 2008-01-13 Different handling of charset mismatches before login time. Ignoring a Wilmer van der Gaast 2008-01-12 When a switchboard connection dies (at the TCP level) and there are still Wilmer van der Gaast 2008-01-12 Killed info_string_append() and now showing the IP address of ICQ users Wilmer van der Gaast 2008-01-11 Fixing bug #344, now away states should always be correct, even when people Wilmer van der Gaast 2008-01-11 Adding own handle to protocol name in blist output for people with multiple Wilmer van der Gaast 2008-01-10 Now setting odata->icq properly again, this got lost some time ago, which Wilmer van der Gaast 2008-01-06 More consistency in error/warning errors. Until now "WARNING:" was usually Wilmer van der Gaast 2008-01-06 Changed warning message about unsent MSN messages. It should show the actual Wilmer van der Gaast 2008-01-05 Added "mail_notifications" setting. Who needs those notifications anyway? Wilmer van der Gaast 2008-01-05 Build fix from vmiklos. Wilmer van der Gaast 2008-01-05 Added handling of MSN switchboard NAK messages. Untested, but hey, it Wilmer van der Gaast 2008-01-05 Removed closure->result. I was planning to add some more stuff, but will Miklos Vajna 2007-12-31 encode: md5.c is no longer in protocols/, it's in lib/ Wilmer van der Gaast 2007-12-28 Fixed return value check in proxy_connect(), since on some systems Wilmer van der Gaast 2007-12-28 Added missing return in jabber_login(). Wilmer van der Gaast 2007-12-16 Implemented XEP-0199 (patch from misc@mandriva.org). Wilmer van der Gaast 2007-12-12 Checking conn->xcred before trying to clean it up since GnuTLS doesn't Wilmer van der Gaast 2007-12-12 Killed the <server> parameter to "account add" and changed the default Wilmer van der Gaast 2007-12-12 Fixed sockerr_again() usage in Jabber module to (hopefully) fix a 100% CPU Wilmer van der Gaast 2007-12-10 Don't allow nicks that start with a number. Wilmer van der Gaast 2007-12-10 Fixed "set xxx" syntax (it showed all settings instead of just xxx). Wilmer van der Gaast 2007-12-09 If I keep forgetting to credit people in commit msgs I should probably add Wilmer van der Gaast 2007-12-09 Added /invite support for Jabber chatrooms (and fixed the argument order
| * \ \ \ \ \ Merged in current develulim2007-12-04-18/+35
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wilmer van der Gaast 2007-12-02 Imported setuid() patch from Simo Leone <simo@archlinux...> with some Wilmer van der Gaast 2007-12-02 Forgot to return something in jabber_chat_join_failed(). Wilmer van der Gaast 2007-12-02 Merging a change I should've pulled before committing three other changes. Wilmer van der Gaast 2007-12-02 Added charset checks on incoming msgs (from the IRC side) to prevent possible Wilmer van der Gaast 2007-12-02 Handling of presence-error packets (only useful for groupchats now), moved Wilmer van der Gaast 2007-12-02 Defining DEBUG via CFLAGS so that it'll always be there, even when a file Wilmer van der Gaast 2007-12-02 Removed retarded printf() (ARGH) and moved the event handling handling of Wilmer van der Gaast 2007-11-29 printf() in daemons considered harmful. Wilmer van der Gaast 2007-11-28 Fixed the epoll+ForkDaemon combination. The libevent event handling
| * | | | | | | Intermediate commit. Sending seems to work. TODOs:ulim2007-12-03-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move from out_of_data to is_writable, eliminate buffers * implement "transfers reject [id]" * documentation in commands.xml * implement throughput and cummulative throughput boundaries * feature discovery before sending * implement sending over a proxy (proxy discovery, socks5 client handshake for sending, activate message) * integrate toxik-mek-ft
| * | | | | | | Initial import of jabber file receive and DCC send support. This introducesulim2007-11-28-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only a few changes to bitlbees code, mainly the addition of the "transfers" command. This is known to work with Kopete, Psi, and Pidgin (formerly known as gaim). At least with Pidgin also over a proxy. DCC has only been tested with irssi. IPV6 is untested but should work. Currently, only receiving via SOCKS5BYTESREAMS is implemented. I'm not sure if the alternative(in-band bytestreams IBB) is worth implementing since I didn't see a client yet that can do it. Additionally, it is probably very slow and needs support by the server as well.
* | | | | | | | Fixed a bug that caused full JIDs to get lost sometimes with the new wayWilmer van der Gaast2010-03-18-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of storing full JIDs belongong to a contact.
* | | | | | | | Fixed jabber_util unittest. It passes, yet something still seems to beWilmer van der Gaast2010-03-12-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | broken. :-(
* | | | | | | | Merging mainline.Wilmer van der Gaast2010-03-12-2/+7
|\ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ | |/| | | | | |
| * | | | | | | The Jabber part of the change. Also made representation of not-away a bitWilmer van der Gaast2010-03-06-2/+7
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | more consistent. Except for free-for-chat, which is nuts anyway.
* | | | | | | Restoring some logic that seemed broken but was important with handlingWilmer van der Gaast2009-11-19-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of chatrooms (and likely more things). The restored version is somewhat less confusing.
* | | | | | | Fixed a facepalm kind of NULL pointer dereference bug.Wilmer van der Gaast2009-11-19-4/+5
| | | | | | |
* | | | | | | resource_select now defaults to activity instead of priority. Also, addingWilmer van der Gaast2009-11-19-32/+38
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a activity_timeout setting. Now, messages to someone who hasn't spoken for a while will be sent to his/her bare JID, usually resulting in a broadcast. This should fix issues with messages sometimes arriving on someone's Crackberry/Android/etc instead of some place s/he's paying attention to. Last, the activity timer is only reset on incoming messages.
* | | | | / Added SET_INVALID, which set evaluators should now return instead of NULLWilmer van der Gaast2008-08-24-2/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | when the given value is not accepted. This to allow certain variables actually be set to NULL (server, for example). This should fully close #444.
* | | | | From the department of over-engineering, now cached packet IDs are fullWilmer van der Gaast2008-06-22-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MD5 hashes instead of a known MD5 hash with a number. Just to make it harder to confuse BitlBee by sending it faked responses to packets.
* | | | | Now preserving case in JID resources, and handling them with case sensitivityWilmer van der Gaast2008-06-22-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | since apparently that's how the RFC wants it. (While the rest of the JID should be case IN-sensitive. Consistency is hard to find these days...) Also extended the unittests a little bit. Closes #422.
* | | | | Added jabber_util unittests (buddy_add/_by_jid only ATM).Wilmer van der Gaast2008-06-22-1/+3
| |_|_|/ |/| | |
* | | | query.h now defines a callback function type, not using void* for it anymore.Wilmer van der Gaast2008-04-05-2/+6
| |_|/ |/| | | | | | | | | | | | | | Got rid of the bogus window handler pointer as the first argument to the callback.
* | | Saner garbage collection of cached packets in the Jabber module. NowWilmer van der Gaast2008-02-03-10/+6
| | | | | | | | | | | | | | | | | | cached packets are removed after about ten minues instead of something between one and two minutes. Closes one issue in #354.
* | | GET_BUDDY_FIRST wasn't actually implemented, even though it was in useWilmer van der Gaast2008-01-20-7/+19
| | | | | | | | | | | | | | | already. I don't want to know how long it took me to find out...
* | | More consistency in error/warning errors. Until now "WARNING:" was usuallyWilmer van der Gaast2008-01-06-1/+1
| |/ |/| | | | | | | in upper case while "Error:" wasn't .... that doesn't really make sense.
* | Handling of presence-error packets (only useful for groupchats now), movedWilmer van der Gaast2007-12-02-18/+5
| | | | | | | | | | | | jabber_chat_by_jid() (with the right name) to conference.c, I don't know what it was doing in jabber_util.c.
* | Removed retarded printf() (ARGH) and moved the event handling handling ofWilmer van der Gaast2007-12-02-0/+30
|/ | | | | IQ packets to jabber_util so I can reuse it for certain presence packets.
* Added some random hash to the id= for cached XMPP packets so that packetsWilmer van der Gaast2007-11-24-1/+2
| | | | | | from other BitlBees won't be picked up accidentally. Might also want to randomize the per-packet IDs because they're still predictable.
* Added jabber_error_parse() and using it for both stream- and stanzaWilmer van der Gaast2007-07-30-0/+35
| | | | | (only presence so far) errors.
* Added (and using) jabber_chat_free() for better memory management, fixedWilmer van der Gaast2007-07-02-8/+11
| | | | | | channel name generation code in root_commands.c and fixed one memory leak in jabber_buddy_remove_bare().