# HG changeset patch
# User tdrhq@soc.pidgin.im
# Date 1251219709 0
# Node ID 1ca2df744414462c125e4e593abe3de88f05b1b7
# Parent b357216b7b79c9ce102df240c389dbb5c7930eed# Parent 3443ed867ce34b697c5fba8c6f4f8e85a167776f
propagate from branch 'im.pidgin.pidgin' (head 32c5c2d4cfb2bede5ffb66792760a368ba8b9f0a)
to branch 'im.pidgin.soc.2009.webkitmessageview' (head 92ef7ff2d3d0706e73113ff78aded4c9ce5559e4)
diff -r 3443ed867ce3 -r 1ca2df744414 COPYRIGHT
--- a/COPYRIGHT Tue Aug 25 15:40:06 2009 +0000
+++ b/COPYRIGHT Tue Aug 25 17:01:49 2009 +0000
@@ -88,6 +88,7 @@
Matěj Cepl
Cerulean Studios, LLC
Jonathan Champ
+Matthew Chapman
Christophe Chapuis
Patrick Cheung
Ka-Hing Cheung
diff -r 3443ed867ce3 -r 1ca2df744414 ChangeLog
--- a/ChangeLog Tue Aug 25 15:40:06 2009 +0000
+++ b/ChangeLog Tue Aug 25 17:01:49 2009 +0000
@@ -1,6 +1,32 @@
Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
-version 2.6.0 (??/??/2009):
+version 2.6.2 (??/??/2009):
+ libpurple:
+ * Fix --disable-avahi to actually disable it in configure, as opposed
+ to just making the warning non-fatal.
+ * Sending custom smileys in MSN chats is now supported.
+ * Fix using GNOME proxy settings properly. (Erik van Pienbroek)
+
+ XMPP:
+ * Prompt the user before cancelling a presence subscription.
+ * Escape status messages that have HTML entities in the Get Info dialog.
+ * Fix connecting to XMPP domains with no SRV records from Pidgin on
+ Windows.
+ * Fix typing notifications with Pidgin 2.5.9 or earlier.
+ * Fix connecting using BOSH and legacy authentication (XEP-0078).
+
+ Finch:
+ * Properly detect libpanel on OpenBSD. (Brad Smith)
+
+ Pidgin:
+ * Fix the auto-personize functionality in the Buddy List.
+
+version 2.6.1 (08/18/2009):
+ * Fix a crash when some users send you a link in a Yahoo IM
+ * Fix compilation with GTK+ < 2.6.0
+ * Fix compilation on Windows
+
+version 2.6.0 (08/18/2009):
libpurple:
* Theme support in libpurple thanks to Justin Rodriguez's summer of code
project, with some minor additions and cleanups from Paul Aurich.
@@ -13,10 +39,32 @@
* Various memory cleanups when unloading libpurple. (Nick Hebner and
Stefan Becker)
* Report idle time 'From last message sent' should work properly.
+ * Better handling of corrupt certificates in the TLS Peers cache.
+ * More efficient buddy list and conversation search functions.
+ (Jan Kaluza and Aman Gupta)
+ * Install scalable versions of the main Pidgin icon, the protocol icons,
+ the dialog icons, and the Buddy List emblems.
+ * Build properly on Hurd. (Marc Dequènes)
+ * Various memory leaks fixed as reported by Josh Mueller.
+ * Properly handle an IRC buddy appearing in multiple groups.
+ * Escape HTML entities in usernames when written with the HTML logger.
+ * Do not display MySpace status changes as incoming IMs. (Mark Doliner and
+ Justin Williams)
+
+ DNS:
* DNS servers are re-read when DNS queries fail in case the system has
moved to a new network and the old servers are not accessible.
* DNS SRV records with equal priority are sorted with respect to their
weight as specified in RFC 2782. (Vijay Raghunathan)
+ * Don't do IPv6 address lookups if the computer does not have an IPv6
+ address configured.
+ * Fix a leak when the UI provides its own DNS resolving UI op.
+ (Aman Gupta)
+ * Don't fork a DNS resolver process to resolve IP addresses. (Aman Gupta)
+ * Internationalized Domain Names are supported when libpurple is compiled
+ against the GNU IDN library.
+
+ Environment Variables:
* GnuTLS logging (disabled by default) can be controlled through the
PURPLE_GNUTLS_DEBUG environment variable, which is an integer between
0 and 9 (higher is more verbose). Higher values may reveal sensitive
@@ -31,24 +79,6 @@
useful when running libpurple inside of Valgrind or similar programs.
Currently, it keeps plugins in memory, allowing Valgrind to perform
symbol resolution of leak traces at shutdown.
- * Don't do IPv6 address lookups if the computer does not have an IPv6
- address configured.
- * Fix a leak when the UI provides its own DNS resolving UI op.
- (Aman Gupta)
- * Don't fork a DNS resolver process to resolve IP addresses. (Aman Gupta)
- * Better handling of corrupt certificates in the TLS Peers cache.
- * More efficient buddy list and conversation search functions.
- (Jan Kaluza and Aman Gupta)
- * Internationalized Domain Names are supported when libpurple is compiled
- against the GNU IDN library.
- * Install scalable versions of the main Pidgin icon, the protocol icons,
- the dialog icons, and the Buddy List emblems.
- * Build properly on Hurd. (Marc Dequènes)
- * Various memory leaks fixed as reported by Josh Mueller.
- * Properly handle an IRC buddy appearing in multiple groups.
- * Escape HTML entities in usernames when written with the HTML logger.
- * Do not display MySpace status changes as incoming IMs. (Mark Doliner and
- Justin Williams)
AIM and ICQ:
* Preliminary support for a new authentication scheme called
@@ -67,6 +97,17 @@
* Support connection progress steps in Gadu-Gadu. (Krzysztof "kkszysiu"
Klinikowski)
+ MSN:
+ * Add support for receiving handwritten (ink) messages on MSN. (Chris
+ Stafford, Gal Topper, and Elliott Sales de Andrade)
+ * Add support for receiving audio clips on MSN. (Chris Stafford, Gal
+ Topper, and Elliott Sales de Andrade)
+ * Show the invite message for buddies that requested authorization
+ from you on MSN.
+ * Support sending an invite message to buddies when requesting authorization
+ from them on MSN.
+ * Timeout switchboard connections aggressively (60 seconds).
+
XMPP:
* Voice & Video support with Jingle (XEP-0166, 0167, 0176, & 0177), voice
support with GTalk and voice and video support with the GMail web
@@ -136,15 +177,6 @@
* Ability to set personal details for an account and for buddies in the
buddylist.
- MSN:
- * Add support for receiving handwritten (ink) messages on MSN.
- * Add support for receiving audio clips on MSN.
- * Show the invite message for buddies that requested authorization
- from you on MSN.
- * Support sending an invite message to buddies when requesting authorization
- from them on MSN.
- * Timeout switchboard connections aggressively
-
Pidgin:
* Added -f command line option to tell Pidgin to ignore NetworkManager
and assume it has a valid network connection.
@@ -192,6 +224,8 @@
* The hardware cursor is updated correctly. This will be useful
especially for users of braille terminals, screen readers etc.
* Added a TinyURL plugin, which aids copying longer URLs.
+ * Fixed UTF-8 compatibility problems which could cause exits or other
+ unrequested behaviour.
Pidgin GTK+ Theme Control Plugin:
* Removed mouse cursor color preferences.
@@ -200,6 +234,13 @@
* Preferences have been reorganized into three tabs for Colors, Fonts, and
Miscellaneous categories.
+version 2.5.9 (08/18/2009):
+ * Fix a crash via a specially crafted MSN message (CVE-2009-2694,
+ thanks to Core Security Technologies for discovering this and
+ notifying us privately before announcing it).
+ * Fix a crash in Bonjour, MSN, and XMPP when trying to transfer files with
+ NULL names.
+
version 2.5.8 (06/27/2009):
ICQ:
* Fix misparsing a web message as an SMS message. (Yuriy Kaminskiy)
diff -r 3443ed867ce3 -r 1ca2df744414 ChangeLog.API
--- a/ChangeLog.API Tue Aug 25 15:40:06 2009 +0000
+++ b/ChangeLog.API Tue Aug 25 17:01:49 2009 +0000
@@ -1,6 +1,9 @@
Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
-version 2.6.0 (??/??/2009):
+version 2.6.1 (08/18/2009):
+ No changes
+
+version 2.6.0 (08/18/2009):
libpurple:
Added:
* PurpleMedia and PurpleMediaManager API
@@ -154,6 +157,9 @@
* GntProgressBar and functions (Saleem Abdulrasool)
perl:
+ Added:
+ * Purple::XMLNode::get_name()
+
Changed:
* Made a bunch of functions act more perl-like. Call the new()
functions as Class->new(...) instead of Class::new(...):
@@ -167,6 +173,14 @@
* Purple::Request::Field::list_new
* Purple::Request::Field::string_new
* Purple::Request::Field::group_new
+ * Make the XMLNode API more perl-like. Don't pass len
+ parameters and call them like:
+ * $xmlnode->copy()
+ * $xmlnode->to_str()
+ * $xmlnode->to_formatted_str()
+ * Purple::XMLNode::from_str(...)
+version 2.5.9 (08/18/2009):
+ No changes
version 2.5.8 (06/27/2009):
No changes
diff -r 3443ed867ce3 -r 1ca2df744414 ChangeLog.win32
--- a/ChangeLog.win32 Tue Aug 25 15:40:06 2009 +0000
+++ b/ChangeLog.win32 Tue Aug 25 17:01:49 2009 +0000
@@ -1,6 +1,12 @@
-version 2.6.0 (??/??/2009):
+version 2.6.1 (08/18/2009):
+ * No changes
+
+version 2.6.0 (08/18/2009):
* Added XMPP URI support.
+version 2.5.9 (08/18/2009):
+ * No changes and no win32 packages built.
+
version 2.5.8 (06/27/2009):
* No changes
diff -r 3443ed867ce3 -r 1ca2df744414 INSTALL
--- a/INSTALL Tue Aug 25 15:40:06 2009 +0000
+++ b/INSTALL Tue Aug 25 17:01:49 2009 +0000
@@ -158,7 +158,7 @@
`--with-dynamic-prpls' takes a list of comma separated protocols also. If used only those listed will be built. If no protocols are listed with either `--with-static-prpls' or with `--with-dynamic-prpls' then Pidgin and Finch will be effectively useless.
- If configure does not find python, it will build without DBUS support. Thiswill disable scripts such as purple-remote and purple-uri-handler, effectively disabling integration with the browser. You can tell configure where your python binary is located with `--with-python=PATH'
+ If configure does not find python, it will build without DBUS support. This will disable scripts such as purple-remote and purple-uri-handler, effectively disabling integration with the browser. You can tell configure where your python binary is located with `--with-python=PATH'
Specifying the System Type
==========================
diff -r 3443ed867ce3 -r 1ca2df744414 NEWS
--- a/NEWS Tue Aug 25 15:40:06 2009 +0000
+++ b/NEWS Tue Aug 25 17:01:49 2009 +0000
@@ -2,6 +2,56 @@
Our development blog is available at: http://planet.pidgin.im
+2.6.1 (08/18/2009):
+ Mark: There were a lot of changes in 2.6.0, and so a few major bugs
+ crept in. This is a very minor release to fix those bugs. Sorry for
+ the inconvenience!
+
+2.6.0 (08/18/2009):
+ John: Wow, four straight releases that I'm the first to NEWS on. This
+ is getting kinda scary! I'm beginning to wonder who else actually does
+ anything around here! (Just kidding, of course.) LOTS of new features
+ and a crapton of bugfixes this release. There should pretty much be
+ something for everybody. A great example of this is the ton of Yahoo
+ changes that have happened thanks to our SoC student from 2008, Sulabh
+ Mahajan. Among his massive improvements are the ability to add MSN
+ buddies by adding them as "msn/user@domain.tld" and peer-to-peer file
+ transfers. Of course, history shows we can't please everyine, so I'm
+ sure I'll see a complaint or five thousand in trac. Enjoy, though!
+
+ Marcus: This is my first news! It's been quite a few microreleases this
+ time, but now we're finally at 2.6.0. I suppose the most anticipated
+ new feature in this release is the voice and video support, thanks to
+ Mike's heroic work. I've managed to slip in a few features too, like
+ in-band bytestream file transfers as a fallback on XMPP and idle time
+ reporting on XMPP. Enjoy!
+
+ Paul: This is my first news, too! This release has definitely been a
+ long time coming; hopefully it won't disappoint since we've closed over
+ 200 tickets. Among other things, Tobias Markmann's GSoC project from
+ last year was merged, which means we now support BOSH (XMPP connections
+ over HTTP), and Andrei Mozzhuhin contributed an XMPP Service Discovery
+ Browser. Also, thanks to Bernmeister for poking (at least) several
+ hundred old tickets!
+
+ Mike: Ditto. This is my first news as well. I have a feeling this is
+ getting repetitive at this point, but voice and video support is
+ finally here! Thanks to the rest of the Pidgin team, Farsight 2, and
+ GStreamer developers for making this possible! (I finally finished my
+ Summer of Code project :D)
+
+ Elliott: Hey, this is my firs... Wait, no it isn't. Now I feel left
+ out. So have you heard about this voice and video thing?
+ Unfortunately, not quite ready for all protocols, but it's getting
+ there. MSN gained support for receiving voice clips at least, and
+ finally we have Ink receiving capabilities too. Thanks to the guys
+ who wrote the original patch. And finally, MSN no longer has over a
+ 100 tickets open!
+
+2.5.9 (08/18/2009):
+ John: This release is just a crash fix release to address a security
+ issue reported to us by CORE and a couple crashes Elliott found.
+
2.5.8 (06/27/2009):
John: This release is another somewhat rushed bugfix release to fix
a number of bugs that have come up since we released Pidgin 2.5.7.
@@ -51,10 +101,10 @@
a few patches, and we've dealt with what feels like a TON of tickets
about two very common issues. Feels like time for a release to me.
- Etan: My first NEWS in quite a while and I don't have much to say. I
+ Etan: My first NEWS in quite a while and I don't have much to say. I
haven't been too active lately and I'm hoping that won't be the case
- going forward. I managed to get in a few perl fixes and some UI
- language tweaks this release. My plan is to work on some of the
+ going forward. I managed to get in a few perl fixes and some UI
+ language tweaks this release. My plan is to work on some of the
issues pointed out by mpt (during his expert review of pidgin a little
while back) in the near future.
@@ -92,14 +142,14 @@
messaging pleasure.
Sadrul: Despite our best efforts, this release got delayed by a
- couple of weeks. But here it is! It is mostly a bug fix release, with
+ couple of weeks. But here it is! It is mostly a bug fix release, with
a couple of important fixes, e.g. fix for the Yahoo! disconnect
- problem. Also, welcome our newest Crazy Patch Writer, Marcus Lundblad,
+ problem. Also, welcome our newest Crazy Patch Writer, Marcus Lundblad,
who, among various other fixes, has implemented custom smileys for the
- XMPP protocol, included in this release. Enjoy!
+ XMPP protocol, included in this release. Enjoy!
Stu: I guess this is the time of year for server migrations, and
- I've just about had enough of them. Fortunately Pidgin is still fun,
+ I've just about had enough of them. Fortunately Pidgin is still fun,
and this release should be superb.
John: Although our services were down for quite some time, we didn't
@@ -109,8 +159,8 @@
happy!
Elliott: This release took a while, but that was due to an unfortunate
- server snafu. I didn't have much to do with it, but hopefully the new
- servers will help us out a bit. Anyway, mostly bug-fixes this time.
+ server snafu. I didn't have much to do with it, but hopefully the new
+ servers will help us out a bit. Anyway, mostly bug-fixes this time.
Nothing spectacular, unless you happen to suffer from one of those bugs.
Oh, and don't forget, the "Has you" tooltip is back!
@@ -123,9 +173,9 @@
coming months.
Elliott: I'm just commenting so Kevin wouldn't be the only one in NEWS
- and no-one else seems to want to. Anyway, there's a couple MSN login
- fixes, so try it out. The contact list problems might still be around,
- but you can probably find a workaround in trac. And there's a tooltip
+ and no-one else seems to want to. Anyway, there's a couple MSN login
+ fixes, so try it out. The contact list problems might still be around,
+ but you can probably find a workaround in trac. And there's a tooltip
fix for our AIM friends, not that I had anything to do with it (except
closing many many duplicate tickets).
@@ -135,16 +185,16 @@
it to the world! There are myriad bugfixes, including some important
ones so you should be sure to update.
- Hylke: Finally MSNP15 support. To celebrate this I refreshed a lot of
+ Hylke: Finally MSNP15 support. To celebrate this I refreshed a lot of
the smilies used in the protocol and added the long awaited indispensable
- bunny icon. I think this is one of those releases that will make a lot
+ bunny icon. I think this is one of those releases that will make a lot
of users happy, especially MSN users.
- Elliott: Oh look, my first NEWS! Well anyway, with that new MSNP15
+ Elliott: Oh look, my first NEWS! Well anyway, with that new MSNP15
support, this release is set up to be a huge success and a total flop
- all at the same time. Here's hoping it's the "huge success" one for you.
+ all at the same time. Here's hoping it's the "huge success" one for you.
Those icon changes that Hylke made, while minor, really make things look
- a little cleaner, I think. Oh yea, did I mention that MSNP15 stuff?
+ a little cleaner, I think. Oh yea, did I mention that MSNP15 stuff?
Mark: Speaking of MSNP15, we'd like to welcome Elliott Sales de Andrade
as a full fledged developer! He took the last few strides mushing the
@@ -152,7 +202,7 @@
doing other great stuff.
Ka-Hing: "Reject"ing a certificate after your account is signed off is
- not recommended. Deleting the file after you start sending it is also
+ not recommended. Deleting the file after you start sending it is also
discouraged.
2.4.3 (07/01/2008):
@@ -162,12 +212,12 @@
2.4.2 (5/17/2008):
Sadrul: We added some usability changes in this release, including the
typing notification, buddyicon and input area size in the conversation
- windows, escape to close conversation windows etc. These changes should
+ windows, escape to close conversation windows etc. These changes should
make pidgin more usable and more fun for Everyone! *wink*
Stu: I fixed some memory leaks, but nothing like as many as Daniel did.
MSN buddy list synchronization should be significantly less painful now,
- and opening MSN inboxes might work better too. SILC passphrase changes
+ and opening MSN inboxes might work better too. SILC passphrase changes
and support for passphrase-less keys has been improved also.
2.4.1 (3/31/2008):
@@ -184,27 +234,27 @@
John: While this release took what seems like forever to get out the
door, I think it's well worth the wait, especially for Yahoo! users.
This release serves up some fixes for long standing bugs and adds
- file transfer for transfers with newer Yahoo! clients (finally!). As
+ file transfer for transfers with newer Yahoo! clients (finally!). As
is standard with code I committed, where it works great thank the
- patch writer, and where it's broken, feel free to yell at me. Enjoy!
-
- Sadrul: Finch is more colourful and blinky in this release! There's
+ patch writer, and where it's broken, feel free to yell at me. Enjoy!
+
+ Sadrul: Finch is more colourful and blinky in this release! There's
now a log viewer, which is very useful, and also the ability to
- block/unblock buddies. It's now also possible to find chat rooms on
- many services, e.g. XMPP, IRC, Yahoo! etc. Happy Leap Day!
+ block/unblock buddies. It's now also possible to find chat rooms on
+ many services, e.g. XMPP, IRC, Yahoo! etc. Happy Leap Day!
Ka-Hing: I think all I've done for this release is committing some
patches written by other people.
- Stu: Finally, 2.4.0 lands. I didn't do all that much except complain
- about things I didn't like or just revert Sean's changes. I'm quite
+ Stu: Finally, 2.4.0 lands. I didn't do all that much except complain
+ about things I didn't like or just revert Sean's changes. I'm quite
pleased with how well it's turned out in the end.
Happy Birthday Fred, you must be nearly 10 now ;-)
2.3.1 (12/7/2007):
Stu: I'm sorry for the MSN problems and the plugin crashes in 2.3.0.
- Hopefully this will redeem us. This fixes a number of bugs. I'm a
- bit late but I'd like to welcome John to the team. Enjoy!
+ Hopefully this will redeem us. This fixes a number of bugs. I'm a
+ bit late but I'd like to welcome John to the team. Enjoy!
Luke: I've done absolutely nothing in the last 2 weeks, except watch
others commit bug and, more, leak fixes. People should be noticing
@@ -246,23 +296,23 @@
last release looking at the tickets that have been submitted
and many of them have been closed.
- Stu: I haven't NEWS'd in a while. I haven't actually done much for
- too long also, maybe I'll find some time soon. This release is
+ Stu: I haven't NEWS'd in a while. I haven't actually done much for
+ too long also, maybe I'll find some time soon. This release is
basically what 2.2.0 should have been - it actually compiles this
time.
2.2.0 (9/13/2007):
Sean: 2.2.0 contains the results of several major Google Summer
- of Code branches bringing some new, extraordinary features. We
+ of Code branches bringing some new, extraordinary features. We
have a new protocol, MySpaceIM, a bunch of new features for an
existing protocol, XMPP, and nifty new certificate management
to make sure your IM server is who it says it is.
Ka-Hing: A number of you noticed crashes when dragging windows
- around when certain options are enabled. Well, that was my fault,
- and Sadrul fixed it. So Props to him and poos to me. I haven't
+ around when certain options are enabled. Well, that was my fault,
+ and Sadrul fixed it. So Props to him and poos to me. I haven't
done much for this release, but the next one should contain
- something that I helped work on. Hint: students are cheap slave
+ something that I helped work on. Hint: students are cheap slave
coders!
Kevin: I haven't really been coding much in Pidgin, and this
@@ -272,9 +322,9 @@
2.1.1 (8/20/2007):
Sean: Continuing our schedule of frequent releases, Pidgin 2.1.1
- is out. In it, we've addressed a lot of UI issues from our
+ is out. In it, we've addressed a lot of UI issues from our
experimental new changes introduced in 2.1.0, and gave a lot of
- attention to Yahoo! and Bonjour. Thanks to everyone who
+ attention to Yahoo! and Bonjour. Thanks to everyone who
contributed.
Luke: We have reworked some parts of the conversation windows in
@@ -285,14 +335,14 @@
various issues, testing fixes, and getting patches in.
Tim: Sean finally got me to fix some of the buddy list bugs with
- Yahoo! when in version 15 mode. So now we have some Yahoo! to
- MSN support, which is kind of nice. Looks like some others have
+ Yahoo! when in version 15 mode. So now we have some Yahoo! to
+ MSN support, which is kind of nice. Looks like some others have
been contributing to Yahoo! while I've been AWOL, so many thanks
to them.
2.1.0 (7/28/2007):
Sean: This release took a bit longer than 3 weeks, but boy is it
- worth it! We're beginning to experiment with new UI concepts and
+ worth it! We're beginning to experiment with new UI concepts and
this release features a largely re-designed conversation window.
We've closed 150 tickets for this release; much thanks go to all
the developers, translators, and testers who made this possible.
@@ -300,28 +350,28 @@
Ka-Hing: Sean said no one else NEWS'ed, so I figure I should.
2.0.2 (6/14/2007):
- Sean: Another big maintenance release. Again, about 100 tickets were
- resolved in this release, and they keep coming in. Lots of bug fixes,
+ Sean: Another big maintenance release. Again, about 100 tickets were
+ resolved in this release, and they keep coming in. Lots of bug fixes,
some minor icon adjustements, hopefully we addressed some ICQ
internationalization issues, and support for Bonjour on Windows!
Our next release will be 2.1.0, and will come with some great new
features.
Stu: I think we're gradually getting the hang of this 3 week thing
- again. This release includes yet more bug fixes. I'd also like to
+ again. This release includes yet more bug fixes. I'd also like to
specifically thank Pekka Riikonen for the patch to enable using SILC
Toolkit 1.1 with Pidgin/libpurple that is included in this release.
2.0.1 (5/24/2007):
- Sean: 2.0.1! Three weeks later, as scheduled! It is so nice to have
- regular, frequent, releases again! This is a bugfix release; We have
+ Sean: 2.0.1! Three weeks later, as scheduled! It is so nice to have
+ regular, frequent, releases again! This is a bugfix release; We have
fixed over 100 issues reported to us at http://developer.pidgin.im.
Thanks to everyone for their great work, and look for the next release
in another three weeks!
- Stu: Lots'o'fixes in this. I don't know how you users find so many
- things for us to fix. 24 hours in a day (sadly). 24 is divisible by the
- sum of its digits and by their product. It is the smallest composite
+ Stu: Lots'o'fixes in this. I don't know how you users find so many
+ things for us to fix. 24 hours in a day (sadly). 24 is divisible by the
+ sum of its digits and by their product. It is the smallest composite
number, the product of whose divisors is a cube.
Luke: I requested that we have a bug fix release, and so we have!
@@ -343,18 +393,18 @@
definition of 'cool' to get it.
Etan: Perl plugins now have access to almost all of the savedstatus
- API functions. I also removed a couple of the preferences from the
+ API functions. I also removed a couple of the preferences from the
Pidgin GTK+ Theme Control plugin which should help many of the people
- for whom the configuration dialog size was a problem. The removed
+ for whom the configuration dialog size was a problem. The removed
preferences no longer had the effects they were added to have anyway.
2.0.0 (5/3/2007):
Sean: 2.0.0! It's real exciting to finally release Pidgin 2.0.0! I'm
- really proud of all the work we've all done. I'm pumped. And, while
+ really proud of all the work we've all done. I'm pumped. And, while
I could go on about all the amazing thing that have been added since
1.5.0, what I'm really excited about is getting back to a regular,
rapid, release cycle of active, open development, unhindered by legal
- quandries. Huge thanks to everyone involved.
+ quandries. Huge thanks to everyone involved.
Luke: We have finally managed to get 2.0.0 out the door, after nearly
but not quite 2 years of effort and fustration. No one regrets more
@@ -371,24 +421,24 @@
attempt to avoid knee-jerk reactions.
Evan: One small step for bird, one giant leap for birdkind... except
- this is hardly one small step. A lot more has changed from Gaim 1.5.0
+ this is hardly one small step. A lot more has changed from Gaim 1.5.0
than just the name. Pidgin has a *very* attractive new look, a whole
new member of the family (Finch, formerly gaim-console) has been born,
and libpurple has come into its own as a solid, full-featured library
- powering the greatest IM clients around. Bugs were fixed and
+ powering the greatest IM clients around. Bugs were fixed and
features were added by the hundreds (thousands?) since the last
major release, all while improving performance and resisting feature
- creep. As Luke said, a ton of thought and effort has gone into
+ creep. As Luke said, a ton of thought and effort has gone into
Pidgin 2.0.0; I'm proud to have played a part.
- Stu: We did it! finally, we have 2.0.0. It's been a long time coming,
- but there's a great deal of goodness here. When I say a long time, I'm
+ Stu: We did it! finally, we have 2.0.0. It's been a long time coming,
+ but there's a great deal of goodness here. When I say a long time, I'm
not kidding - it's been 972 days since we branched off "oldstatus"
- (aka 1.x). The early Greeks were uncertain as to whether 2 was a
+ (aka 1.x). The early Greeks were uncertain as to whether 2 was a
number at all (or if we'd ever make this release) - it has a beginning
and an end but no middle (much like our unfortunately quiet development
- period). 2 is the first prime number and the only even prime. 2 is also
- the first deficient number (oh well). There are only 10 types of people
+ period). 2 is the first prime number and the only even prime. 2 is also
+ the first deficient number (oh well). There are only 10 types of people
in the world - those who like our new names and those who do not.
Enjoy!
@@ -398,7 +448,7 @@
where they are today. Congratulations everyone!
Sadrul: My first NEWS, and on what an occasion! Pidgin 2.0.0 is finally
- released!! And it's *really* very good!!! Give your soul a break ...
+ released!! And it's *really* very good!!! Give your soul a break ...
Use Pidgin!
Daniel: There has been a fair amount of weeping and gnashing of teeth
diff -r 3443ed867ce3 -r 1ca2df744414 PLUGIN_HOWTO
--- a/PLUGIN_HOWTO Tue Aug 25 15:40:06 2009 +0000
+++ b/PLUGIN_HOWTO Tue Aug 25 17:01:49 2009 +0000
@@ -1,6 +1,6 @@
For information on writing a plugin for Purple, Pidgin or Finch, go
-http://developer.pidgin.im and click on API. From there, see the HOWTOs in the
-"Related Pages" section.
+http://developer.pidgin.im and click on API. From there, see the
+HOWTOs in the "Related Pages" section.
You can also generate this documentation locally by installing
doxygen and graphviz dot, then running "make docs" in the
diff -r 3443ed867ce3 -r 1ca2df744414 configure.ac
--- a/configure.ac Tue Aug 25 15:40:06 2009 +0000
+++ b/configure.ac Tue Aug 25 17:01:49 2009 +0000
@@ -46,7 +46,7 @@
m4_define([purple_lt_current], [6])
m4_define([purple_major_version], [2])
m4_define([purple_minor_version], [6])
-m4_define([purple_micro_version], [0])
+m4_define([purple_micro_version], [2])
m4_define([purple_version_suffix], [devel])
m4_define([purple_version],
[purple_major_version.purple_minor_version.purple_micro_version])
@@ -55,7 +55,7 @@
m4_define([gnt_lt_current], [6])
m4_define([gnt_major_version], [2])
m4_define([gnt_minor_version], [6])
-m4_define([gnt_micro_version], [0])
+m4_define([gnt_micro_version], [2])
m4_define([gnt_version_suffix], [devel])
m4_define([gnt_version],
[gnt_major_version.gnt_minor_version.gnt_micro_version])
@@ -312,11 +312,11 @@
dnl #######################################################################
dnl # Check for GLib 2.0 (required)
dnl #######################################################################
-PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.0 gobject-2.0 gmodule-2.0 gthread-2.0], , [
+PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.4.0 gobject-2.0 gmodule-2.0 gthread-2.0], , [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
-You must have the GLib 2.0 development headers installed to build.
+You must have GLib 2.4.0 or newer development headers installed to build.
If you have these installed already you may need to install pkg-config so
I can find them.
@@ -399,12 +399,13 @@
fi
if test "x$enable_gtkui" = "xyes" ; then
- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0.0], , [
+ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0], , [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
-You must have the GTK+ 2.0 development headers installed to compile Pidgin.
-If you want to build only Finch then specify --disable-gtkui when running configure.
+You must have GTK+ 2.4.0 or newer development headers installed to compile
+Pidgin. If you want to build only Finch then specify --disable-gtkui when
+running configure.
])])
AC_SUBST(GTK_CFLAGS)
@@ -631,7 +632,8 @@
[ac_ncurses_includes="$withval"], [ac_ncurses_includes=""])
if test "x$enable_consoleui" = "xyes"; then
AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_consoleui=no])
- AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"], [enable_consoleui=no])
+ AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"],
+ [enable_consoleui=no], [$GNT_LIBS])
if test "x$enable_consoleui" = "xyes"; then
dnl # Some distros put the headers in ncursesw/, some don't
@@ -674,7 +676,8 @@
# ncursesw was not found. Look for plain old ncurses
enable_consoleui=yes
AC_CHECK_LIB(ncurses, initscr, [GNT_LIBS="-lncurses"], [enable_consoleui=no])
- AC_CHECK_LIB(panel, update_panels, [GNT_LIBS="$GNT_LIBS -lpanel"], [enable_consoleui=no])
+ AC_CHECK_LIB(panel, update_panels, [GNT_LIBS="$GNT_LIBS -lpanel"],
+ [enable_consoleui=no], [$GNT_LIBS])
AC_DEFINE(NO_WIDECHAR, 1, [Define to 1 if you don't have wide-character support.])
if test x"$ac_ncurses_includes" != "x"; then
GNT_CFLAGS="-I$ac_ncurses_includes"
@@ -794,13 +797,13 @@
dnl #######################################################################
AC_ARG_ENABLE(vv,
[AC_HELP_STRING([--disable-vv], [compile without voice and video support])],
- [enable_vv="$enableval" force_vv=$enableval], [enable_vv="yes" force_vv=no])
+ enable_vv="$enableval", enable_vv="yes")
if test "x$enable_vv" != "xno"; then
if test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farsight" != "xno"; then
AC_DEFINE(USE_VV, 1, [Use voice and video])
else
enable_vv="no"
- if test "x$force_vv" = "xyes"; then
+ if test "x$force_deps" = "xyes"; then
AC_MSG_ERROR([
Dependencies for voice/video were not met.
Install the necessary gstreamer and farsight packages first.
@@ -809,6 +812,7 @@
fi
fi
fi
+AM_CONDITIONAL(USE_VV, test "x$enable_gstreamer" != "xno" -a "x$enable_gstinterfaces" != "xno" -a "x$enable_farsight" != "xno")
AC_ARG_ENABLE(idn,
[AC_HELP_STRING([--disable-idn], [compile without IDN support])],
@@ -858,36 +862,39 @@
[AC_HELP_STRING([--disable-avahi],
[compile without avahi (required for Bonjour support)])],
enable_avahi="$enableval", enable_avahi="yes")
-AC_ARG_WITH(avahi-client-includes, [AC_HELP_STRING([--with-avahi-client-includes=DIR], [compile the Bonjour plugin against the Avahi Client includes in DIR])], [ac_avahi_client_includes="$withval"], [ac_avahi_client_includes="no"])
-AC_ARG_WITH(avahi-client-libs, [AC_HELP_STRING([--with-avahi-client-libs=DIR], [compile the Bonjour plugin against the Avahi Client libs in DIR])], [ac_avahi_client_libs="$withval"], [ac_avahi_client_libs="no"])
-AVAHI_CFLAGS=""
-AVAHI_LIBS=""
+
+if test "x$enable_avahi" = "xyes"; then
+ AC_ARG_WITH(avahi-client-includes, [AC_HELP_STRING([--with-avahi-client-includes=DIR], [compile the Bonjour plugin against the Avahi Client includes in DIR])], [ac_avahi_client_includes="$withval"], [ac_avahi_client_includes="no"])
+ AC_ARG_WITH(avahi-client-libs, [AC_HELP_STRING([--with-avahi-client-libs=DIR], [compile the Bonjour plugin against the Avahi Client libs in DIR])], [ac_avahi_client_libs="$withval"], [ac_avahi_client_libs="no"])
+ AVAHI_CFLAGS=""
+ AVAHI_LIBS=""
-dnl Attempt to autodetect Avahi
-PKG_CHECK_MODULES(AVAHI, [avahi-client avahi-glib], [
- avahiincludes="yes"
- avahilibs="yes"
-], [
- avahiincludes="no"
- avahilibs="no"
-])
+ dnl Attempt to autodetect Avahi
+ PKG_CHECK_MODULES(AVAHI, [avahi-client avahi-glib], [
+ avahiincludes="yes"
+ avahilibs="yes"
+ ], [
+ avahiincludes="no"
+ avahilibs="no"
+ ])
-dnl Override AVAHI_CFLAGS if the user specified an include dir
-if test "$ac_avahi_client_includes" != "no"; then
- AVAHI_CFLAGS="-I$ac_avahi_client_includes"
+ dnl Override AVAHI_CFLAGS if the user specified an include dir
+ if test "$ac_avahi_client_includes" != "no"; then
+ AVAHI_CFLAGS="-I$ac_avahi_client_includes"
+ fi
+ CPPFLAGS_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS"
+ AC_CHECK_HEADER(avahi-client/client.h, [avahiincludes=yes], [avahiincludes=no])
+ CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS $GLIB_CFLAGS"
+ AC_CHECK_HEADER(avahi-glib/glib-malloc.h, [avahiincludes=yes], [avahiincludes=no])
+ CPPFLAGS="$CPPFLAGS_save"
+
+ dnl Override AVAHI_LIBS if the user specified a libs dir
+ if test "$ac_avahi_client_libs" != "no"; then
+ AVAHI_LIBS="-L$ac_avahi_client_libs -lavahi-common -lavahi-client -lavahi-glib "
+ fi
+ AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
fi
-CPPFLAGS_save="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS"
-AC_CHECK_HEADER(avahi-client/client.h, [avahiincludes=yes], [avahiincludes=no])
-CPPFLAGS="$CPPFLAGS $AVAHI_CFLAGS $GLIB_CFLAGS"
-AC_CHECK_HEADER(avahi-glib/glib-malloc.h, [avahiincludes=yes], [avahiincludes=no])
-CPPFLAGS="$CPPFLAGS_save"
-
-dnl Override AVAHI_LIBS if the user specified a libs dir
-if test "$ac_avahi_client_libs" != "no"; then
- AVAHI_LIBS="-L$ac_avahi_client_libs -lavahi-common -lavahi-client -lavahi-glib "
-fi
-AC_CHECK_LIB(avahi-client, avahi_client_new, [avahilibs=yes], [avahilibs=no], $AVAHI_LIBS)
if test "x$enable_avahi" = "xyes" -a "x$force_deps" = "xyes" -a \( "x$avahiincludes" = "xno" -o "x$avahilibs" = "xno" \); then
AC_MSG_ERROR([
diff -r 3443ed867ce3 -r 1ca2df744414 doc/core-signals.dox
--- a/doc/core-signals.dox Tue Aug 25 15:40:06 2009 +0000
+++ b/doc/core-signals.dox Tue Aug 25 17:01:49 2009 +0000
@@ -2,6 +2,7 @@
@signals
@signal quitting
+ @signal uri-handler
@endsignals
@see core.h
@@ -16,5 +17,16 @@
Emitted when libpurple is quitting.
@endsignaldef
+ @signaldef uri-handler
+ @signalproto
+gboolean (*uri_handler)(const gchar *proto, const gchar *cmd, GHashTable *params);
+ @endsignalproto
+ @signaldesc
+ Emitted when handling a registered URI.
+ @param proto The protocol of the URI.
+ @param cmd The 'command' of the URI.
+ @param params Any key/value parameters from the URI.
+ @endsignaldef
+
*/
// vim: syntax=c.doxygen tw=75 et
diff -r 3443ed867ce3 -r 1ca2df744414 doc/jabber-signals.dox
--- a/doc/jabber-signals.dox Tue Aug 25 15:40:06 2009 +0000
+++ b/doc/jabber-signals.dox Tue Aug 25 17:01:49 2009 +0000
@@ -8,6 +8,7 @@
@signal jabber-register-namespace-watcher
@signal jabber-unregister-namespace-watcher
@signal jabber-sending-xmlnode
+ @signal jabber-receiving-xmlnode
@endsignals
@@ -71,7 +72,7 @@
@signaldef jabber-watched-iq
@signalproto
-gboolean (*watched_iq)(PurpleConnection *pc, const char *type, const char *id,
+gboolean (*watched_iq)(PurpleConnection *gc, const char *type, const char *id,
const char *from, xmlnode *child);
@endsignalproto
@signaldesc
@@ -87,18 +88,6 @@
process it. FALSE otherwise.
@endsignaldef
- @signaldef jabber-sending-xmlnode
- @signalproto
-void (sending_xmlnode)(PurpleConnection *gc, xmlnode **stanza);
- @endsignalproto
- @signaldesc
- Emit this signal (@c purple_signal_emit) to send a stanza. It is preferred
- to use this instead of prpl_info->send_raw.
- @param gc The connectoin on which to send the stanza.
- @param stanza The stanza to send. If stanza is not NULL after being sent,
- the emitter should free it.
- @endsignaldef
-
@signaldef jabber-register-namespace-watcher
@signalproto
void (register_namespace_watcher)(const char *node, const char *namespace);
@@ -121,5 +110,29 @@
@param namespace The IQ child namespace to no longer watch.
@endsignaldef
+ @signaldef jabber-sending-xmlnode
+ @signalproto
+void (sending_xmlnode)(PurpleConnection *gc, xmlnode **stanza);
+ @endsignalproto
+ @signaldesc
+ Emit this signal (@c purple_signal_emit) to send a stanza. It is preferred
+ to use this instead of prpl_info->send_raw.
+ @param gc The connection on which to send the stanza.
+ @param stanza The stanza to send. If stanza is not NULL after being sent,
+ the emitter should free it.
+ @endsignaldef
+
+ @signaldef jabber-receiving-xmlnode
+ @signalproto
+void (receiving_xmlnode)(PurpleConnection *gc, xmlnode **stanza);
+ @endsignalproto
+ @signaldesc
+ Emitted when an XMPP stanza is received. Allows a plugin to process any
+ stanza.
+ @param gc The connection on which the stanza was received.
+ @param stanza The received stanza. Set stanza to NULL (and free it) to
+ stop processing the stanza.
+ @endsignaldef
+
*/
// vim: syntax=c.doxygen tw=75 et
diff -r 3443ed867ce3 -r 1ca2df744414 finch/gntmedia.c
--- a/finch/gntmedia.c Tue Aug 25 15:40:06 2009 +0000
+++ b/finch/gntmedia.c Tue Aug 25 17:01:49 2009 +0000
@@ -156,7 +156,7 @@
{
media->priv = FINCH_MEDIA_GET_PRIVATE(media);
- media->priv->calling = gnt_label_new(_("Calling ... "));
+ media->priv->calling = gnt_label_new(_("Calling..."));
media->priv->hangup = gnt_button_new(_("Hangup"));
media->priv->accept = gnt_button_new(_("Accept"));
media->priv->reject = gnt_button_new(_("Reject"));
diff -r 3443ed867ce3 -r 1ca2df744414 finch/libgnt/configure.ac
--- a/finch/libgnt/configure.ac Tue Aug 25 15:40:06 2009 +0000
+++ b/finch/libgnt/configure.ac Tue Aug 25 17:01:49 2009 +0000
@@ -24,11 +24,11 @@
# Make sure to update ../../configure.ac with libgnt version changes.
#
-m4_define([gnt_lt_current], [5])
+m4_define([gnt_lt_current], [6])
m4_define([gnt_major_version], [2])
-m4_define([gnt_minor_version], [5])
-m4_define([gnt_micro_version], [0])
-m4_define([gnt_version_suffix], [])
+m4_define([gnt_minor_version], [6])
+m4_define([gnt_micro_version], [2])
+m4_define([gnt_version_suffix], [devel])
m4_define([gnt_version],
[gnt_major_version.gnt_minor_version.gnt_micro_version])
m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
diff -r 3443ed867ce3 -r 1ca2df744414 finch/libgnt/gntkeys.c
--- a/finch/libgnt/gntkeys.c Tue Aug 25 15:40:06 2009 +0000
+++ b/finch/libgnt/gntkeys.c Tue Aug 25 17:01:49 2009 +0000
@@ -166,7 +166,7 @@
strstr(term, "xterm") == term ||
strstr(term, "vt100") == term)
*(text + 1) = 'O';
- } else if (*(unsigned char*)text == 195) {
+ } else if (g_utf8_get_char(text) == 195) {
if (*(text + 2) == 0 && strstr(term, "xterm") == term) {
*(text) = 27;
*(text + 1) -= 64; /* Say wha? */
diff -r 3443ed867ce3 -r 1ca2df744414 finch/plugins/gnttinyurl.c
--- a/finch/plugins/gnttinyurl.c Tue Aug 25 15:40:06 2009 +0000
+++ b/finch/plugins/gnttinyurl.c Tue Aug 25 17:01:49 2009 +0000
@@ -354,7 +354,7 @@
frame = purple_plugin_pref_frame_new();
pref = purple_plugin_pref_new_with_name(PREF_LENGTH);
- purple_plugin_pref_set_label(pref, _("Only create TinyURL for urls"
+ purple_plugin_pref_set_label(pref, _("Only create TinyURL for URLs"
" of this length or greater"));
purple_plugin_pref_frame_add(frame, pref);
pref = purple_plugin_pref_new_with_name(PREF_URL);
@@ -390,7 +390,7 @@
N_("TinyURL"),
DISPLAY_VERSION,
N_("TinyURL plugin"),
- N_("When receiving a message with URL(s), TinyURL for easier copying"),
+ N_("When receiving a message with URL(s), use TinyURL for easier copying"),
"Richard Nelson ",
PURPLE_WEBSITE,
plugin_load,
diff -r 3443ed867ce3 -r 1ca2df744414 finch/plugins/grouping.c
--- a/finch/plugins/grouping.c Tue Aug 25 15:40:06 2009 +0000
+++ b/finch/plugins/grouping.c Tue Aug 25 17:01:49 2009 +0000
@@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define PURPLE_PLUGIN
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/account.c
--- a/libpurple/account.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/account.c Tue Aug 25 17:01:49 2009 +0000
@@ -1206,11 +1206,14 @@
purple_account_disconnect(PurpleAccount *account)
{
PurpleConnection *gc;
+ const char *username;
g_return_if_fail(account != NULL);
g_return_if_fail(!purple_account_is_disconnected(account));
- purple_debug_info("account", "Disconnecting account %p\n", account);
+ username = purple_account_get_username(account);
+ purple_debug_info("account", "Disconnecting account %s (%p)\n",
+ username ? username : "(null)", account);
account->disconnecting = TRUE;
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/certificate.c
--- a/libpurple/certificate.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/certificate.c Tue Aug 25 17:01:49 2009 +0000
@@ -43,6 +43,91 @@
/** List of registered Pools */
static GList *cert_pools = NULL;
+/*
+ * TODO: Merge this with PurpleCertificateVerificationStatus for 3.0.0 */
+typedef enum {
+ PURPLE_CERTIFICATE_UNKNOWN_ERROR = -1,
+
+ /* Not an error */
+ PURPLE_CERTIFICATE_NO_PROBLEMS = 0,
+
+ /* Non-fatal */
+ PURPLE_CERTIFICATE_NON_FATALS_MASK = 0x0000FFFF,
+
+ /* The certificate is self-signed. */
+ PURPLE_CERTIFICATE_SELF_SIGNED = 0x01,
+
+ /* The CA is not in libpurple's pool of certificates. */
+ PURPLE_CERTIFICATE_CA_UNKNOWN = 0x02,
+
+ /* The current time is before the certificate's specified
+ * activation time.
+ */
+ PURPLE_CERTIFICATE_NOT_ACTIVATED = 0x04,
+
+ /* The current time is after the certificate's specified expiration time */
+ PURPLE_CERTIFICATE_EXPIRED = 0x08,
+
+ /* The certificate's subject name doesn't match the expected */
+ PURPLE_CERTIFICATE_NAME_MISMATCH = 0x10,
+
+ /* No CA pool was found. This shouldn't happen... */
+ PURPLE_CERTIFICATE_NO_CA_POOL = 0x20,
+
+ /* Fatal */
+ PURPLE_CERTIFICATE_FATALS_MASK = 0xFFFF0000,
+
+ /* The signature chain could not be validated. Due to limitations in the
+ * the current API, this also indicates one of the CA certificates in the
+ * chain is expired (or not yet activated). FIXME 3.0.0 */
+ PURPLE_CERTIFICATE_INVALID_CHAIN = 0x10000,
+
+ /* The signature has been revoked. */
+ PURPLE_CERTIFICATE_REVOKED = 0x20000,
+
+ PURPLE_CERTIFICATE_LAST = 0x40000,
+} PurpleCertificateInvalidityFlags;
+
+static const gchar *
+invalidity_reason_to_string(PurpleCertificateInvalidityFlags flag)
+{
+ switch (flag) {
+ case PURPLE_CERTIFICATE_SELF_SIGNED:
+ return _("The certificate is self-signed and cannot be "
+ "automatically checked.");
+ break;
+ case PURPLE_CERTIFICATE_CA_UNKNOWN:
+ return _("The root certificate this one claims to be issued by is "
+ "unknown to Pidgin.");
+ break;
+ case PURPLE_CERTIFICATE_NOT_ACTIVATED:
+ return _("The certificate is not valid yet.");
+ break;
+ case PURPLE_CERTIFICATE_EXPIRED:
+ return _("The certificate has expired and should not be "
+ "considered valid.");
+ break;
+ case PURPLE_CERTIFICATE_NAME_MISMATCH:
+ /* Translators: "domain" refers to a DNS domain (e.g. talk.google.com) */
+ return _("The certificate presented is not issued to this domain.");
+ break;
+ case PURPLE_CERTIFICATE_NO_CA_POOL:
+ return _("You have no database of root certificates, so "
+ "this certificate cannot be validated.");
+ break;
+ case PURPLE_CERTIFICATE_INVALID_CHAIN:
+ return _("The certificate chain presented is invalid.");
+ break;
+ case PURPLE_CERTIFICATE_REVOKED:
+ return _("The certificate has been revoked.");
+ break;
+ case PURPLE_CERTIFICATE_UNKNOWN_ERROR:
+ default:
+ return _("An unknown certificate error occurred.");
+ break;
+ }
+}
+
void
purple_certificate_verify (PurpleCertificateVerifier *verifier,
const gchar *subject_name, GList *cert_chain,
@@ -1265,10 +1350,104 @@
}
static void
-x509_tls_cached_unknown_peer(PurpleCertificateVerificationRequest *vrq);
+x509_tls_cached_unknown_peer(PurpleCertificateVerificationRequest *vrq,
+ PurpleCertificateInvalidityFlags flags);
static void
-x509_tls_cached_cert_in_cache(PurpleCertificateVerificationRequest *vrq)
+x509_tls_cached_complete(PurpleCertificateVerificationRequest *vrq,
+ PurpleCertificateInvalidityFlags flags)
+{
+ PurpleCertificatePool *tls_peers;
+ PurpleCertificate *peer_crt = vrq->cert_chain->data;
+
+ if (flags & PURPLE_CERTIFICATE_FATALS_MASK) {
+ /* TODO: Also print any other warnings? */
+ const gchar *error;
+ gchar *tmp, *secondary;
+
+ if (flags & PURPLE_CERTIFICATE_INVALID_CHAIN)
+ error = invalidity_reason_to_string(PURPLE_CERTIFICATE_INVALID_CHAIN);
+ else if (flags & PURPLE_CERTIFICATE_REVOKED)
+ error = invalidity_reason_to_string(PURPLE_CERTIFICATE_REVOKED);
+ else
+ error = invalidity_reason_to_string(PURPLE_CERTIFICATE_UNKNOWN_ERROR);
+
+ tmp = g_strdup_printf(_("The certificate for %s could not be validated."),
+ vrq->subject_name);
+ secondary = g_strconcat(tmp, " ", error, NULL);
+ g_free(tmp);
+
+ purple_notify_error(NULL, /* TODO: Probably wrong. */
+ _("SSL Certificate Error"),
+ _("Unable to validate certificate"),
+ secondary);
+ g_free(secondary);
+
+ purple_certificate_verify_complete(vrq, PURPLE_CERTIFICATE_INVALID);
+ return;
+ } else if (flags & PURPLE_CERTIFICATE_NON_FATALS_MASK) {
+ /* Non-fatal error. Prompt the user. */
+ gchar *tmp;
+ GString *errors;
+ guint32 i = 1;
+
+ tmp = g_strdup_printf(_("The certificate for %s could not be validated."),
+ vrq->subject_name);
+ errors = g_string_new(tmp);
+ g_free(tmp);
+
+ errors = g_string_append_c(errors, '\n');
+
+ /* Special case a name mismatch because we want to display the two names... */
+ if (flags & PURPLE_CERTIFICATE_NAME_MISMATCH) {
+ gchar *sn = purple_certificate_get_subject_name(peer_crt);
+
+ g_string_append_printf(errors, _("The certificate claims to be "
+ "from \"%s\" instead. This could mean that you are "
+ "not connecting to the service you believe you are."),
+ sn);
+ g_free(sn);
+
+ flags &= ~PURPLE_CERTIFICATE_NAME_MISMATCH;
+ }
+
+ while (i != PURPLE_CERTIFICATE_LAST) {
+ if (flags & i) {
+ errors = g_string_append_c(errors, '\n');
+ g_string_append(errors, invalidity_reason_to_string(i));
+ }
+
+ i <<= 1;
+ }
+
+ x509_tls_cached_user_auth(vrq, errors->str);
+ g_string_free(errors, TRUE);
+ return;
+ }
+
+ /* If we reach this point, the certificate is good. */
+
+ /* Look up the local cache and store it there for future use */
+ tls_peers = purple_certificate_find_pool(x509_tls_cached.scheme_name,
+ "tls_peers");
+ if (tls_peers) {
+ if (!purple_certificate_pool_contains(tls_peers, vrq->subject_name) &&
+ !purple_certificate_pool_store(tls_peers,vrq->subject_name,
+ peer_crt)) {
+ purple_debug_error("certificate/x509/tls_cached",
+ "FAILED to cache peer certificate\n");
+ }
+ } else {
+ purple_debug_error("certificate/x509/tls_cached",
+ "Unable to locate tls_peers certificate cache.\n");
+ }
+
+ purple_certificate_verify_complete(vrq, PURPLE_CERTIFICATE_VALID);
+}
+
+static void
+x509_tls_cached_cert_in_cache(PurpleCertificateVerificationRequest *vrq,
+ PurpleCertificateInvalidityFlags flags)
{
/* TODO: Looking this up by name over and over is expensive.
Fix, please! */
@@ -1291,7 +1470,7 @@
"Lookup failed on cached certificate!\n"
"Falling back to full verification.\n");
/* vrq now becomes the problem of unknown_peer */
- x509_tls_cached_unknown_peer(vrq);
+ x509_tls_cached_unknown_peer(vrq, flags);
return;
}
@@ -1302,14 +1481,12 @@
if (!memcmp(peer_fpr->data, cached_fpr->data, peer_fpr->len)) {
purple_debug_info("certificate/x509/tls_cached",
"Peer cert matched cached\n");
- /* vrq is now finished */
- purple_certificate_verify_complete(vrq,
- PURPLE_CERTIFICATE_VALID);
+ x509_tls_cached_complete(vrq, flags);
} else {
purple_debug_error("certificate/x509/tls_cached",
"Peer cert did NOT match cached\n");
/* vrq now becomes the problem of the user */
- x509_tls_cached_unknown_peer(vrq);
+ x509_tls_cached_unknown_peer(vrq, flags);
}
purple_certificate_destroy(cached_crt);
@@ -1324,9 +1501,8 @@
*/
static void
x509_tls_cached_check_subject_name(PurpleCertificateVerificationRequest *vrq,
- gboolean had_ca_pool)
+ PurpleCertificateInvalidityFlags flags)
{
- PurpleCertificatePool *tls_peers;
PurpleCertificate *peer_crt;
GList *chain = vrq->cert_chain;
@@ -1337,77 +1513,14 @@
vrq->subject_name) ) {
gchar *sn = purple_certificate_get_subject_name(peer_crt);
+ flags |= PURPLE_CERTIFICATE_NAME_MISMATCH;
purple_debug_error("certificate/x509/tls_cached",
"Name mismatch: Certificate given for %s "
"has a name of %s\n",
vrq->subject_name, sn);
-
- if (had_ca_pool) {
- /* Prompt the user to authenticate the certificate */
- /* TODO: Provide the user with more guidance about why he is
- being prompted */
- /* vrq will be completed by user_auth */
- gchar *msg;
- msg = g_strdup_printf(_("The certificate presented by \"%s\" "
- "claims to be from \"%s\" instead. "
- "This could mean that you are not "
- "connecting to the service you "
- "believe you are."),
- vrq->subject_name, sn);
-
- x509_tls_cached_user_auth(vrq, msg);
- g_free(msg);
- } else {
- /* Had no CA pool, so couldn't verify the chain *and*
- * the subject name isn't valid.
- * I think this is bad enough to warrant a fatal error. It's
- * not likely anyway...
- */
- purple_notify_error(NULL, /* TODO: Probably wrong. */
- _("SSL Certificate Error"),
- _("Invalid certificate chain"),
- _("You have no database of root certificates, so "
- "this certificate cannot be validated."));
- }
-
- g_free(sn);
- return;
- } /* if (name mismatch) */
-
- if (!had_ca_pool) {
- /* The subject name is correct, but we weren't able to verify the
- * chain because there was no pool of root CAs found. Prompt the user
- * to validate it.
- */
-
- /* vrq will be completed by user_auth */
- x509_tls_cached_user_auth(vrq,_("You have no database of root "
- "certificates, so this "
- "certificate cannot be "
- "validated."));
- return;
}
- /* If we reach this point, the certificate is good. */
- /* Look up the local cache and store it there for future use */
- tls_peers = purple_certificate_find_pool(x509_tls_cached.scheme_name,
- "tls_peers");
-
- if (tls_peers) {
- if (!purple_certificate_pool_store(tls_peers,vrq->subject_name,
- peer_crt) ) {
- purple_debug_error("certificate/x509/tls_cached",
- "FAILED to cache peer certificate\n");
- }
- } else {
- purple_debug_error("certificate/x509/tls_cached",
- "Unable to locate tls_peers certificate "
- "cache.\n");
- }
-
- /* Whew! Done! */
- purple_certificate_verify_complete(vrq, PURPLE_CERTIFICATE_VALID);
-
+ x509_tls_cached_complete(vrq, flags);
}
/* For when we've never communicated with this party before */
@@ -1415,7 +1528,8 @@
least reprioritize them.
*/
static void
-x509_tls_cached_unknown_peer(PurpleCertificateVerificationRequest *vrq)
+x509_tls_cached_unknown_peer(PurpleCertificateVerificationRequest *vrq,
+ PurpleCertificateInvalidityFlags flags)
{
PurpleCertificatePool *ca;
PurpleCertificate *peer_crt;
@@ -1430,22 +1544,13 @@
/* TODO: Figure out a way to check for a bad signature, as opposed to
"not self-signed" */
if ( purple_certificate_signed_by(peer_crt, peer_crt) ) {
- gchar *msg;
+ flags |= PURPLE_CERTIFICATE_SELF_SIGNED;
purple_debug_info("certificate/x509/tls_cached",
"Certificate for %s is self-signed.\n",
vrq->subject_name);
- /* Prompt the user to authenticate the certificate */
- /* vrq will be completed by user_auth */
- msg = g_strdup_printf(_("The certificate presented by \"%s\" "
- "is self-signed. It cannot be "
- "automatically checked."),
- vrq->subject_name);
-
- x509_tls_cached_user_auth(vrq,msg);
-
- g_free(msg);
+ x509_tls_cached_check_subject_name(vrq, flags);
return;
} /* if (self signed) */
@@ -1491,32 +1596,11 @@
* If we get here, either the cert matched the stuff right above
* or it didn't, in which case we give up and complain to the user.
*/
- if (chain_validated) {
- x509_tls_cached_check_subject_name(vrq, TRUE);
- } else {
+ if (!chain_validated)
/* TODO: Tell the user where the chain broke? */
- /* TODO: This error will hopelessly confuse any
- non-elite user. */
- gchar *secondary;
-
- secondary = g_strdup_printf(_("The certificate chain presented"
- " for %s is not valid."),
- vrq->subject_name);
+ flags |= PURPLE_CERTIFICATE_INVALID_CHAIN;
- /* TODO: Make this error either block the ensuing SSL
- connection error until the user dismisses this one, or
- stifle it. */
- purple_notify_error(NULL, /* TODO: Probably wrong. */
- _("SSL Certificate Error"),
- _("Invalid certificate chain"),
- secondary );
- g_free(secondary);
-
- /* Okay, we're done here */
- purple_certificate_verify_complete(vrq,
- PURPLE_CERTIFICATE_INVALID);
- }
-
+ x509_tls_cached_check_subject_name(vrq, flags);
return;
} /* if (signature chain not good) */
@@ -1527,7 +1611,9 @@
"No X.509 Certificate Authority pool "
"could be found!\n");
- x509_tls_cached_check_subject_name(vrq, FALSE);
+ flags |= PURPLE_CERTIFICATE_NO_CA_POOL;
+
+ x509_tls_cached_check_subject_name(vrq, flags);
return;
}
@@ -1540,15 +1626,15 @@
ca_id);
ca_crt = purple_certificate_pool_retrieve(ca, ca_id);
if ( NULL == ca_crt ) {
+ flags |= PURPLE_CERTIFICATE_CA_UNKNOWN;
+
purple_debug_warning("certificate/x509/tls_cached",
"Certificate Authority with DN='%s' not "
"found. I'll prompt the user, I guess.\n",
ca_id);
g_free(ca_id);
- /* vrq will be completed by user_auth */
- x509_tls_cached_user_auth(vrq,_("The root certificate this "
- "one claims to be issued by "
- "is unknown to Pidgin."));
+
+ x509_tls_cached_check_subject_name(vrq, flags);
return;
}
@@ -1579,36 +1665,15 @@
/* TODO: Also mention the CA involved. While I could do this
now, a full DN is a little much with which to assault the
user's poor, leaky eyes. */
- /* TODO: This error message makes my eyes cross, and I wrote it */
- gchar * secondary =
- g_strdup_printf(_("The certificate chain presented by "
- "%s does not have a valid digital "
- "signature from the Certificate "
- "Authority from which it claims to "
- "have a signature."),
- vrq->subject_name);
-
- purple_notify_error(NULL, /* TODO: Probably wrong */
- _("SSL Certificate Error"),
- _("Invalid certificate authority"
- " signature"),
- secondary);
- g_free(secondary);
-
- /* Signal "bad cert" */
- purple_certificate_verify_complete(vrq,
- PURPLE_CERTIFICATE_INVALID);
-
- purple_certificate_destroy(ca_crt);
- g_byte_array_free(ca_fpr, TRUE);
- g_byte_array_free(last_fpr, TRUE);
- return;
- } /* if (CA signature not good) */
+ flags |= PURPLE_CERTIFICATE_INVALID_CHAIN;
+ }
g_byte_array_free(ca_fpr, TRUE);
g_byte_array_free(last_fpr, TRUE);
- x509_tls_cached_check_subject_name(vrq, TRUE);
+ purple_certificate_destroy(ca_crt);
+
+ x509_tls_cached_check_subject_name(vrq, flags);
}
static void
@@ -1617,6 +1682,7 @@
const gchar *tls_peers_name = "tls_peers"; /* Name of local cache */
PurpleCertificatePool *tls_peers;
time_t now, activation, expiration;
+ PurpleCertificateInvalidityFlags flags = PURPLE_CERTIFICATE_NO_PROBLEMS;
gboolean ret;
g_return_if_fail(vrq);
@@ -1632,37 +1698,21 @@
now = time(NULL);
ret = purple_certificate_get_times(vrq->cert_chain->data, &activation,
&expiration);
- if (!ret || now > expiration || now < activation) {
- gchar *secondary;
-
- if (!ret)
- purple_debug_error("certificate/x509/tls_cached",
- "Failed to get validity times for certificate %s\n",
- vrq->subject_name);
- else if (now > expiration)
- purple_debug_error("certificate/x509/tls_cached",
- "Certificate %s expired at %s\n",
- vrq->subject_name, ctime(&expiration));
- else
- purple_debug_error("certificate/x509/tls_cached",
- "Certificate %s is not yet valid, will be at %s\n",
- vrq->subject_name, ctime(&activation));
-
- /* FIXME 2.6.1 */
- secondary = g_strdup_printf(_("The certificate chain presented"
- " for %s is not valid."),
- vrq->subject_name);
-
- purple_notify_error(NULL, /* TODO: Probably wrong. */
- _("SSL Certificate Error"),
- _("Invalid certificate chain"),
- secondary );
- g_free(secondary);
-
- /* Okay, we're done here */
- purple_certificate_verify_complete(vrq,
- PURPLE_CERTIFICATE_INVALID);
- return;
+ if (!ret) {
+ flags |= PURPLE_CERTIFICATE_EXPIRED | PURPLE_CERTIFICATE_NOT_ACTIVATED;
+ purple_debug_error("certificate/x509/tls_cached",
+ "Failed to get validity times for certificate %s\n",
+ vrq->subject_name);
+ } else if (now > expiration) {
+ flags |= PURPLE_CERTIFICATE_EXPIRED;
+ purple_debug_error("certificate/x509/tls_cached",
+ "Certificate %s expired at %s\n",
+ vrq->subject_name, ctime(&expiration));
+ } else if (now < activation) {
+ flags |= PURPLE_CERTIFICATE_NOT_ACTIVATED;
+ purple_debug_error("certificate/x509/tls_cached",
+ "Certificate %s is not yet valid, will be at %s\n",
+ vrq->subject_name, ctime(&activation));
}
tls_peers = purple_certificate_find_pool(x509_tls_cached.scheme_name,tls_peers_name);
@@ -1672,9 +1722,8 @@
"Couldn't find local peers cache %s\n",
tls_peers_name);
-
/* vrq now becomes the problem of unknown_peer */
- x509_tls_cached_unknown_peer(vrq);
+ x509_tls_cached_unknown_peer(vrq, flags);
return;
}
@@ -1685,12 +1734,12 @@
purple_debug_info("certificate/x509/tls_cached",
"...Found cached cert\n");
/* vrq is now the responsibility of cert_in_cache */
- x509_tls_cached_cert_in_cache(vrq);
+ x509_tls_cached_cert_in_cache(vrq, flags);
} else {
purple_debug_warning("certificate/x509/tls_cached",
"...Not in cache\n");
/* vrq now becomes the problem of unknown_peer */
- x509_tls_cached_unknown_peer(vrq);
+ x509_tls_cached_unknown_peer(vrq, flags);
}
}
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/dbus-analyze-functions.py
--- a/libpurple/dbus-analyze-functions.py Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/dbus-analyze-functions.py Tue Aug 25 17:01:49 2009 +0000
@@ -181,15 +181,20 @@
def processoutput(self, type, name):
+ const = False
+ unsigned = False
# the "void" type is simple ...
if type == ["void"]:
return self.outputvoid(type, name)
- const = False
if type[0] == "const":
type = type[1:]
const = True
+ if type[0] == "unsigned":
+ type = type[1:]
+ unsigned = True
+
# a string
if type == ["char", pointer] or type == ["gchar", pointer]:
return self.outputstring(type, name, const)
@@ -197,7 +202,7 @@
# simple types (ints, booleans, enums, ...)
if (len(type) == 1) and \
((type[0] in simpletypes) or (type[0].startswith("Purple"))):
- return self.outputsimple(type, name)
+ return self.outputsimple(type, name, unsigned)
# pointers ...
if (len(type) == 2) and (type[1] == pointer):
@@ -303,10 +308,13 @@
# self.returncode.append("NULLIFY(%s);" % name)
self.returncode.append("return %s;" % name);
- def outputsimple(self, type, name):
+ def outputsimple(self, type, name, us):
self.functiontype = type[0]
self.decls.append("%s %s = 0;" % (type[0], name))
- self.outputparams.append(("G_TYPE_INT", name))
+ if us:
+ self.outputparams.append(("G_TYPE_UINT", name))
+ else:
+ self.outputparams.append(("G_TYPE_INT", name))
self.returncode.append("return %s;" % name);
# we could add "const" to the return type but this would probably
@@ -455,11 +463,16 @@
if not const:
self.ccodeout.append("\tg_free(%s);" % name)
- def outputsimple(self, type, name):
- self.cdecls.append("\tdbus_int32_t %s;" % name)
+ def outputsimple(self, type, name, us):
+ if us:
+ self.cdecls.append("\tdbus_uint32_t %s;" % name)
+ self.cparamsout.append(("UINT32", name))
+ self.addouttype("u", name)
+ else:
+ self.cdecls.append("\tdbus_int32_t %s;" % name)
+ self.cparamsout.append(("INT32", name))
+ self.addouttype("i", name)
self.ccode.append("\t%s = %s;" % (name, self.call))
- self.cparamsout.append(("INT32", name))
- self.addouttype("i", name)
def outputpurplestructure(self, type, name):
self.cdecls.append("\tdbus_int32_t %s;" % name)
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/dnssrv.c
--- a/libpurple/dnssrv.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/dnssrv.c Tue Aug 25 17:01:49 2009 +0000
@@ -465,9 +465,16 @@
{
PurpleSrvResponse *srvres = NULL;
PurpleSrvQueryData *query_data = data;
- if(query_data->error_message != NULL)
+ if(query_data->error_message != NULL) {
purple_debug_error("dnssrv", query_data->error_message);
- else {
+ if (query_data->type == DNS_TYPE_SRV) {
+ if (query_data->cb.srv)
+ query_data->cb.srv(srvres, 0, query_data->extradata);
+ } else if (query_data->type == DNS_TYPE_TXT) {
+ if (query_data->cb.txt)
+ query_data->cb.txt(NULL, query_data->extradata);
+ }
+ } else {
if (query_data->type == DNS_TYPE_SRV) {
PurpleSrvResponse *srvres_tmp = NULL;
GList *lst = query_data->results;
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/ft.c
--- a/libpurple/ft.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/ft.c Tue Aug 25 17:01:49 2009 +0000
@@ -1313,7 +1313,7 @@
if (purple_xfer_get_filename(xfer) != NULL)
{
- msg = g_strdup_printf(_("You canceled the transfer of %s"),
+ msg = g_strdup_printf(_("You cancelled the transfer of %s"),
purple_xfer_get_filename(xfer));
}
else
@@ -1376,12 +1376,12 @@
if (purple_xfer_get_filename(xfer) != NULL)
{
- msg = g_strdup_printf(_("%s canceled the transfer of %s"),
+ msg = g_strdup_printf(_("%s cancelled the transfer of %s"),
buddy ? purple_buddy_get_alias(buddy) : xfer->who, purple_xfer_get_filename(xfer));
}
else
{
- msg = g_strdup_printf(_("%s canceled the file transfer"),
+ msg = g_strdup_printf(_("%s cancelled the file transfer"),
buddy ? purple_buddy_get_alias(buddy) : xfer->who);
}
purple_xfer_conversation_write(xfer, msg, TRUE);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/idle.h
--- a/libpurple/idle.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/idle.h Tue Aug 25 17:01:49 2009 +0000
@@ -26,6 +26,8 @@
#ifndef _PURPLE_IDLE_H_
#define _PURPLE_IDLE_H_
+#include
+
/**
* Idle UI operations.
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/media-gst.h
--- a/libpurple/media-gst.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/media-gst.h Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_MEDIA_GST_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/media.c
--- a/libpurple/media.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/media.c Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include
@@ -2129,6 +2129,35 @@
}
break;
}
+ case GST_MESSAGE_ERROR: {
+ GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg));
+ GstElement *lastElement = NULL;
+ while (!GST_IS_PIPELINE(element)) {
+ if (element == media->priv->confbin) {
+ purple_media_error(media, _("Conference error."));
+ purple_media_end(media, NULL, NULL);
+ break;
+ }
+ lastElement = element;
+ element = GST_ELEMENT_PARENT(element);
+ }
+ if (GST_IS_PIPELINE(element)) {
+ GList *sessions = g_hash_table_get_values(media->priv->sessions);
+ for (; sessions; sessions = g_list_delete_link(sessions, sessions)) {
+ PurpleMediaSession *session = sessions->data;
+
+ if (session->src == lastElement) {
+ if (session->type & PURPLE_MEDIA_AUDIO)
+ purple_media_error(media, _("Error with your microphone."));
+ else
+ purple_media_error(media, _("Error with your webcam."));
+ purple_media_end(media, NULL, NULL);
+ break;
+ }
+ }
+ g_list_free(sessions);
+ }
+ }
default:
break;
}
@@ -2730,10 +2759,13 @@
num_params, params, &err);
}
- if (err) {
- purple_debug_error("media", "Error creating stream: %s\n",
- err->message);
- g_error_free(err);
+ if (fsstream == NULL) {
+ purple_debug_error("media",
+ "Error creating stream: %s\n",
+ err && err->message ?
+ err->message : "NULL");
+ if (err)
+ g_error_free(err);
g_object_unref(participant);
g_hash_table_remove(media->priv->participants, who);
purple_media_remove_session(media, session);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/media.h
--- a/libpurple/media.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/media.h Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_MEDIA_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/mediamanager.c
--- a/libpurple/mediamanager.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/mediamanager.c Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include "internal.h"
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/mediamanager.h
--- a/libpurple/mediamanager.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/mediamanager.h Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PURPLE_MEDIA_MANAGER_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/plugin.c
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/plugins/joinpart.c
--- a/libpurple/plugins/joinpart.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/plugins/joinpart.c Tue Aug 25 17:01:49 2009 +0000
@@ -229,16 +229,17 @@
frame = purple_plugin_pref_frame_new();
- ppref = purple_plugin_pref_new_with_label(_("Join/Part Hiding Configuration"));
+ ppref = purple_plugin_pref_new_with_label(_("Hide Joins/Parts"));
purple_plugin_pref_frame_add(frame, ppref);
ppref = purple_plugin_pref_new_with_name_and_label(THRESHOLD_PREF,
- _("Minimum Room Size"));
+ /* Translators: Followed by an input request a number of people */
+ _("For rooms with more than this many people"));
purple_plugin_pref_set_bounds(ppref, 0, 1000);
purple_plugin_pref_frame_add(frame, ppref);
ppref = purple_plugin_pref_new_with_name_and_label(DELAY_PREF,
- _("User Inactivity Timeout (in minutes)"));
+ _("If user has not spoken in this many minutes"));
purple_plugin_pref_set_bounds(ppref, 0, 8 * 60); /* 8 Hours */
purple_plugin_pref_frame_add(frame, ppref);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/plugins/perl/common/XMLNode.xs
--- a/libpurple/plugins/perl/common/XMLNode.xs Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/plugins/perl/common/XMLNode.xs Tue Aug 25 17:01:49 2009 +0000
@@ -4,21 +4,24 @@
PROTOTYPES: ENABLE
Purple::XMLNode
-xmlnode_copy(class, src)
+xmlnode_copy(src)
Purple::XMLNode src
- C_ARGS:
- src
void
xmlnode_free(node)
Purple::XMLNode node
Purple::XMLNode
-xmlnode_from_str(class, str, size)
- const char *str
- gssize size
- C_ARGS:
- str, size
+xmlnode_from_str(const char *str, gssize length(str))
+ PROTOTYPE: $
+
+const char *
+xmlnode_get_name(node)
+ Purple::XMLNode node
+ CODE:
+ RETVAL = node->name;
+ OUTPUT:
+ RETVAL
const char *
xmlnode_get_attrib(node, attr)
@@ -78,11 +81,17 @@
const char *value
gchar_own *
-xmlnode_to_formatted_str(node, len)
+xmlnode_to_formatted_str(node)
Purple::XMLNode node
- int *len
+ CODE:
+ RETVAL = xmlnode_to_formatted_str(node, NULL);
+ OUTPUT:
+ RETVAL
gchar_own *
-xmlnode_to_str(node, len)
+xmlnode_to_str(node)
Purple::XMLNode node
- int *len
+ CODE:
+ RETVAL = xmlnode_to_str(node, NULL);
+ OUTPUT:
+ RETVAL
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/bonjour/bonjour_ft.c
--- a/libpurple/protocols/bonjour/bonjour_ft.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Tue Aug 25 17:01:49 2009 +0000
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "internal.h"
#include "util.h"
@@ -450,9 +450,11 @@
/* TODO: Make sure that it is advertising a bytestreams transfer */
- bonjour_xfer_receive(pc, id, sid, name, filesize, filename, XEP_BYTESTREAMS);
+ if (filename) {
+ bonjour_xfer_receive(pc, id, sid, name, filesize, filename, XEP_BYTESTREAMS);
- parsed_receive = TRUE;
+ parsed_receive = TRUE;
+ }
}
if (!parsed_receive) {
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/bonjour/bonjour_ft.h
--- a/libpurple/protocols/bonjour/bonjour_ft.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/bonjour/bonjour_ft.h Tue Aug 25 17:01:49 2009 +0000
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _BONJOUR_FT_H_
#define _BONJOUR_FT_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/adhoccommands.c
--- a/libpurple/protocols/jabber/adhoccommands.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/adhoccommands.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/adhoccommands.h
--- a/libpurple/protocols/jabber/adhoccommands.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/adhoccommands.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/auth.c
--- a/libpurple/protocols/jabber/auth.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/auth.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -573,6 +575,7 @@
xmlnode *packet, gpointer data)
{
if (type == JABBER_IQ_RESULT) {
+ jabber_stream_set_state(js, JABBER_STREAM_POST_AUTH);
jabber_disco_items_server(js);
} else {
PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
@@ -1070,7 +1073,12 @@
}
#endif
- jabber_stream_set_state(js, JABBER_STREAM_REINITIALIZING);
+ /*
+ * The stream will be reinitialized later in jabber_recv_cb_ssl() or
+ * jabber_bosh_connection_send.
+ */
+ js->reinit = TRUE;
+ jabber_stream_set_state(js, JABBER_STREAM_POST_AUTH);
}
void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet)
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/auth.h
--- a/libpurple/protocols/jabber/auth.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/auth.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/bosh.c
--- a/libpurple/protocols/jabber/bosh.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2008, Tobias Markmann
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,7 +70,6 @@
gboolean pipelining;
gboolean ssl;
- gboolean needs_restart;
enum {
BOSH_CONN_OFFLINE,
@@ -195,7 +196,6 @@
conn->path = g_strdup_printf("/%s", path);
g_free(path);
conn->pipelining = TRUE;
- conn->needs_restart = FALSE;
if ((user && user[0] != '\0') || (passwd && passwd[0] != '\0')) {
purple_debug_info("jabber", "Ignoring unexpected username and password "
@@ -375,10 +375,10 @@
conn->sid,
conn->js->user->domain);
- if (conn->needs_restart) {
+ if (conn->js->reinit) {
packet = g_string_append(packet, " xmpp:restart='true'/>");
/* TODO: Do we need to wait for a response? */
- conn->needs_restart = FALSE;
+ conn->js->reinit = FALSE;
} else {
gsize read_amt;
if (type == PACKET_TERMINATE)
@@ -404,12 +404,6 @@
jabber_bosh_connection_send(conn, PACKET_TERMINATE, NULL);
}
-static void jabber_bosh_connection_stream_restart(PurpleBOSHConnection *conn)
-{
- conn->needs_restart = TRUE;
- jabber_bosh_connection_send(conn, PACKET_NORMAL, NULL);
-}
-
static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node) {
const char *type;
@@ -488,35 +482,8 @@
}
}
-static void auth_response_cb(PurpleBOSHConnection *conn, xmlnode *node) {
- xmlnode *child;
-
- g_return_if_fail(node != NULL);
- if (jabber_bosh_connection_error_check(conn, node))
- return;
-
- child = node->child;
- while(child != NULL && child->type != XMLNODE_TYPE_TAG) {
- child = child->next;
- }
-
- /* We're only expecting one XML node here, so only process the first one */
- if (child != NULL && child->type == XMLNODE_TYPE_TAG) {
- JabberStream *js = conn->js;
- if (!strcmp(child->name, "success")) {
- jabber_bosh_connection_stream_restart(conn);
- jabber_process_packet(js, &child);
- conn->receive_cb = jabber_bosh_connection_received;
- } else {
- js->state = JABBER_STREAM_AUTHENTICATING;
- jabber_process_packet(js, &child);
- }
- } else {
- purple_debug_warning("jabber", "Received unexepcted empty BOSH packet.\n");
- }
-}
-
static void boot_response_cb(PurpleBOSHConnection *conn, xmlnode *node) {
+ JabberStream *js = conn->js;
const char *sid, *version;
const char *inactivity, *requests;
xmlnode *packet;
@@ -534,7 +501,7 @@
if (sid) {
conn->sid = g_strdup(sid);
} else {
- purple_connection_error_reason(conn->js->gc,
+ purple_connection_error_reason(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("No session ID given"));
return;
@@ -551,7 +518,7 @@
minor = atoi(dot + 1);
if (major != 1 || minor < 6) {
- purple_connection_error_reason(conn->js->gc,
+ purple_connection_error_reason(js->gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unsupported version of BOSH protocol"));
return;
@@ -581,11 +548,13 @@
if (requests)
conn->max_requests = atoi(requests);
+ jabber_stream_set_state(js, JABBER_STREAM_AUTHENTICATING);
+
/* FIXME: Depending on receiving features might break with some hosts */
packet = xmlnode_get_child(node, "features");
conn->state = BOSH_CONN_ONLINE;
- conn->receive_cb = auth_response_cb;
- jabber_stream_features_parse(conn->js, packet);
+ conn->receive_cb = jabber_bosh_connection_received;
+ jabber_stream_features_parse(js, packet);
}
static void jabber_bosh_connection_boot(PurpleBOSHConnection *conn) {
@@ -661,8 +630,8 @@
conn->headers_done = FALSE;
conn->handled_len = conn->body_len = 0;
- if (conn->bosh->needs_restart)
- jabber_bosh_connection_stream_restart(conn->bosh);
+ if (conn->bosh->js->reinit)
+ jabber_bosh_connection_send(conn->bosh, PACKET_NORMAL, NULL);
else if (conn->bosh->state == BOSH_CONN_ONLINE) {
purple_debug_info("jabber", "BOSH session already exists. Trying to reuse it.\n");
if (conn->bosh->requests == 0 || conn->bosh->pending->bufused > 0) {
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/bosh.h
--- a/libpurple/protocols/jabber/bosh.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2008, Tobias Markmann
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/buddy.c
--- a/libpurple/protocols/jabber/buddy.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -749,7 +751,9 @@
const char *status_name = jabber_buddy_state_get_name(jbr->state);
if (jbr->status) {
- purdy = purple_strdup_withhtml(jbr->status);
+ tmp = purple_markup_escape_text(jbr->status, -1);
+ purdy = purple_strdup_withhtml(tmp);
+ g_free(tmp);
if (purple_strequal(status_name, purdy))
status_name = NULL;
@@ -908,12 +912,14 @@
(binval = xmlnode_get_child(photo, "BINVAL"))) {
gsize size;
char *bintext = xmlnode_get_data(binval);
- guchar *data = purple_base64_decode(bintext, &size);
- g_free(bintext);
+ if (bintext) {
+ guchar *data = purple_base64_decode(bintext, &size);
+ g_free(bintext);
- if (data) {
- vcard_hash = jabber_calculate_data_sha1sum(data, size);
- g_free(data);
+ if (data) {
+ vcard_hash = jabber_calculate_data_sha1sum(data, size);
+ g_free(data);
+ }
}
}
@@ -1675,21 +1681,42 @@
jabber_buddy_set_invisibility(js, purple_buddy_get_name(buddy), FALSE);
}
-static void jabber_buddy_cancel_presence_notification(PurpleBlistNode *node,
- gpointer data)
+static void cancel_presence_notification(gpointer data)
{
PurpleBuddy *buddy;
PurpleConnection *gc;
JabberStream *js;
+ buddy = data;
+ gc = purple_account_get_connection(purple_buddy_get_account(buddy));
+ js = purple_connection_get_protocol_data(gc);
+
+ jabber_presence_subscription_set(js, purple_buddy_get_name(buddy), "unsubscribed");
+}
+
+static void
+jabber_buddy_cancel_presence_notification(PurpleBlistNode *node,
+ gpointer data)
+{
+ PurpleBuddy *buddy;
+ PurpleAccount *account;
+ PurpleConnection *gc;
+ const gchar *name;
+ char *msg;
+
g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
buddy = (PurpleBuddy *) node;
- gc = purple_account_get_connection(purple_buddy_get_account(buddy));
- js = purple_connection_get_protocol_data(gc);
+ name = purple_buddy_get_name(buddy);
+ account = purple_buddy_get_account(buddy);
+ gc = purple_account_get_connection(account);
- /* I wonder if we should prompt the user before doing this */
- jabber_presence_subscription_set(js, purple_buddy_get_name(buddy), "unsubscribed");
+ msg = g_strdup_printf(_("%s will no longer be able to see your status "
+ "updates. Do you want to continue?"), name);
+ purple_request_yes_no(gc, NULL, _("Cancel Presence Notification"),
+ msg, 0 /* Yes */, account, name, NULL, buddy,
+ cancel_presence_notification, NULL /* Do nothing */);
+ g_free(msg);
}
static void jabber_buddy_rerequest_auth(PurpleBlistNode *node, gpointer data)
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/buddy.h
--- a/libpurple/protocols/jabber/buddy.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/caps.c
--- a/libpurple/protocols/jabber/caps.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/caps.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
@@ -456,6 +458,11 @@
/* Only validate if these are v1.5 capabilities */
if (userdata->hash) {
gchar *hash = NULL;
+ /*
+ * TODO: If you add *any* hash here, make sure the checksum buffer
+ * size in jabber_caps_calculate_hash is large enough. The cipher API
+ * doesn't seem to offer a "Get the hash size" function(?).
+ */
if (!strcmp(userdata->hash, "sha-1")) {
hash = jabber_caps_calculate_hash(info, "sha1");
} else if (!strcmp(userdata->hash, "md5")) {
@@ -463,8 +470,10 @@
}
if (!hash || strcmp(hash, userdata->ver)) {
- purple_debug_warning("jabber", "Could not validate caps info from %s\n",
- xmlnode_get_attrib(packet, "from"));
+ purple_debug_warning("jabber", "Could not validate caps info from "
+ "%s. Expected %s, got %s\n",
+ xmlnode_get_attrib(packet, "from"),
+ userdata->ver, hash ? hash : "(null)");
userdata->cb(NULL, NULL, userdata->cb_data);
jabber_caps_client_info_destroy(info);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/caps.h
--- a/libpurple/protocols/jabber/caps.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/caps.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/chat.c
--- a/libpurple/protocols/jabber/chat.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/chat.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/chat.h
--- a/libpurple/protocols/jabber/chat.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/chat.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/data.c
--- a/libpurple/protocols/jabber/data.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/data.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,4 +1,8 @@
/*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -11,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/data.h
--- a/libpurple/protocols/jabber/data.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/data.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,4 +1,8 @@
/*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -11,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef PURPLE_JABBER_DATA_H
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/disco.c
--- a/libpurple/protocols/jabber/disco.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/disco.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Service Discovery
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -302,6 +304,8 @@
}
}
+ js->chat_servers = g_list_reverse(js->chat_servers);
+
capabilities |= JABBER_CAP_RETRIEVED;
if(jbr)
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/disco.h
--- a/libpurple/protocols/jabber/disco.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/disco.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/google.c
--- a/libpurple/protocols/jabber/google.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/google.c Tue Aug 25 17:01:49 2009 +0000
@@ -91,20 +91,6 @@
}
static void
-google_session_send_terminate(GoogleSession *session)
-{
- xmlnode *sess;
- JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET);
-
- xmlnode_set_attrib(iq->node, "to", session->remote_jid);
- sess = google_session_create_xmlnode(session, "terminate");
- xmlnode_insert_child(iq->node, sess);
-
- jabber_iq_send(iq);
- google_session_destroy(session);
-}
-
-static void
google_session_send_candidates(PurpleMedia *media, gchar *session_id,
gchar *participant, GoogleSession *session)
{
@@ -310,6 +296,9 @@
gchar *sid, gchar *name, gboolean local,
GoogleSession *session)
{
+ if (sid != NULL || name != NULL)
+ return;
+
if (type == PURPLE_MEDIA_INFO_HANGUP) {
xmlnode *sess;
JabberIq *iq = jabber_iq_new(session->js, JABBER_IQ_SET);
@@ -328,6 +317,8 @@
xmlnode_insert_child(iq->node, sess);
jabber_iq_send(iq);
+ } else if (type == PURPLE_MEDIA_INFO_ACCEPT && local == TRUE) {
+ google_session_ready(session);
}
}
@@ -398,6 +389,16 @@
purple_media_set_prpl_data(session->media, session);
+ g_signal_connect_swapped(G_OBJECT(session->media),
+ "candidates-prepared",
+ G_CALLBACK(google_session_ready), session);
+ g_signal_connect_swapped(G_OBJECT(session->media), "codecs-changed",
+ G_CALLBACK(google_session_ready), session);
+ g_signal_connect(G_OBJECT(session->media), "state-changed",
+ G_CALLBACK(google_session_state_changed_cb), session);
+ g_signal_connect(G_OBJECT(session->media), "stream-info",
+ G_CALLBACK(google_session_stream_info_cb), session);
+
params = jabber_google_session_get_params(js, &num_params);
if (purple_media_add_stream(session->media, "google-voice",
@@ -408,23 +409,11 @@
session->remote_jid, PURPLE_MEDIA_VIDEO,
TRUE, "nice", num_params, params) == FALSE)) {
purple_media_error(session->media, "Error adding stream.");
- purple_media_stream_info(session->media,
- PURPLE_MEDIA_INFO_HANGUP, NULL, NULL, TRUE);
- google_session_destroy(session);
+ purple_media_end(session->media, NULL, NULL);
g_free(params);
return FALSE;
}
- g_signal_connect_swapped(G_OBJECT(session->media),
- "candidates-prepared",
- G_CALLBACK(google_session_ready), session);
- g_signal_connect_swapped(G_OBJECT(session->media), "codecs-changed",
- G_CALLBACK(google_session_ready), session);
- g_signal_connect(G_OBJECT(session->media), "state-changed",
- G_CALLBACK(google_session_state_changed_cb), session);
- g_signal_connect(G_OBJECT(session->media), "stream-info",
- G_CALLBACK(google_session_stream_info_cb), session);
-
g_free(params);
return (session->media != NULL) ? TRUE : FALSE;
@@ -466,6 +455,16 @@
purple_media_set_prpl_data(session->media, session);
+ g_signal_connect_swapped(G_OBJECT(session->media),
+ "candidates-prepared",
+ G_CALLBACK(google_session_ready), session);
+ g_signal_connect_swapped(G_OBJECT(session->media), "codecs-changed",
+ G_CALLBACK(google_session_ready), session);
+ g_signal_connect(G_OBJECT(session->media), "state-changed",
+ G_CALLBACK(google_session_state_changed_cb), session);
+ g_signal_connect(G_OBJECT(session->media), "stream-info",
+ G_CALLBACK(google_session_stream_info_cb), session);
+
params = jabber_google_session_get_params(js, &num_params);
if (purple_media_add_stream(session->media, "google-voice",
@@ -477,8 +476,7 @@
FALSE, "nice", num_params, params) == FALSE)) {
purple_media_error(session->media, "Error adding stream.");
purple_media_stream_info(session->media,
- PURPLE_MEDIA_INFO_HANGUP, NULL, NULL, TRUE);
- google_session_send_terminate(session);
+ PURPLE_MEDIA_INFO_REJECT, NULL, NULL, TRUE);
g_free(params);
return FALSE;
}
@@ -535,18 +533,6 @@
purple_media_codec_list_free(codecs);
purple_media_codec_list_free(video_codecs);
- g_signal_connect_swapped(G_OBJECT(session->media), "accepted",
- G_CALLBACK(google_session_ready), session);
- g_signal_connect_swapped(G_OBJECT(session->media),
- "candidates-prepared",
- G_CALLBACK(google_session_ready), session);
- g_signal_connect_swapped(G_OBJECT(session->media), "codecs-changed",
- G_CALLBACK(google_session_ready), session);
- g_signal_connect(G_OBJECT(session->media), "state-changed",
- G_CALLBACK(google_session_state_changed_cb), session);
- g_signal_connect(G_OBJECT(session->media), "stream-info",
- G_CALLBACK(google_session_stream_info_cb), session);
-
result = jabber_iq_new(js, JABBER_IQ_RESULT);
jabber_iq_set_id(result, iq_id);
xmlnode_set_attrib(result->node, "to", session->remote_jid);
@@ -778,8 +764,7 @@
session->js = js;
session->remote_jid = g_strdup(session->id.initiator);
- if (!google_session_handle_initiate(js, session, session_node, iq_id))
- google_session_destroy(session);
+ google_session_handle_initiate(js, session, session_node, iq_id);
}
#endif /* USE_VV */
@@ -1316,6 +1301,7 @@
purple_debug_error("jabber", "Google STUN lookup failed: %s\n",
error_message);
g_slist_free(hosts);
+ js->stun_query = NULL;
return;
}
@@ -1334,18 +1320,16 @@
port = ntohs(((struct sockaddr_in *) addr)->sin_port);
}
- if (js) {
- if (js->stun_ip) {
- g_free(js->stun_ip);
- }
- js->stun_ip = g_strdup(dst);
- purple_debug_info("jabber", "set Google STUN IP address: %s\n", dst);
- js->stun_port = port;
- purple_debug_info("jabber", "set Google STUN port: %d\n", port);
- purple_debug_info("jabber", "set Google STUN port: %d\n", port);
- /* unmark ongoing query */
- js->stun_query = NULL;
- }
+ if (js->stun_ip)
+ g_free(js->stun_ip);
+ js->stun_ip = g_strdup(dst);
+ js->stun_port = port;
+
+ purple_debug_info("jabber", "set Google STUN IP/port address: "
+ "%s:%d\n", dst, port);
+
+ /* unmark ongoing query */
+ js->stun_query = NULL;
}
while (hosts != NULL) {
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/ibb.c
--- a/libpurple/protocols/jabber/ibb.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/ibb.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,4 +1,8 @@
/*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -11,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#include "internal.h"
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/ibb.h
--- a/libpurple/protocols/jabber/ibb.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/ibb.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,4 +1,8 @@
/*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -11,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef PURPLE_JABBER_IBB_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/iq.c
--- a/libpurple/protocols/jabber/iq.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/iq.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/iq.h
--- a/libpurple/protocols/jabber/iq.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/iq.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1603,13 +1605,10 @@
jabber_auth_start_old(js);
}
break;
- case JABBER_STREAM_REINITIALIZING:
+ case JABBER_STREAM_POST_AUTH:
purple_connection_update_progress(js->gc, _("Re-initializing Stream"),
(js->gsc ? 8 : 4), JABBER_CONNECT_STEPS);
- /* The stream will be reinitialized later, in jabber_recv_cb_ssl() */
- js->reinit = TRUE;
-
break;
case JABBER_STREAM_CONNECTED:
/* Send initial presence */
@@ -3302,7 +3301,7 @@
PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
jabber_cmd_chat_role,
- _("role <moderator|participant|visitor|none> [nick1] [nick2] ...: Get the users with an role or set users' role with the room."),
+ _("role <moderator|participant|visitor|none> [nick1] [nick2] ...: Get the users with a role or set users' role with the room."),
NULL);
jabber_cmds = g_slist_prepend(jabber_cmds, GUINT_TO_POINTER(id));
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jabber.h
--- a/libpurple/protocols/jabber/jabber.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -85,7 +87,7 @@
JABBER_STREAM_INITIALIZING,
JABBER_STREAM_INITIALIZING_ENCRYPTION,
JABBER_STREAM_AUTHENTICATING,
- JABBER_STREAM_REINITIALIZING,
+ JABBER_STREAM_POST_AUTH,
JABBER_STREAM_CONNECTED
} JabberStreamState;
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/content.c
--- a/libpurple/protocols/jabber/jingle/content.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/content.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/content.h
--- a/libpurple/protocols/jabber/jingle/content.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/content.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/iceudp.c
--- a/libpurple/protocols/jabber/jingle/iceudp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/iceudp.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/iceudp.h
--- a/libpurple/protocols/jabber/jingle/iceudp.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/iceudp.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/jingle.c
--- a/libpurple/protocols/jabber/jingle/jingle.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/jingle.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple - Jabber Protocol Plugin
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/jingle.h
--- a/libpurple/protocols/jabber/jingle/jingle.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/jingle.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,6 +1,10 @@
/*
* @file jingle.h
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/rawudp.c
--- a/libpurple/protocols/jabber/jingle/rawudp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rawudp.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/rawudp.h
--- a/libpurple/protocols/jabber/jingle/rawudp.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rawudp.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/rtp.c
--- a/libpurple/protocols/jabber/jingle/rtp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rtp.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -607,8 +611,11 @@
is_creator = !jingle_session_is_initiator(session);
g_free(creator);
- purple_media_add_stream(media, name, remote_jid,
- type, is_creator, transmitter, num_params, params);
+ if(!purple_media_add_stream(media, name, remote_jid,
+ type, is_creator, transmitter, num_params, params)) {
+ purple_media_end(media, NULL, NULL);
+ return FALSE;
+ }
g_free(name);
g_free(media_type);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/rtp.h
--- a/libpurple/protocols/jabber/jingle/rtp.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/rtp.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/session.c
--- a/libpurple/protocols/jabber/jingle/session.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/session.h
--- a/libpurple/protocols/jabber/jingle/session.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/transport.c
--- a/libpurple/protocols/jabber/jingle/transport.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/transport.c Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jingle/transport.h
--- a/libpurple/protocols/jabber/jingle/transport.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/transport.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,6 +3,10 @@
*
* purple
*
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jutil.c
--- a/libpurple/protocols/jabber/jutil.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jutil.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -504,8 +506,23 @@
JabberStream *js = gc ? gc->proto_data : NULL;
static char buf[3072]; /* maximum legal length of a jabber jid */
JabberID *jid;
+ char *tmp;
+ size_t len = strlen(in);
- jid = jabber_id_new(in);
+ /*
+ * If the JID ends with a '/', jabber_id_new is going to throw it away as
+ * invalid. However, this is what the UI generates for a JID with no
+ * resource. Deal with that by dropping away the '/'...
+ */
+ if (in[len - 1] == '/')
+ tmp = g_strndup(in, len - 1);
+ else
+ tmp = (gchar *)in;
+
+ jid = jabber_id_new(tmp);
+
+ if (tmp != in)
+ g_free(tmp);
if(!jid)
return NULL;
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/jutil.h
--- a/libpurple/protocols/jabber/jutil.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/jutil.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/message.c
--- a/libpurple/protocols/jabber/message.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/message.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -87,8 +89,12 @@
}
if(!jm->xhtml && !jm->body) {
- if (jbr)
- jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+ if (jbr) {
+ if (jm->chat_state != JM_STATE_NONE)
+ jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+ else
+ jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+ }
if(JM_STATE_COMPOSING == jm->chat_state) {
serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPING);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/message.h
--- a/libpurple/protocols/jabber/message.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/message.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/oob.c
--- a/libpurple/protocols/jabber/oob.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/oob.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -207,7 +209,10 @@
url = xmlnode_get_data(urlnode);
jox = g_new0(JabberOOBXfer, 1);
- purple_url_parse(url, &jox->address, &jox->port, &jox->page, NULL, NULL);
+ if (!purple_url_parse(url, &jox->address, &jox->port, &jox->page, NULL, NULL)) {
+ g_free(url);
+ return;
+ }
g_free(url);
jox->js = js;
jox->headers = g_string_new("");
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/oob.h
--- a/libpurple/protocols/jabber/oob.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/oob.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/parser.c
--- a/libpurple/protocols/jabber/parser.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/parser.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber XML parser stuff
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/parser.h
--- a/libpurple/protocols/jabber/parser.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/parser.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/pep.c
--- a/libpurple/protocols/jabber/pep.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/pep.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/pep.h
--- a/libpurple/protocols/jabber/pep.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/pep.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/ping.c
--- a/libpurple/protocols/jabber/ping.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/ping.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/ping.h
--- a/libpurple/protocols/jabber/ping.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/ping.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef PURPLE_JABBER_PING_H_
#define PURPLE_JABBER_PING_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/presence.c
--- a/libpurple/protocols/jabber/presence.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -469,10 +471,17 @@
jbr->commands_fetched = TRUE;
}
+#if 0
+ /*
+ * Versions of libpurple before 2.6.0 didn't advertise this capability, so
+ * we can't yet use Entity Capabilities to determine whether or not the
+ * other client supports Entity Capabilities.
+ */
if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/chatstates"))
jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
else
jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+#endif
out:
g_free(userdata->from);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/presence.h
--- a/libpurple/protocols/jabber/presence.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/presence.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/roster.c
--- a/libpurple/protocols/jabber/roster.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/roster.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/roster.h
--- a/libpurple/protocols/jabber/roster.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/roster.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/si.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/si.h
--- a/libpurple/protocols/jabber/si.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/si.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/useravatar.c
--- a/libpurple/protocols/jabber/useravatar.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/useravatar.c Tue Aug 25 17:01:49 2009 +0000
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/useravatar.h
--- a/libpurple/protocols/jabber/useravatar.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/useravatar.h Tue Aug 25 17:01:49 2009 +0000
@@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usermood.c
--- a/libpurple/protocols/jabber/usermood.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usermood.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usermood.h
--- a/libpurple/protocols/jabber/usermood.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usermood.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usernick.c
--- a/libpurple/protocols/jabber/usernick.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usernick.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usernick.h
--- a/libpurple/protocols/jabber/usernick.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usernick.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usertune.c
--- a/libpurple/protocols/jabber/usertune.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usertune.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/usertune.h
--- a/libpurple/protocols/jabber/usertune.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/usertune.h Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2007, Andreas Monitzer
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/xdata.c
--- a/libpurple/protocols/jabber/xdata.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/xdata.c Tue Aug 25 17:01:49 2009 +0000
@@ -1,7 +1,9 @@
/*
* purple - Jabber Protocol Plugin
*
- * Copyright (C) 2003, Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/jabber/xdata.h
--- a/libpurple/protocols/jabber/xdata.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/jabber/xdata.h Tue Aug 25 17:01:49 2009 +0000
@@ -3,7 +3,9 @@
*
* purple
*
- * Copyright (C) 2003 Nathan Walp
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/Makefile.mingw
--- a/libpurple/protocols/msn/Makefile.mingw Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/Makefile.mingw Tue Aug 25 17:01:49 2009 +0000
@@ -41,7 +41,6 @@
command.c \
contact.c\
dialog.c \
- directconn.c \
error.c \
group.c \
history.c \
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/cmdproc.h
--- a/libpurple/protocols/msn/cmdproc.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/cmdproc.h Tue Aug 25 17:01:49 2009 +0000
@@ -71,6 +71,4 @@
void msn_cmdproc_process_payload(MsnCmdProc *cmdproc,
char *payload, int payload_len);
-void msn_cmdproc_disconnect(MsnCmdProc *cmdproc);
-
#endif /* _MSN_CMDPROC_H_ */
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/contact.c
--- a/libpurple/protocols/msn/contact.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/contact.c Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "msn.h"
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/contact.h
--- a/libpurple/protocols/msn/contact.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/contact.h Tue Aug 25 17:01:49 2009 +0000
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _MSN_CONTACT_H_
#define _MSN_CONTACT_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/error.c
--- a/libpurple/protocols/msn/error.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/error.c Tue Aug 25 17:01:49 2009 +0000
@@ -198,7 +198,7 @@
break;
case 800:
- result = _("Friendly name changes too rapidly");
+ result = _("Friendly name is changing too rapidly");
break;
case 910:
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/msn.c Tue Aug 25 17:01:49 2009 +0000
@@ -89,6 +89,7 @@
typedef struct
{
char *smile;
+ PurpleSmiley *ps;
MsnObject *obj;
} MsnEmoticon;
@@ -265,6 +266,7 @@
MsnSession *session;
MsnCmdProc *cmdproc;
MsnPage *page;
+ MsnMessage *msg;
MsnUser *user;
char *payload = NULL;
const char *mobile_number = NULL;
@@ -295,6 +297,9 @@
msn_transaction_set_payload(trans, payload, payload_len);
g_free(payload);
+ msg = msn_message_new_plain(entry);
+ msn_transaction_set_data(trans, msg);
+
msn_page_destroy(page);
msn_cmdproc_send_trans(cmdproc, trans);
@@ -1078,12 +1083,10 @@
strobj = msn_object_to_string(obj);
if (current)
- g_string_append_printf(current, "\t%s\t%s",
- emoticon->smile, strobj);
+ g_string_append_printf(current, "\t%s\t%s", emoticon->smile, strobj);
else {
current = g_string_new("");
- g_string_printf(current,"%s\t%s",
- emoticon->smile, strobj);
+ g_string_printf(current, "%s\t%s", emoticon->smile, strobj);
}
g_free(strobj);
@@ -1141,6 +1144,7 @@
emoticon = g_new0(MsnEmoticon, 1);
emoticon->smile = g_strdup(purple_smiley_get_shortcut(smiley));
+ emoticon->ps = smiley;
emoticon->obj = msn_object_new_from_image(img,
purple_imgstore_get_filename(img),
username, MSN_OBJECT_EMOTICON);
@@ -1163,7 +1167,7 @@
smileys = msn_msg_grab_emoticons(msg->body, username);
while (smileys) {
- smile = (MsnEmoticon*)smileys->data;
+ smile = (MsnEmoticon *)smileys->data;
emoticons = msn_msg_emoticon_add(emoticons, smile);
msn_emoticon_destroy(smile);
smileys = g_slist_delete_link(smileys, smileys);
@@ -1714,13 +1718,19 @@
{
PurpleAccount *account;
MsnSession *session;
+ const char *username;
MsnSwitchBoard *swboard;
MsnMessage *msg;
char *msgformat;
char *msgtext;
+ size_t msglen;
+ MsnEmoticon *smile;
+ GSList *smileys;
+ GString *emoticons = NULL;
account = purple_connection_get_account(gc);
session = gc->proto_data;
+ username = purple_account_get_username(account);
swboard = msn_session_find_swboard_with_id(session, id);
if (swboard == NULL)
@@ -1732,8 +1742,9 @@
swboard->flag |= MSN_SB_FLAG_IM;
msn_import_html(message, &msgformat, &msgtext);
-
- if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564)
+ msglen = strlen(msgtext);
+
+ if ((msglen == 0) || (msglen + strlen(msgformat) + strlen(VERSION) > 1564))
{
g_free(msgformat);
g_free(msgtext);
@@ -1743,6 +1754,29 @@
msg = msn_message_new_plain(msgtext);
msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
+
+ smileys = msn_msg_grab_emoticons(msg->body, username);
+ while (smileys) {
+ smile = (MsnEmoticon *)smileys->data;
+ emoticons = msn_msg_emoticon_add(emoticons, smile);
+ if (purple_conv_custom_smiley_add(swboard->conv, smile->smile,
+ "sha1", purple_smiley_get_checksum(smile->ps),
+ FALSE)) {
+ gconstpointer data;
+ size_t len;
+ data = purple_smiley_get_data(smile->ps, &len);
+ purple_conv_custom_smiley_write(swboard->conv, smile->smile, data, len);
+ purple_conv_custom_smiley_close(swboard->conv, smile->smile);
+ }
+ msn_emoticon_destroy(smile);
+ smileys = g_slist_delete_link(smileys, smileys);
+ }
+
+ if (emoticons) {
+ msn_send_emoticons(swboard, emoticons);
+ g_string_free(emoticons, TRUE);
+ }
+
msn_switchboard_send_msg(swboard, msg, FALSE);
msn_message_destroy(msg);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/msn.h
--- a/libpurple/protocols/msn/msn.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/msn.h Tue Aug 25 17:01:49 2009 +0000
@@ -127,7 +127,7 @@
} MsnClientVerId;
#define MSN_CLIENT_ID_VERSION MSN_CLIENT_VER_7_0
-#define MSN_CLIENT_ID_CAPABILITIES (MSN_CLIENT_CAP_PACKET|MSN_CLIENT_CAP_INK_GIF|MSN_CLIENT_CAP_VOICEIM|MSN_CLIENT_CAP_WINKS)
+#define MSN_CLIENT_ID_CAPABILITIES (MSN_CLIENT_CAP_PACKET|MSN_CLIENT_CAP_INK_GIF|MSN_CLIENT_CAP_VOICEIM)
#define MSN_CLIENT_ID \
((MSN_CLIENT_ID_VERSION << 24) | \
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/notification.c
--- a/libpurple/protocols/msn/notification.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/notification.c Tue Aug 25 17:01:49 2009 +0000
@@ -599,6 +599,8 @@
/* Decrement the count for unknown results so that we'll continue login.
Also, need to finish the login process here as well, because ADL OK
will not be called. */
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "ADL/FQY count is %d\n", session->adl_fqy);
if (--session->adl_fqy == 0)
msn_session_finish_login(session);
return;
@@ -680,6 +682,9 @@
/* ADL's are returned all-together */
session->adl_fqy++;
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Posting ADL, count is %d\n",
+ session->adl_fqy);
msn_notification_post_adl(session->notification->cmdproc,
payload, payload_len);
@@ -694,6 +699,9 @@
} else {
/* FQY's are returned one-at-a-time */
session->adl_fqy++;
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Adding FQY address, count is %d\n",
+ session->adl_fqy);
msn_add_contact_xml(session, fqy_node, user->passport,
0, user->networkid);
@@ -718,6 +726,9 @@
/* ADL's are returned all-together */
session->adl_fqy++;
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "Posting ADL, count is %d\n",
+ session->adl_fqy);
msn_notification_post_adl(session->notification->cmdproc, payload, payload_len);
@@ -809,6 +820,9 @@
if (!strcmp(cmd->params[1], "OK")) {
/* ADL ack */
+ if (purple_debug_is_verbose())
+ purple_debug_info("msn", "ADL ACK, count is %d\n",
+ session->adl_fqy);
if (--session->adl_fqy == 0)
msn_session_finish_login(session);
} else {
@@ -1178,14 +1192,36 @@
id = xmlnode_get_attrib(msg, "id");
if (id && !strcmp(id, "407")) {
- /* TODO: Use this to NAK the transaction, maybe print the text, too.
- unsigned int trId;
- id = xmlnode_get_attrib(payloadNode, "id");
- trId = atol(id);
- */
- purple_conv_present_error(who, gc->account,
- _("Mobile message was not sent because it was too long."));
+ PurpleConversation *conv
+ = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
+ who, gc->account);
+ if (conv != NULL) {
+ purple_conversation_write(conv, NULL,
+ _("Mobile message was not sent because it was too long."),
+ PURPLE_MESSAGE_ERROR, time(NULL));
+
+ if ((id = xmlnode_get_attrib(payloadNode, "id")) != NULL) {
+ unsigned int trId = atol(id);
+ MsnTransaction *trans;
+ MsnMessage *msg;
+ trans = msn_history_find(cmdproc->history, trId);
+ msg = (MsnMessage *)trans->data;
+
+ if (msg) {
+ char *body_str = msn_message_to_string(msg);
+ char *body_enc = g_markup_escape_text(body_str, -1);
+
+ purple_conversation_write(conv, NULL, body_enc,
+ PURPLE_MESSAGE_RAW, time(NULL));
+
+ g_free(body_str);
+ g_free(body_enc);
+ msn_message_destroy(msg);
+ trans->data = NULL;
+ }
+ }
+ }
} else {
serv_got_im(gc, who, text, 0, time(NULL));
}
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/oim.c
--- a/libpurple/protocols/msn/oim.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/oim.c Tue Aug 25 17:01:49 2009 +0000
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "msn.h"
#include "soap.h"
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/oim.h
--- a/libpurple/protocols/msn/oim.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/oim.h Tue Aug 25 17:01:49 2009 +0000
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _MSN_OIM_H_
#define _MSN_OIM_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/slp.c
--- a/libpurple/protocols/msn/slp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/slp.c Tue Aug 25 17:01:49 2009 +0000
@@ -351,7 +351,7 @@
g_free(bin);
- purple_xfer_set_filename(xfer, file_name);
+ purple_xfer_set_filename(xfer, file_name ? file_name : "");
g_free(file_name);
purple_xfer_set_size(xfer, file_size);
purple_xfer_set_init_fnc(xfer, msn_xfer_init);
@@ -403,9 +403,8 @@
if (conv) {
char *buf;
buf = g_strdup_printf(
- _("%s has sent you a webcam "
- "invite, which is not yet "
- "supported."), from);
+ _("%s invited you to view his/her webcam, but "
+ "this is not yet supported."), from);
purple_conversation_write(conv, NULL, buf,
PURPLE_MESSAGE_SYSTEM |
PURPLE_MESSAGE_NOTIFY,
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/slpcall.c
--- a/libpurple/protocols/msn/slpcall.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/slpcall.c Tue Aug 25 17:01:49 2009 +0000
@@ -205,7 +205,7 @@
if (slpmsg->session_id == 64)
{
/* This is for handwritten messages (Ink) */
- GError *error;
+ GError *error = NULL;
gsize bytes_read, bytes_written;
body_str = g_convert((const gchar *)body, body_len / 2,
@@ -232,7 +232,7 @@
g_free(body_str);
body_str = g_convert((const gchar *)body, body_len / 2,
- "UTF-8", "UTF16-LE",
+ "UTF-8", "UTF-16LE",
&bytes_read, &bytes_written, &error);
if (!body_str)
{
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/slplink.c
--- a/libpurple/protocols/msn/slplink.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/slplink.c Tue Aug 25 17:01:49 2009 +0000
@@ -441,6 +441,7 @@
slpmsg->info = "SLP ACK";
msn_slplink_send_slpmsg(slplink, slpmsg);
+ msn_slpmsg_destroy(slpmsg);
}
static void
@@ -504,11 +505,6 @@
data = msn_message_get_bin_data(msg, &len);
- /*
- OVERHEAD!
- if (msg->msnslp_header.length < msg->msnslp_header.total_size)
- */
-
offset = msg->msnslp_header.offset;
if (offset == 0)
@@ -578,7 +574,7 @@
/* fseek(slpmsg->fp, offset, SEEK_SET); */
len = fwrite(data, 1, len, slpmsg->fp);
}
- else if (slpmsg->size)
+ else if (slpmsg->size && slpmsg->buffer)
{
if (G_MAXSIZE - len < offset || (offset + len) > slpmsg->size)
{
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/soap.c
--- a/libpurple/protocols/msn/soap.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/soap.c Tue Aug 25 17:01:49 2009 +0000
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "internal.h"
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msn/soap.h
--- a/libpurple/protocols/msn/soap.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msn/soap.h Tue Aug 25 17:01:49 2009 +0000
@@ -20,7 +20,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _MSN_SOAP_H
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msnp9/slp.c
--- a/libpurple/protocols/msnp9/slp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msnp9/slp.c Tue Aug 25 17:01:49 2009 +0000
@@ -338,7 +338,7 @@
char *bin;
gsize bin_len;
guint32 file_size;
- char *file_name;
+ gchar *file_name;
gunichar2 *uni_name;
account = slpcall->slplink->session->account;
@@ -368,7 +368,8 @@
g_free(bin);
- purple_xfer_set_filename(xfer, file_name);
+ purple_xfer_set_filename(xfer, file_name ? file_name : "");
+ g_free(file_name);
purple_xfer_set_size(xfer, file_size);
purple_xfer_set_init_fnc(xfer, msn_xfer_init);
purple_xfer_set_request_denied_fnc(xfer, msn_xfer_cancel);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/msnp9/slplink.c
--- a/libpurple/protocols/msnp9/slplink.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/msnp9/slplink.c Tue Aug 25 17:01:49 2009 +0000
@@ -477,6 +477,7 @@
#endif
msn_slplink_send_slpmsg(slplink, slpmsg);
+ msn_slpmsg_destroy(slpmsg);
}
static void
@@ -603,7 +604,7 @@
/* fseek(slpmsg->fp, offset, SEEK_SET); */
len = fwrite(data, 1, len, slpmsg->fp);
}
- else if (slpmsg->size)
+ else if (slpmsg->size && slpmsg->buffer)
{
if (G_MAXSIZE - len < offset || (offset + len) > slpmsg->size)
{
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/clientlogin.c
--- a/libpurple/protocols/oscar/clientlogin.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/clientlogin.c Tue Aug 25 17:01:49 2009 +0000
@@ -156,11 +156,15 @@
response_node = xmlnode_from_str(response, response_len);
if (response_node == NULL)
{
+ char *msg;
purple_debug_error("oscar", "startOSCARSession could not parse "
"response as XML: %s\n", response);
+ /* Note to translators: %s in this string is a URL */
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_START_OSCAR_SESSION);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_START_OSCAR_SESSION));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
return FALSE;
}
@@ -175,11 +179,14 @@
/* Make sure we have a status code */
if (tmp_node == NULL || (tmp = xmlnode_get_data_unescaped(tmp_node)) == NULL) {
+ char *msg;
purple_debug_error("oscar", "startOSCARSession response was "
"missing statusCode: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_START_OSCAR_SESSION);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_START_OSCAR_SESSION));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
xmlnode_free(response_node);
return FALSE;
}
@@ -197,10 +204,14 @@
"frequently. Wait ten minutes and try again. If "
"you continue to try, you will need to wait even "
"longer."));
- else
+ else {
+ char *msg;
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_START_OSCAR_SESSION);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_OTHER_ERROR,
- _("Received unexpected response from " URL_START_OSCAR_SESSION));
+ PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
+ g_free(msg);
+ }
g_free(tmp);
xmlnode_free(response_node);
@@ -212,11 +223,14 @@
if (data_node == NULL || host_node == NULL ||
port_node == NULL || cookie_node == NULL)
{
+ char *msg;
purple_debug_error("oscar", "startOSCARSession response was missing "
"something: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_START_OSCAR_SESSION);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_START_OSCAR_SESSION));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
xmlnode_free(response_node);
return FALSE;
}
@@ -227,11 +241,14 @@
*cookie = xmlnode_get_data_unescaped(cookie_node);
if (*host == NULL || **host == '\0' || tmp == NULL || *tmp == '\0' || cookie == NULL || *cookie == '\0')
{
+ char *msg;
purple_debug_error("oscar", "startOSCARSession response was missing "
"something: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_START_OSCAR_SESSION);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_START_OSCAR_SESSION));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
g_free(*host);
g_free(tmp);
g_free(*cookie);
@@ -261,8 +278,10 @@
if (error_message != NULL || len == 0) {
gchar *tmp;
- tmp = g_strdup_printf(_("Error requesting " URL_START_OSCAR_SESSION
- ": %s"), error_message);
+ /* Note to translators: The first %s is a URL, the second is an
+ error message. */
+ tmp = g_strdup_printf(_("Error requesting %s: %s"),
+ URL_START_OSCAR_SESSION, error_message);
purple_connection_error_reason(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
@@ -339,11 +358,14 @@
response_node = xmlnode_from_str(response, response_len);
if (response_node == NULL)
{
+ char *msg;
purple_debug_error("oscar", "clientLogin could not parse "
"response as XML: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_CLIENT_LOGIN);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_CLIENT_LOGIN));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
return FALSE;
}
@@ -360,11 +382,14 @@
/* Make sure we have a status code */
if (tmp_node == NULL || (tmp = xmlnode_get_data_unescaped(tmp_node)) == NULL) {
+ char *msg;
purple_debug_error("oscar", "clientLogin response was "
"missing statusCode: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_CLIENT_LOGIN);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_CLIENT_LOGIN));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
xmlnode_free(response_node);
return FALSE;
}
@@ -393,10 +418,14 @@
purple_connection_error_reason(gc,
PURPLE_CONNECTION_ERROR_OTHER_ERROR,
_("AOL does not allow your screen name to authenticate here"));
- } else
+ } else {
+ char *msg;
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_CLIENT_LOGIN);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_OTHER_ERROR,
- _("Received unexpected response from " URL_CLIENT_LOGIN));
+ PURPLE_CONNECTION_ERROR_OTHER_ERROR, msg);
+ g_free(msg);
+ }
xmlnode_free(response_node);
return FALSE;
@@ -407,11 +436,14 @@
if (data_node == NULL || secret_node == NULL ||
token_node == NULL || tokena_node == NULL)
{
+ char *msg;
purple_debug_error("oscar", "clientLogin response was missing "
"something: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_CLIENT_LOGIN);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_CLIENT_LOGIN));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
xmlnode_free(response_node);
return FALSE;
}
@@ -422,11 +454,14 @@
tmp = xmlnode_get_data_unescaped(hosttime_node);
if (*token == NULL || **token == '\0' || *secret == NULL || **secret == '\0' || tmp == NULL || *tmp == '\0')
{
+ char *msg;
purple_debug_error("oscar", "clientLogin response was missing "
"something: %s\n", response);
+ msg = g_strdup_printf(_("Received unexpected response from %s"),
+ URL_CLIENT_LOGIN);
purple_connection_error_reason(gc,
- PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
- _("Received unexpected response from " URL_CLIENT_LOGIN));
+ PURPLE_CONNECTION_ERROR_NETWORK_ERROR, msg);
+ g_free(msg);
g_free(*token);
g_free(*secret);
g_free(tmp);
@@ -458,8 +493,8 @@
if (error_message != NULL || len == 0) {
gchar *tmp;
- tmp = g_strdup_printf(_("Error requesting " URL_CLIENT_LOGIN
- ": %s"), error_message);
+ tmp = g_strdup_printf(_("Error requesting %s: %s"),
+ URL_CLIENT_LOGIN, error_message);
purple_connection_error_reason(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
g_free(tmp);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/family_buddy.c
--- a/libpurple/protocols/oscar/family_buddy.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/family_buddy.c Tue Aug 25 17:01:49 2009 +0000
@@ -221,9 +221,6 @@
if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
ret = userfunc(od, conn, frame, &userinfo);
- if (snac->subtype == SNAC_SUBTYPE_BUDDY_ONCOMING && userinfo.flags & AIM_FLAG_AWAY)
- aim_locate_autofetch_away_message(od, userinfo.bn);
-
aim_info_free(&userinfo);
return ret;
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/family_locate.c
--- a/libpurple/protocols/oscar/family_locate.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/family_locate.c Tue Aug 25 17:01:49 2009 +0000
@@ -250,8 +250,6 @@
aim_locate_adduserinfo(OscarData *od, aim_userinfo_t *userinfo)
{
aim_userinfo_t *cur;
- FlapConnection *conn;
- aim_rxcallback_t userfunc;
cur = aim_locate_finduserinfo(od, userinfo->bn);
@@ -353,73 +351,6 @@
}
cur->away_len = 0;
}
-
- /*
- * This callback can be used by a client if they want to know whenever
- * info for a buddy is updated. For example, if a client shows away
- * messages in its buddy list, then it would need to know if a user's
- * away message changes.
- */
- conn = flap_connection_findbygroup(od, SNAC_FAMILY_LOCATE);
- if ((userfunc = aim_callhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_GOTINFOBLOCK)))
- userfunc(od, conn, NULL, cur);
-}
-
-/**
- * Remove this buddy name from our queue. If this info was requested
- * by our info request queue, then pop the next element off of the queue.
- *
- * @param od The aim session.
- * @param bn Buddy name of the info we just received.
- * @return True if the request was explicit (client requested the info),
- * false if the request was implicit (libfaim request the info).
- */
-static int
-aim_locate_gotuserinfo(OscarData *od, FlapConnection *conn, const char *bn)
-{
- struct userinfo_node *cur, *del;
- int was_explicit = TRUE;
-
- while ((od->locate.requested != NULL) && (oscar_util_name_compare(bn, od->locate.requested->bn) == 0)) {
- del = od->locate.requested;
- od->locate.requested = del->next;
- was_explicit = FALSE;
- g_free(del->bn);
- g_free(del);
- }
-
- cur = od->locate.requested;
- while ((cur != NULL) && (cur->next != NULL)) {
- if (oscar_util_name_compare(bn, cur->next->bn) == 0) {
- del = cur->next;
- cur->next = del->next;
- was_explicit = FALSE;
- g_free(del->bn);
- g_free(del);
- } else
- cur = cur->next;
- }
-
- return was_explicit;
-}
-
-void
-aim_locate_autofetch_away_message(OscarData *od, const char *bn)
-{
- struct userinfo_node *cur;
-
- /* Make sure we haven't already made an info request for this buddy */
- for (cur = od->locate.requested; cur != NULL; cur = cur->next)
- if (oscar_util_name_compare(bn, cur->bn) == 0)
- return;
-
- /* Add a new node to our request queue */
- cur = (struct userinfo_node *)g_malloc(sizeof(struct userinfo_node));
- cur->bn = g_strdup(bn);
- cur->next = od->locate.requested;
- od->locate.requested = cur;
-
- aim_locate_getinfoshort(od, cur->bn, 0x00000002);
}
aim_userinfo_t *aim_locate_finduserinfo(OscarData *od, const char *bn) {
@@ -956,7 +887,6 @@
aim_snac_t *snac2;
guint16 reason;
char *bn;
- int was_explicit;
if (!(snac2 = aim_remsnac(od, snac->id))) {
purple_debug_misc("oscar", "locate error: received response from unknown request!\n");
@@ -978,15 +908,9 @@
reason = byte_stream_get16(bs);
- /*
- * Remove this buddy name from our queue. If the client requested
- * this buddy's info explicitly, then notify them that we do not have
- * info for this buddy.
- */
- was_explicit = aim_locate_gotuserinfo(od, conn, bn);
- if (was_explicit == TRUE)
- if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
- ret = userfunc(od, conn, frame, reason, bn);
+ /* Notify the user that we do not have info for this buddy */
+ if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
+ ret = userfunc(od, conn, frame, reason, bn);
if (snac2)
g_free(snac2->data);
@@ -1202,7 +1126,6 @@
aim_userinfo_t *userinfo, *userinfo2;
GSList *tlvlist;
aim_tlv_t *tlv = NULL;
- int was_explicit;
userinfo = (aim_userinfo_t *)g_malloc(sizeof(aim_userinfo_t));
aim_info_extract(od, bs, userinfo);
@@ -1238,18 +1161,9 @@
aim_info_free(userinfo);
g_free(userinfo);
- /*
- * Remove this buddy name from our queue. If the client requested
- * this buddy's info explicitly, then notify them that we have info
- * for this buddy.
- */
- if (userinfo2 != NULL)
- {
- was_explicit = aim_locate_gotuserinfo(od, conn, userinfo2->bn);
- if (was_explicit == TRUE)
- if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
- ret = userfunc(od, conn, frame, userinfo2);
- }
+ /* Show the info to the user */
+ if (userinfo2 != NULL && ((userfunc = aim_callhandler(od, snac->family, snac->subtype))))
+ ret = userfunc(od, conn, frame, userinfo2);
return ret;
}
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c Tue Aug 25 17:01:49 2009 +0000
@@ -160,7 +160,6 @@
static int purple_parse_misses (OscarData *, FlapConnection *, FlapFrame *, ...);
static int purple_parse_clientauto (OscarData *, FlapConnection *, FlapFrame *, ...);
static int purple_parse_userinfo (OscarData *, FlapConnection *, FlapFrame *, ...);
-static int purple_got_infoblock (OscarData *, FlapConnection *, FlapFrame *, ...);
static int purple_parse_motd (OscarData *, FlapConnection *, FlapFrame *, ...);
static int purple_chatnav_info (OscarData *, FlapConnection *, FlapFrame *, ...);
static int purple_conv_chat_join (OscarData *, FlapConnection *, FlapFrame *, ...);
@@ -812,24 +811,24 @@
od = purple_connection_get_protocol_data(gc);
- if (userinfo == NULL)
- userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b));
-
- if ((user_info == NULL) || ((b == NULL) && (userinfo == NULL)))
+ if (b == NULL && userinfo == NULL)
return;
if (b == NULL)
b = purple_find_buddy(purple_connection_get_account(gc), userinfo->bn);
+ else
+ userinfo = aim_locate_finduserinfo(od, purple_buddy_get_name(b));
if (b) {
presence = purple_buddy_get_presence(b);
status = purple_presence_get_active_status(presence);
-
- message = g_strdup(purple_status_get_attr_string(status, "message"));
- itmsurl = g_strdup(purple_status_get_attr_string(status, "itmsurl"));
-
- } else {
- /* This is an OSCAR contact for whom we don't have a PurpleBuddy but do have information. */
+ }
+
+ /* If we have both b and userinfo we favor userinfo, because if we're
+ viewing someone's profile then we want the HTML away message, and
+ the "message" attribute of the status contains only the plaintext
+ message. */
+ if (userinfo) {
if ((userinfo->flags & AIM_FLAG_AWAY)) {
/* Away message? */
if ((userinfo->flags & AIM_FLAG_AWAY) && (userinfo->away_len > 0) && (userinfo->away != NULL) && (userinfo->away_encoding != NULL)) {
@@ -850,6 +849,9 @@
userinfo->itmsurl, userinfo->itmsurl_len);
#endif
}
+ } else {
+ message = g_strdup(purple_status_get_attr_string(status, "message"));
+ itmsurl = g_strdup(purple_status_get_attr_string(status, "itmsurl"));
}
is_away = ((status && !purple_status_is_available(status)) ||
@@ -916,7 +918,6 @@
g_free(message);
message = g_strdup(_("Offline"));
}
-
}
purple_notify_user_info_add_pair(user_info, _("Status"), message);
@@ -1478,7 +1479,6 @@
oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_RIGHTSINFO, purple_parse_locaterights, 0);
oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_USERINFO, purple_parse_userinfo, 0);
oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_ERROR, purple_parse_locerr, 0);
- oscar_data_addhandler(od, SNAC_FAMILY_LOCATE, SNAC_SUBTYPE_LOCATE_GOTINFOBLOCK, purple_got_infoblock, 0);
oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x0001, purple_parse_genericerr, 0);
oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x000f, purple_selfinfo, 0);
oscar_data_addhandler(od, SNAC_FAMILY_OSERVICE, 0x001f, purple_memrequest, 0);
@@ -2139,6 +2139,23 @@
g_return_val_if_fail(info != NULL, 1);
g_return_val_if_fail(info->bn != NULL, 1);
+ /*
+ * If this is an AIM buddy and their name has formatting, set their
+ * server alias.
+ */
+ if (!oscar_util_valid_name_icq(info->bn)) {
+ gboolean bn_has_formatting = FALSE;
+ char *c;
+ for (c = info->bn; *c != '\0'; c++) {
+ if (!islower(*c)) {
+ bn_has_formatting = TRUE;
+ break;
+ }
+ }
+ serv_got_alias(gc, info->bn,
+ bn_has_formatting ? info->bn : NULL);
+ }
+
if (info->present & AIM_USERINFO_PRESENT_FLAGS) {
if (info->flags & AIM_FLAG_AWAY)
buddy_is_away = TRUE;
@@ -3287,7 +3304,7 @@
oscar_user_info_append_extra_info(gc, user_info, NULL, userinfo);
if ((userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE) && !oscar_util_valid_name_sms(userinfo->bn)) {
- /* An SMS contact is always online; its Online Since valid is not useful */
+ /* An SMS contact is always online; its Online Since value is not useful */
time_t t = userinfo->onlinesince;
oscar_user_info_add_pair(user_info, _("Online Since"), purple_date_format_full(localtime(&t)));
}
@@ -3330,55 +3347,6 @@
return 1;
}
-static int purple_got_infoblock(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...)
-{
- PurpleConnection *gc = od->gc;
- PurpleAccount *account = purple_connection_get_account(gc);
- PurpleBuddy *b;
- PurplePresence *presence;
- PurpleStatus *status;
- gchar *message = NULL;
-
- va_list ap;
- aim_userinfo_t *userinfo;
-
- va_start(ap, fr);
- userinfo = va_arg(ap, aim_userinfo_t *);
- va_end(ap);
-
- b = purple_find_buddy(account, userinfo->bn);
- if (b == NULL)
- return 1;
-
- if (!oscar_util_valid_name_icq(userinfo->bn))
- {
- if (strcmp(purple_buddy_get_name(b), userinfo->bn) != 0)
- serv_got_alias(gc, purple_buddy_get_name(b), userinfo->bn);
- else
- serv_got_alias(gc, purple_buddy_get_name(b), NULL);
- }
-
- presence = purple_buddy_get_presence(b);
- status = purple_presence_get_active_status(presence);
-
- if (purple_status_is_online(status) && !purple_status_is_available(status) &&
- userinfo->flags & AIM_FLAG_AWAY && userinfo->away_len > 0 &&
- userinfo->away != NULL && userinfo->away_encoding != NULL)
- {
- gchar *charset = oscar_encoding_extract(userinfo->away_encoding);
- message = oscar_encoding_to_utf8(account, charset,
- userinfo->away,
- userinfo->away_len);
- g_free(charset);
- purple_prpl_got_user_status(account, userinfo->bn,
- purple_status_get_id(status),
- "message", message, NULL);
- g_free(message);
- }
-
- return 1;
-}
-
static int purple_parse_motd(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...)
{
char *msg;
@@ -6335,6 +6303,44 @@
}
static void
+oscar_close_directim(gpointer object, gpointer ignored)
+{
+ PurpleBlistNode *node;
+ PurpleBuddy *buddy;
+ PurpleAccount *account;
+ PurpleConnection *gc;
+ PurpleConversation *conv;
+ OscarData *od;
+ PeerConnection *conn;
+ const char *name;
+
+ node = object;
+
+ g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+
+ buddy = (PurpleBuddy*)node;
+ name = purple_buddy_get_name(buddy);
+ account = purple_buddy_get_account(buddy);
+ gc = purple_account_get_connection(account);
+ od = gc->proto_data;
+ conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM);
+
+ if (conn != NULL)
+ {
+ if (!conn->ready)
+ aim_im_sendch2_cancel(conn);
+
+ peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL);
+
+ /* OSCAR_DISCONNECT_LOCAL_CLOSED doesn't write anything to the convo
+ * window. Let the user know that we canceled the Direct IM. */
+ conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
+ purple_conversation_write(conv, NULL, _("You closed the connection."),
+ PURPLE_MESSAGE_SYSTEM, time(NULL));
+ }
+}
+
+static void
oscar_get_aim_info_cb(PurpleBlistNode *node, gpointer ignore)
{
PurpleBuddy *buddy;
@@ -6397,11 +6403,23 @@
oscar_util_name_compare(purple_account_get_username(account), bname) &&
PURPLE_BUDDY_IS_ONLINE(buddy))
{
+ PeerConnection *conn;
+ conn = peer_connection_find_by_type(od, bname, OSCAR_CAPABILITY_DIRECTIM);
+
if (userinfo->capabilities & OSCAR_CAPABILITY_DIRECTIM)
{
- act = purple_menu_action_new(_("Direct IM"),
- PURPLE_CALLBACK(oscar_ask_directim),
- NULL, NULL);
+ if (conn)
+ {
+ act = purple_menu_action_new(_("End Direct IM Session"),
+ PURPLE_CALLBACK(oscar_close_directim),
+ NULL, NULL);
+ }
+ else
+ {
+ act = purple_menu_action_new(_("Direct IM"),
+ PURPLE_CALLBACK(oscar_ask_directim),
+ NULL, NULL);
+ }
menu = g_list_prepend(menu, act);
}
#if 0
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/oscar.h
--- a/libpurple/protocols/oscar/oscar.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.h Tue Aug 25 17:01:49 2009 +0000
@@ -533,7 +533,6 @@
struct {
struct aim_userinfo_s *userinfo;
- struct userinfo_node *requested;
} locate;
/* Server-stored information (ssi) */
@@ -1133,7 +1132,6 @@
/* 0x000f */ int aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy);
/* 0x0015 */ int aim_locate_getinfoshort(OscarData *od, const char *bn, guint32 flags);
-void aim_locate_autofetch_away_message(OscarData *od, const char *bn);
guint32 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len);
guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len);
void aim_info_free(aim_userinfo_t *);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/oscar/snactypes.h
--- a/libpurple/protocols/oscar/snactypes.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/oscar/snactypes.h Tue Aug 25 17:01:49 2009 +0000
@@ -96,7 +96,6 @@
#define SNAC_SUBTYPE_LOCATE_USERINFO 0x0006
#define SNAC_SUBTYPE_LOCATE_WATCHERSUBREQ 0x0007
#define SNAC_SUBTYPE_LOCATE_WATCHERNOT 0x0008
-#define SNAC_SUBTYPE_LOCATE_GOTINFOBLOCK 0xfffd
#define SNAC_SUBTYPE_LOCATE_DEFAULT 0xffff
/*
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/qq/qq_crypt.c
--- a/libpurple/protocols/qq/qq_crypt.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/qq/qq_crypt.c Tue Aug 25 17:01:49 2009 +0000
@@ -19,7 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
*
* QQ encryption algorithm
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/qq/qq_crypt.h
--- a/libpurple/protocols/qq/qq_crypt.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/qq/qq_crypt.h Tue Aug 25 17:01:49 2009 +0000
@@ -19,7 +19,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _QQ_CRYPT_H_
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/qq/send_file.c
--- a/libpurple/protocols/qq/send_file.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/qq/send_file.c Tue Aug 25 17:01:49 2009 +0000
@@ -730,7 +730,7 @@
*/
filename = g_path_get_basename(purple_xfer_get_local_filename(qd->xfer));
msg = g_strdup_printf
- (_("%d canceled the transfer of %s"),
+ (_("%d cancelled the transfer of %s"),
sender_uid, filename);
purple_notify_warning (gc, _("File Send"), msg, NULL);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/yahoo/libyahoo.c
--- a/libpurple/protocols/yahoo/libyahoo.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/yahoo/libyahoo.c Tue Aug 25 17:01:49 2009 +0000
@@ -278,7 +278,7 @@
NULL, /**< dependencies */
PURPLE_PRIORITY_DEFAULT, /**< priority */
"prpl-yahoo", /**< id */
- "Yahoo!", /**< name */
+ "Yahoo", /**< name */
DISPLAY_VERSION, /**< version */
/** summary */
N_("Yahoo! Protocol Plugin"),
@@ -321,13 +321,15 @@
option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOO_ROOMLIST_LOCALE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+ option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
- option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+ option = purple_account_option_bool_new(_("Use account proxy for SSL connections"), "proxy_ssl", FALSE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
-
#if 0
option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/yahoo/libyahoojp.c
--- a/libpurple/protocols/yahoo/libyahoojp.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/yahoo/libyahoojp.c Tue Aug 25 17:01:49 2009 +0000
@@ -174,7 +174,7 @@
NULL, /**< dependencies */
PURPLE_PRIORITY_DEFAULT, /**< priority */
"prpl-yahoojp", /**< id */
- "Yahoo! JAPAN", /**< name */
+ "Yahoo JAPAN", /**< name */
DISPLAY_VERSION, /**< version */
/** summary */
N_("Yahoo! JAPAN Protocol Plugin"),
@@ -217,13 +217,15 @@
option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOOJP_ROOMLIST_LOCALE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+ option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
- option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+ option = purple_account_option_bool_new(_("Use account proxy for SSL connections"), "proxy_ssl", FALSE);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
-
#if 0
option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/yahoo/libymsg.c
--- a/libpurple/protocols/yahoo/libymsg.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c Tue Aug 25 17:01:49 2009 +0000
@@ -1839,11 +1839,12 @@
PurpleAccount *account = purple_connection_get_account(gc);
char *url = NULL;
gboolean yahoojp = yahoo_is_japan(account);
+ gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
url = g_strdup_printf(yahoojp ? YAHOOJP_LOGIN_URL : YAHOO_LOGIN_URL, token);
- url_data = purple_util_fetch_url_request_len_with_account(account, url,
- TRUE, YAHOO_CLIENT_USERAGENT, TRUE, NULL, FALSE, -1,
- yahoo_auth16_stage2, auth_data);
+ url_data = purple_util_fetch_url_request_len_with_account(
+ proxy_ssl ? account : NULL, url, TRUE, YAHOO_CLIENT_USERAGENT,
+ TRUE, NULL, FALSE, -1, yahoo_auth16_stage2, auth_data);
g_free(url);
g_free(token);
}
@@ -1852,12 +1853,14 @@
static void yahoo_auth16_stage1(PurpleConnection *gc, const char *seed)
{
+ PurpleAccount *account = purple_connection_get_account(gc);
PurpleUtilFetchUrlData *url_data = NULL;
struct yahoo_auth_data *auth_data = NULL;
char *url = NULL;
char *encoded_username;
char *encoded_password;
- gboolean yahoojp;
+ gboolean yahoojp = yahoo_is_japan(account);
+ gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
purple_debug_info("yahoo", "Authentication: In yahoo_auth16_stage1\n");
@@ -1866,7 +1869,6 @@
return;
}
- yahoojp = yahoo_is_japan(purple_connection_get_account(gc));
auth_data = g_new0(struct yahoo_auth_data, 1);
auth_data->gc = gc;
auth_data->seed = g_strdup(seed);
@@ -1879,7 +1881,7 @@
g_free(encoded_username);
url_data = purple_util_fetch_url_request_len_with_account(
- purple_connection_get_account(gc), url, TRUE,
+ proxy_ssl ? account : NULL, url, TRUE,
YAHOO_CLIENT_USERAGENT, TRUE, NULL, FALSE, -1,
yahoo_auth16_stage1_cb, auth_data);
@@ -2077,21 +2079,24 @@
if (!purple_account_get_remember_password(account))
purple_account_set_password(account, NULL);
- msg = g_strdup(_("Incorrect password"));
+ msg = g_strdup(_("Invalid username or password"));
reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
break;
case 14:
- msg = g_strdup(_("Your account is locked, please log in to the Yahoo! website."));
+ msg = g_strdup(_("Your account has been locked due to too many failed login attempts."
+ " Please try logging into the Yahoo! website."));
reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
break;
case 52:
/* See #9660. As much as we know, reconnecting shouldn't hurt */
purple_debug_info("yahoo", "Got error 52, Set to autoreconnect\n");
- msg = g_strdup_printf(_("Unknown error"));
+ msg = g_strdup_printf(_("Unknown error 52. Reconnecting should fix this."));
reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
break;
case 1013:
- msg = g_strdup(_("Invalid username"));
+ msg = g_strdup(_("Error 1013: The username you have entered is invalid."
+ " The most common cause of this error is entering your e-mail"
+ " address instead of your Yahoo! ID."));
reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME;
break;
default:
@@ -4271,7 +4276,7 @@
}
}
- msn = !g_strncasecmp(who, "msn/", 4);
+ msn = !g_ascii_strncasecmp(who, "msn/", 4);
if( strncmp(who, "+", 1) == 0 ) {
/* we have an sms to be sent */
@@ -4395,7 +4400,7 @@
{
YahooData *yd = gc->proto_data;
struct yahoo_p2p_data *p2p_data;
- gboolean msn = !g_strncasecmp(who, "msn/", 4);
+ gboolean msn = !g_ascii_strncasecmp(who, "msn/", 4);
struct yahoo_packet *pkt = NULL;
/* Don't do anything if sms is being typed */
@@ -4420,7 +4425,7 @@
else
yahoo_packet_hash(pkt, "ssssss", 49, "TYPING", 1, purple_connection_get_display_name(gc),
14, " ", 13, state == PURPLE_TYPING ? "1" : "0",
- 5, who+4, 1002, "1");
+ 5, who, 1002, "1");
yahoo_packet_send_and_free(pkt, yd);
}
@@ -4495,8 +4500,6 @@
if (purple_presence_is_idle(presence))
yahoo_packet_hash_str(pkt, 47, "2");
- else if (!purple_status_is_available(status))
- yahoo_packet_hash_str(pkt, 47, "1");
yahoo_packet_send_and_free(pkt, yd);
@@ -4517,6 +4520,7 @@
struct yahoo_packet *pkt = NULL;
char *msg = NULL, *msg2 = NULL;
PurpleStatus *status = NULL;
+ gboolean invisible = FALSE;
if (idle && yd->current_status != YAHOO_STATUS_CUSTOM)
yd->current_status = YAHOO_STATUS_IDLE;
@@ -4525,9 +4529,15 @@
yd->current_status = get_yahoo_status_from_purple_status(status);
}
+ invisible = !( purple_presence_is_available(purple_account_get_presence(purple_connection_get_account(gc))) );
+
pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE, YAHOO_STATUS_AVAILABLE, yd->session_id);
- yahoo_packet_hash_int(pkt, 10, yd->current_status);
+ if (!idle && invisible)
+ yahoo_packet_hash_int(pkt, 10, YAHOO_STATUS_AVAILABLE);
+ else
+ yahoo_packet_hash_int(pkt, 10, yd->current_status);
+
if (yd->current_status == YAHOO_STATUS_CUSTOM) {
const char *tmp;
if (status == NULL)
@@ -4550,8 +4560,6 @@
if (idle)
yahoo_packet_hash_str(pkt, 47, "2");
- else if (!purple_presence_is_available(purple_account_get_presence(purple_connection_get_account(gc))))
- yahoo_packet_hash_str(pkt, 47, "1");
yahoo_packet_send_and_free(pkt, yd);
@@ -4668,7 +4676,7 @@
return;
f = yahoo_friend_find(gc, bname);
- msn = !g_strncasecmp(bname, "msn/", 4);
+ msn = !g_ascii_strncasecmp(bname, "msn/", 4);
g = purple_buddy_get_group(buddy);
if (g)
@@ -4766,6 +4774,7 @@
void yahoo_add_deny(PurpleConnection *gc, const char *who) {
YahooData *yd = (YahooData *)gc->proto_data;
struct yahoo_packet *pkt;
+ gboolean msn = FALSE;
if (!yd->logged_in)
return;
@@ -4773,15 +4782,21 @@
if (!who || who[0] == '\0')
return;
+ msn = !g_ascii_strncasecmp(who, "msn/", 4);
pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id);
- yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc),
- 7, who, 13, "1");
+
+ if(msn)
+ yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "1");
+ else
+ yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "1");
+
yahoo_packet_send_and_free(pkt, yd);
}
void yahoo_rem_deny(PurpleConnection *gc, const char *who) {
YahooData *yd = (YahooData *)gc->proto_data;
struct yahoo_packet *pkt;
+ gboolean msn = FALSE;
if (!yd->logged_in)
return;
@@ -4789,8 +4804,14 @@
if (!who || who[0] == '\0')
return;
+ msn = !g_ascii_strncasecmp(who, "msn/", 4);
pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT, YAHOO_STATUS_AVAILABLE, yd->session_id);
- yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2");
+
+ if(msn)
+ yahoo_packet_hash(pkt, "ssss", 1, purple_connection_get_display_name(gc), 7, who+4, 241, "2", 13, "2");
+ else
+ yahoo_packet_hash(pkt, "sss", 1, purple_connection_get_display_name(gc), 7, who, 13, "2");
+
yahoo_packet_send_and_free(pkt, yd);
}
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/yahoo/libymsg.h
--- a/libpurple/protocols/yahoo/libymsg.h Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/yahoo/libymsg.h Tue Aug 25 17:01:49 2009 +0000
@@ -280,6 +280,27 @@
void yahoo_init_colorht(void);
void yahoo_dest_colorht(void);
char *yahoo_codes_to_html(const char *x);
+
+/**
+ * This function takes a normal HTML message and converts it to the message
+ * format used by Yahoo, which uses a frankensteinish combination of ANSI
+ * escape codes and broken HTML.
+ *
+ * It results in slightly different output than would be sent by official
+ * Yahoo clients. The two main differences are:
+ *
+ * 1. We always close all tags, whereas official Yahoo clients leave tags
+ * dangling open at the end of each message (and the client treats them
+ * as closed).
+ * 2. We always close inner tags first before closing outter tags.
+ *
+ * For example, if you want to send this message:
+ * bold bolditalic italic
+ * Official Yahoo clients would send:
+ * ESC[1m bold ESC[2m bolditalic ESC[x1m italic
+ * But we will send:
+ * ESC[1m bold ESC[2m bolditalic ESC[x2mESC[x1mESC[2m italic ESC[x2m
+ */
char *yahoo_html_to_codes(const char *src);
gboolean
diff -r 3443ed867ce3 -r 1ca2df744414 libpurple/protocols/yahoo/util.c
--- a/libpurple/protocols/yahoo/util.c Tue Aug 25 15:40:06 2009 +0000
+++ b/libpurple/protocols/yahoo/util.c Tue Aug 25 17:01:49 2009 +0000
@@ -513,7 +513,7 @@
int i, j;
gboolean no_more_gt_brackets = FALSE;
const char *match;
- gchar *xmlstr1, *xmlstr2;
+ gchar *xmlstr1, *xmlstr2, *esc;
x_len = strlen(x);
html = xmlnode_new("html");
@@ -553,12 +553,15 @@
#endif /* !USE_CSS_FORMATTING */
} else if ((match = g_hash_table_lookup(esc_codes_ht, code))) {
- gboolean is_closing_tag;
- gchar *tag_name;
-
- tag_name = yahoo_markup_get_tag_name(match, &is_closing_tag);
- yahoo_codes_to_html_add_tag(&cur, match, is_closing_tag, tag_name, FALSE);
- g_free(tag_name);
+ /* Some tags are in the hash table only because we
+ * want to ignore them */
+ if (match[0] != '\0') {
+ gboolean is_closing_tag;
+ gchar *tag_name;
+ tag_name = yahoo_markup_get_tag_name(match, &is_closing_tag);
+ yahoo_codes_to_html_add_tag(&cur, match, is_closing_tag, tag_name, FALSE);
+ g_free(tag_name);
+ }
} else {
purple_debug_error("yahoo",
@@ -608,7 +611,6 @@
if (match == NULL) {
/* Unknown tag. The user probably typed a less-than sign */
g_string_append_c(cdata, x[i]);
- no_more_gt_brackets = TRUE;
g_free(tag);
g_free(tag_name);
break;
@@ -657,7 +659,10 @@
xmlstr2 = g_strndup(xmlstr1 + 6, strlen(xmlstr1) - 13);
g_free(xmlstr1);
- purple_debug_misc("yahoo", "yahoo_codes_to_html: Returning string: '%s'.\n", xmlstr2);
+ esc = g_strescape(x, NULL);
+ purple_debug_misc("yahoo", "yahoo_codes_to_html(%s)=%s\n", esc, xmlstr2);
+ g_free(esc);
+
return xmlstr2;
}
@@ -666,33 +671,16 @@
#define POINT_SIZE(x) (_point_sizes [MIN ((x > 0 ? x : 1), MAX_FONT_SIZE) - 1])
static const gint _point_sizes [] = { 8, 10, 12, 14, 20, 30, 40 };
-enum fatype
-{
- FATYPE_SIZE,
- FATYPE_COLOR,
- FATYPE_FACE,
- FATYPE_JUNK
-};
-
typedef struct
{
- enum fatype type;
- union {
- int size;
- char *color;
- char *face;
- char *junk;
- } u;
-} fontattr;
-
-static void fontattr_free(fontattr *f)
-{
- if (f->type == FATYPE_COLOR)
- g_free(f->u.color);
- else if (f->type == FATYPE_FACE)
- g_free(f->u.face);
- g_free(f);
-}
+ gboolean bold;
+ gboolean italic;
+ gboolean underline;
+ gboolean in_link;
+ int font_size;
+ char *font_face;
+ char *font_color;
+} CurrentMsgState;
static void yahoo_htc_list_cleanup(GSList *l)
{
@@ -702,338 +690,203 @@
}
}
-static void _parse_font_tag(const char *src, GString *dest, int *i, int *j,
- int len, GSList **colors, GSList **tags, GQueue *ftattr)
+static void parse_font_tag(GString *dest, const char *tag_name, const char *tag,
+ GSList **colors, GSList **tags)
{
- int m, n, vstart;
- gboolean quote = FALSE, done = FALSE;
+ const char *start;
+ const char *end;
+ GData *attributes;
+ const char *attribute;
+ gboolean needendtag;
+ GString *tmp;
- m = *j;
+ purple_markup_find_tag(tag_name, tag, &start, &end, &attributes);
+
+ needendtag = FALSE;
+ tmp = g_string_new(NULL);
- while (1) {
- m++;
+ attribute = g_datalist_get_data(&attributes, "color");
+ if (attribute != NULL) {
+ g_string_append(tmp, *colors ? (*colors)->data : "\033[#000000m");
+ g_string_append_printf(dest, "\033[%sm", attribute);
+ *colors = g_slist_prepend(*colors,
+ g_strdup_printf("\033[%sm", attribute));
+ } else {
+ /* We need to add a value to the colors stack even if we're not
+ * setting a color because we ALWAYS pop exactly 1 element from
+ * this stack for every tag. If we don't add anything
+ * then we'll pop something that we shouldn't when we hit this
+ * corresponding . */
+ *colors = g_slist_prepend(*colors,
+ *colors ? g_strdup((*colors)->data) : g_strdup("\033[#000000m"));
+ }
- if (m >= len) {
- g_string_append(dest, &src[*i]);
- *i = len;
- break;
+ attribute = g_datalist_get_data(&attributes, "face");
+ if (attribute != NULL) {
+ needendtag = TRUE;
+ g_string_append(dest, "= len) {
- m = n;
- break;
- }
-
- if (src[n] == '"') {
- if (!quote) {
- quote = TRUE;
- vstart = n;
- continue;
- } else {
- done = 1;
- }
- }
-
- if (!quote && ((src[n] == ' ') || (src[n] == '>')))
- done = TRUE;
-
- if (done) {
- if (!g_ascii_strncasecmp(&src[*j+1], "FACE", m - *j - 1)) {
- fontattr *f;
-
- f = g_new(fontattr, 1);
- f->type = FATYPE_FACE;
- f->u.face = g_strndup(&src[vstart+1], n-vstart-1);
- if (!ftattr)
- ftattr = g_queue_new();
- g_queue_push_tail(ftattr, f);
- m = n;
- break;
- } else if (!g_ascii_strncasecmp(&src[*j+1], "SIZE", m - *j - 1)) {
- fontattr *f;
-
- f = g_new(fontattr, 1);
- f->type = FATYPE_SIZE;
- f->u.size = POINT_SIZE(strtol(&src[vstart+1], NULL, 10));
- if (!ftattr)
- ftattr = g_queue_new();
- g_queue_push_tail(ftattr, f);
- m = n;
- break;
- } else if (!g_ascii_strncasecmp(&src[*j+1], "COLOR", m - *j - 1)) {
- fontattr *f;
-
- f = g_new(fontattr, 1);
- f->type = FATYPE_COLOR;
- f->u.color = g_strndup(&src[vstart+1], n-vstart-1);
- if (!ftattr)
- ftattr = g_queue_new();
- g_queue_push_head(ftattr, f);
- m = n;
- break;
- } else {
- fontattr *f;
-
- f = g_new(fontattr, 1);
- f->type = FATYPE_JUNK;
- f->u.junk = g_strndup(&src[*j+1], n-*j);
- if (!ftattr)
- ftattr = g_queue_new();
- g_queue_push_tail(ftattr, f);
- m = n;
- break;
- }
+ g_string_append_printf(dest, "size=\"%d\" ",
+ POINT_SIZE(strtol(attribute, NULL, 10)));
+ }
- }
- }
- }
-
- if (src[m] == ' ')
- *j = m;
-
- if (src[m] == '>') {
- gboolean needendtag = FALSE;
- fontattr *f;
- GString *tmp = g_string_new(NULL);
-
- if (!g_queue_is_empty(ftattr)) {
- while ((f = g_queue_pop_tail(ftattr))) {
- switch (f->type) {
- case FATYPE_SIZE:
- if (!needendtag) {
- needendtag = TRUE;
- g_string_append(dest, "u.size);
- break;
- case FATYPE_FACE:
- if (!needendtag) {
- needendtag = TRUE;
- g_string_append(dest, "u.face);
- break;
- case FATYPE_JUNK:
- if (!needendtag) {
- needendtag = TRUE;
- g_string_append(dest, "str[dest->len-1] = '>';
+ *tags = g_slist_prepend(*tags, g_strdup(""));
+ g_string_free(tmp, TRUE);
+ } else {
+ *tags = g_slist_prepend(*tags, tmp->str);
+ g_string_free(tmp, FALSE);
+ }
- g_string_append(dest, f->u.junk);
- break;
-
- case FATYPE_COLOR:
- if (needendtag) {
- g_string_append(tmp, "");
- dest->str[dest->len-1] = '>';
- needendtag = TRUE;
- }
-
- g_string_append(tmp, *colors ? (*colors)->data : "\033[#000000m");
- g_string_append_printf(dest, "\033[%sm", f->u.color);
- *colors = g_slist_prepend(*colors,
- g_strdup_printf("\033[%sm", f->u.color));
- break;
- }
- fontattr_free(f);
- }
-
- g_queue_free(ftattr);
- ftattr = NULL;
-
- if (needendtag) {
- dest->str[dest->len-1] = '>';
- *tags = g_slist_prepend(*tags, g_strdup(""));
- g_string_free(tmp, TRUE);
- } else {
- *tags = g_slist_prepend(*tags, tmp->str);
- g_string_free(tmp, FALSE);
- }
- }
-
- *i = *j = m;
- break;
- }
- }
+ g_datalist_clear(&attributes);
}
char *yahoo_html_to_codes(const char *src)
{
GSList *colors = NULL;
+
+ /**
+ * A stack of char*s where each char* is the string that should be
+ * appended to dest in order to close all the tags that were opened
+ * by a tag.
+ */
GSList *tags = NULL;
+
size_t src_len;
int i, j;
GString *dest;
char *esc;
- GQueue *ftattr = NULL;
- gboolean no_more_specials = FALSE;
+ gboolean no_more_gt_brackets = FALSE;
+ gchar *tag, *tag_name;
+ gboolean is_closing_tag;
+ CurrentMsgState current_state;
+
+ memset(¤t_state, 0, sizeof(current_state));
src_len = strlen(src);
dest = g_string_sized_new(src_len);
for (i = 0; i < src_len; i++) {
-
- if (src[i] == '<' && !no_more_specials) {
+ if (src[i] == '<' && !no_more_gt_brackets) {
+ /* The start of an HTML tag */
j = i;
- while (1) {
- j++;
-
- if (j >= src_len) { /* no '>' */
- g_string_append_c(dest, src[i]);
- no_more_specials = TRUE;
- break;
- }
+ while (j++ < src_len) {
+ if (src[j] != '>') {
+ if (src[j] == '"') {
+ /* We're inside a quoted attribute value. Skip to the end */
+ j++;
+ while (j != src_len && src[j] != '"')
+ j++;
+ } else if (src[j] == '\'') {
+ /* We're inside a quoted attribute value. Skip to the end */
+ j++;
+ while (j != src_len && src[j] != '\'')
+ j++;
+ }
+ if (j != src_len)
+ /* Keep looking for the end of this tag */
+ continue;
- if (src[j] == '<') {
- /* FIXME: This doesn't convert outgoing entities.
- * However, I suspect this case may never
- * happen anymore because of the entities.
- */
- g_string_append_len(dest, &src[i], j - i);
- i = j - 1;
- if (ftattr) {
- fontattr *f;
-
- while ((f = g_queue_pop_head(ftattr)))
- fontattr_free(f);
- g_queue_free(ftattr);
- ftattr = NULL;
- }
+ /* This < has no corresponding > */
+ g_string_append_c(dest, src[i]);
+ no_more_gt_brackets = TRUE;
break;
}
- if (src[j] == ' ') {
- if (!g_ascii_strncasecmp(&src[i+1], "BODY", j - i - 1)) {
- char *t = strchr(&src[j], '>');
- if (!t) {
- g_string_append(dest, &src[i]);
- i = src_len;
- break;
- } else {
- i = t - src;
- break;
+ tag = g_strndup(src + i, j - i + 1);
+ tag_name = yahoo_markup_get_tag_name(tag, &is_closing_tag);
+
+ if (g_str_equal(tag_name, "a")) {
+ const char *start;
+ const char *end;
+ GData *attributes;
+ const char *attribute;
+
+ /*
+ * TODO: Ideally we would replace this:
+ * Pidgin
+ * with this:
+ * Pidgin (http://pidgin.im/)
+ *
+ * Currently we drop the text within the tag and
+ * just show the URL. Doing it the fancy way is
+ * complicated when dealing with HTML tags within the
+ * tag.
+ */
+
+ /* Append the URL */
+ purple_markup_find_tag(tag_name, tag, &start, &end, &attributes);
+ attribute = g_datalist_get_data(&attributes, "href");
+ if (attribute != NULL) {
+ if (purple_str_has_prefix(attribute, "mailto:"))
+ attribute += 7;
+ g_string_append(dest, attribute);
+ }
+ g_datalist_clear(&attributes);
+
+ /* Skip past the closing tag */
+ end = purple_strcasestr(src + j, "");
+ if (end != NULL)
+ j = end - src + 3;
+
+ } else if (g_str_equal(tag_name, "font")) {
+ parse_font_tag(dest, tag_name, tag, &colors, &tags);
+ } else if (g_str_equal(tag_name, "b")) {
+ g_string_append(dest, "\033[1m");
+ current_state.bold = TRUE;
+ } else if (g_str_equal(tag_name, "/b")) {
+ if (current_state.bold) {
+ g_string_append(dest, "\033[x1m");
+ current_state.bold = FALSE;
+ }
+ } else if (g_str_equal(tag_name, "i")) {
+ current_state.italic = TRUE;
+ g_string_append(dest, "\033[2m");
+ } else if (g_str_equal(tag_name, "/i")) {
+ if (current_state.italic) {
+ g_string_append(dest, "\033[x2m");
+ current_state.italic = FALSE;
+ }
+ } else if (g_str_equal(tag_name, "u")) {
+ current_state.underline = TRUE;
+ g_string_append(dest, "\033[4m");
+ } else if (g_str_equal(tag_name, "/u")) {
+ if (current_state.underline) {
+ g_string_append(dest, "\033[x4m");
+ current_state.underline = FALSE;
+ }
+ } else if (g_str_equal(tag_name, "/a")) {
+ /* Do nothing */
+ } else if (g_str_equal(tag_name, "br")) {
+ g_string_append_c(dest, '\n');
+ } else if (g_str_equal(tag_name, "/font")) {
+ if (tags != NULL) {
+ char *etag = tags->data;
+ tags = g_slist_delete_link(tags, tags);
+ g_string_append(dest, etag);
+ if (colors != NULL) {
+ g_free(colors->data);
+ colors = g_slist_delete_link(colors, colors);
}
- } else if (!g_ascii_strncasecmp(&src[i+1], "A HREF=\"", j - i - 1)) {
- j += 7;
- g_string_append(dest, "\033[lm");
- if (purple_str_has_prefix(src + j, "mailto:"))
- j += sizeof("mailto:") - 1;
- while (1) {
- g_string_append_c(dest, src[j]);
- if (++j >= src_len) {
- i = src_len;
- break;
- }
- if (src[j] == '"') {
- g_string_append(dest, "\033[xlm");
- while (1) {
- if (++j >= src_len) {
- i = src_len;
- break;
- }
- if (!g_ascii_strncasecmp(&src[j], "", 4)) {
- j += 3;
- break;
- }
- }
- i = j;
- break;
- }
- }
- } else if (!g_ascii_strncasecmp(&src[i+1], "SPAN", j - i - 1)) { /* drop span tags */
- while (1) {
- if (++j >= src_len) {
- g_string_append(dest, &src[i]);
- i = src_len;
- break;
- }
- if (src[j] == '>') {
- i = j;
- break;
- }
- }
- } else if (g_ascii_strncasecmp(&src[i+1], "FONT", j - i - 1)) { /* not interested! */
- while (1) {
- if (++j >= src_len) {
- g_string_append(dest, &src[i]);
- i = src_len;
- break;
- }
- if (src[j] == '>') {
- g_string_append_len(dest, &src[i], j - i + 1);
- i = j;
- break;
- }
- }
- } else { /* yay we have a font tag */
- _parse_font_tag(src, dest, &i, &j, src_len, &colors, &tags, ftattr);
+ g_free(etag);
}
-
- break;
}
- if (src[j] == '>') {
- /* This has some problems like the FIXME for the
- * '<' case. and like that case, I suspect the case
- * that this has problems is won't happen anymore anyway.
- */
- int sublen = j - i - 1;
-
- if (sublen) {
- if (!g_ascii_strncasecmp(&src[i+1], "B", sublen)) {
- g_string_append(dest, "\033[1m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "/B", sublen)) {
- g_string_append(dest, "\033[x1m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "I", sublen)) {
- g_string_append(dest, "\033[2m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "/I", sublen)) {
- g_string_append(dest, "\033[x2m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "U", sublen)) {
- g_string_append(dest, "\033[4m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "/U", sublen)) {
- g_string_append(dest, "\033[x4m");
- } else if (!g_ascii_strncasecmp(&src[i+1], "/A", sublen)) {
- g_string_append(dest, "\033[xlm");
- } else if (!g_ascii_strncasecmp(&src[i+1], "BR", sublen)) {
- g_string_append_c(dest, '\n');
- } else if (!g_ascii_strncasecmp(&src[i+1], "/BODY", sublen)) {
- /* mmm,