Swift Blog http://swift.im/blog/ 2012-02-04T19:31:39Z Author Experimental File Transfer support hits Swift http://el-tramo.be/blog/swift-experimental-ft 2011-09-25T00:00:00+00:00 Remko Tronçon Tobias Markmann, one of the XMPP Standards Foundation’s 2011 Google Summer of Code students. He has been working on implementing File Transfer support for Swift, using the fresh Jingle XMPP protocols. I'm happy to announce that we integrated Tobias’s work as an experimental feature into the main Swift branch, where it will be further developed and brushed off before being enabled in our nightly builds and releases. For those interested in the nitty gritty protocol details: file transfers are negotiated through the Jingle File Transfer protocol (XEP-0234), using SOCKS5 (XEP-0260) as the main transport, and In-Band Bytestreams (XEP-0261) as fallback. To improve connectivity, we use both the NAT Port Mapping Protocol and the UPnP Internet Gateway Device protocols to allow connections through most firewalls, and SOCKS5 relaying proxies in case all else fails. The new feature has been tested for interoperability against (slightly modified) development versions of both Pidgin and Gajim, which, together with the Pidgin-based Adium, cover a large XMPP user base. After both clients update their protocols to track the newly published Draft specification versions, all 3 should be able to exchange files seamlessly. What still remains to be done is lots of testing (both internal testing, user testing, reliability testing, and interop testing), bugfixing, and some refactoring here and there to clean up some of the code (which already is in very good shape). Our end goal is to reach a rock solid implementation, with a near guarantee that file exchange will always work (which experience teaches us is far from trivial). To conclude, we’ld like to thank Tobias for contributing this great new feature to Swift, for providing valuable protocol feedback to the XSF, and for laying the foundation to other exciting Jingle-based features (including voice/video conferencing).]]> Revealing Stroke to the world http://www.kismith.co.uk/wordpress/index.php/2011/07/04/revealing-stroke-to-the-world/ 2011-07-04T11:52:27+00:00 Kev It’s time to reveal the latest project I’ve been working on to the world and, just to prove that XMPP isn’t all of my life, it’s…an XMPP library.

Stroke is a native Java port of the Swiften XMPP library that Remko and I work on. It came about because Isode (my day job) needed an XMPP library for use in a Java project and none of the alternatives at the time seemed to be suitable, so I’ve been spending some of my work days over the last while porting Swiften. Isode have decided to open-source Stroke and I’ve uploaded the development repository to http://swift.im/git/stroke alongside the Swift and Swiften code.

Stroke’s now in a basic usable state but I’m still working on adding some of the basic necessary features. Particularly, at this stage, it’s lacking in:

  • TLS support.
  • zlib compression support.
  • Many (most?) of the protocol payload handling that its big brother Swiften has.

I intend to address these as time allows.

On the other hand, it’s already inherited some of the nice features that Swiften has, particularly:

  • Support for the SCRAM-SHA1 authentication mechanism (a mandatory feature for XMPP, these days).
  • XEP-0198 stanza acknowledgement support (for reliable messaging).

If you’d like to grab a copy to have a look at, experiment with or just follow development of, head over to http://swift.im/git/stroke.

If you’d like to chat about Stroke (or Swiften, or Swift), we’ve got a chat room and a mailing list, linked from our Discussion Page and I’d love to hear from you.

The primary license is the GPL v3, although alternative licensing may be arranged for Stroke (and for Swiften). Contact Us.

]]>
Summer of Swift Code 2011 http://el-tramo.be/blog/swift-gsoc-2011 2011-04-26T00:00:00+00:00 Remko Tronçon announced the 1116 students that were accepted for this year's edition of the Google Summer of Code, 5 of which will be working with the XMPP Standards Foundation. We're very happy to welcome both Tobias Markmann and Vlad Voicu, who will be working full-time on Swift this summer, implementing file transfer support and conversation history respectively. We have to mention that these weren't the only proposals we received. Most of the proposals we received this year were of good quality: we suspect that the teaser tasks we put up for potential students made it possible for both the students and us to get an idea up front of what should be expected. However, based on experience from previous years, we decided we should only accept 2 students, to ensure that we could give our full attention to making all projects successful (including fast integration into a Swift release). We're convinced that both Vlad and Tobias will live up to their expectations, and implement some of the most requested Swift features today!]]> Swift 1.0 Released http://el-tramo.be/blog/swift-1-0 2011-04-18T00:00:00+00:00 Remko Tronçon first full release of the Swift IM client! In this first release, we have focused on building a user-friendly messaging client, with all the basic features you would typically need for having real-time conversations. In future versions (which are already in the works as we speak), we will be extending Swift with more features. We would like to thank Isode for sponsoring time for Kevin to work on Swift, Flosoft for providing our download infrastructure, Dave Cridland for the logo, all the translators who helped us make Swift available in different languages, all the code contributors, all of whom should be listed on our About page, and all our beta testers for giving us feedback and bugreports throughout the whole development period!]]> Swift 1.0 Release Candidate http://www.kismith.co.uk/wordpress/index.php/2011/04/03/swift-1-0-release-candidate/ 2011-04-03T16:07:41+00:00 Kev A bit under a month since the last beta was released, Swift has reached Release Candidate stage for 1.0. This version is being released to check that each i is dotted and each t crossed, so please report any bugs/issues that you find, and in the absence of problems we’ll aim to release the final builds soon.

The release notes are available at http://swift.im/releases/swift-1.0rc1/ and the changelog since beta9 is:

  • Added Spanish and Catalan translation (Thanks to Jan Kusanagi)
  • Added Russian translation (Thanks to Ivan Tyumentsev)
  • Added German translation (Thanks to Thilo Cestonaro)
  • Fixed a bug where the avatar was not updating in the chat window.
  • Fixed typo in room join message.
  • Fixed a potential hang on shutdown on Mac OS X.
  • Fixed compilation on systems with a recent version of Boost installed.
  • Fixed the last couple of remaining known crashes

Please test http://swift.im/releases/swift-1.0rc1/, and encourage friends, families and colleagues to do the same, and we’ll look forward to Swift 1.0.

]]>
Swift Translators Wanted http://el-tramo.be/blog/swift-translators-wanted 2011-03-22T00:00:00+00:00 Remko Tronçon the final Swift beta has been released, it's time to start translating Swift in as many languages as possible! Thanks to a handful of early translators, we've been able to iron out (hopefully) the last translation issues from beta9, and we have Dutch, Polish, French, German, Norwegian, Czech, Slovak, Spanish, and Catalan translations in the works. So, now, we're calling out to you: if your language is not in the list, and you feel you could do a good job translating the Swift user interface (containing about 250 strings), please drop by the Swift room swift@rooms.swift.im, and let us know!]]> Swift needs *you* for Google Summer of Code 2011 http://www.kismith.co.uk/wordpress/index.php/2011/03/19/swift-needs-you-for-google-summer-of-code-2011/ 2011-03-19T19:25:25+00:00 Kev Just under 24 hours ago, the XMPP Standards Foundation were told that they’ve been accepted for Google’s Summer of Code 2011. A healthy chunk of Swift projects are within the ideas the XSF are proposing this summer, and we’re looking forward to the opportunity to involve more people in what is, for Remko and me, a very enjoyable pastime. So if you’re a student, please visit our chat room or our mailing list and see if we can discuss ideas that excite you. If you know students who might be interested, please spread the word, and help make Swift’s first GSoC experience a great one.

]]>
Swift 1.0-beta9 released http://www.kismith.co.uk/wordpress/index.php/2011/03/13/swift-1-0-beta9-released/ 2011-03-13T11:17:07+00:00 Kev We’ve just released the final pre-1.0 beta of Swift (next step Release Candidate). We have no known bugs in Swift at this point, so if you find any please report them so we can get them fixed for the RC.

A fuller changelog is available at http://swift.im/releases/swift-1.0beta9/, but the highlights include:

* On servers that support it, users can now perform searches for contacts to add or chat to.
* The roster header can now be configured to show the JID instead of the nick.
* Server certificates are now verified and validated. Certificates not passing the tests require confirmation.
* Added dialog changing your nickname and avatar.
* Swift now uses SCRAM-SHA-1-PLUS authentication on servers that support it.
* Highlighting an item in the login account list and pressing detele will now prompt you to remove the cached credentials for that account. (Thanks to Thilo Cestonaro)
* Added keyboard accelerators for tabs and commands. (Thanks to Arnt Gulbrandsen)
* Security labels (XEP-0258) support has been updated to match the latest version of the specification.
* It is now possible to edit contacts from the standard menus (without needing to right-click on the item)
* Fixed all known bugs.
* Various speed improvements.
* Various aesthetic improvements.
* Added Dutch translation.

Please go forth and test: http://swift.im/releases/swift-1.0beta9/

See you in RC.

]]>
XMPP Scripting with Sluift http://el-tramo.be/blog/sluift 2011-03-05T00:00:00+00:00 Remko Tronçon Sluift may be just the thing you are looking for! Sluift is a Lua-based script layer on top of the Swiften XMPP library. It provides a simple API to do common XMPP tasks, either interactively (through an XMPP console), or by running a script in batch mode. In this post, we’ll go through some examples of what you can already do with Sluift today. Let’s start with a very simple task: logging into a server, and sending a message to one of our contacts. We fire up Sluift, and start by typing the commands to log in:
== Sluift XMPP Console (20110304) == 
Press Ctrl-D to exit  
> c = sluift.new_client("alice@wonderland.lit", "MySecret")
> c:connect()
>
Now that we're connected to the server, let's send out presence (so people can see we’re online), and send the message to one of our contacts:
> c:send_presence("I'm here")
> c:send_message("sister@realworld.lit", "Hi there!")
Now, let's wait 3 seconds for her reply, by printing out all the incoming events, and finish off by disconnecting:
> c:for_event(function(e) tprint(e) end, 3000)
([type] => presence, [from] => sister@realworld.lit/Home, 
 [status] => At home)
([type] => presence, [from] => rabbit@wonderland.lit/Party, 
 [status] => Tea party!)
([type] => message, [from] => sister@realworld.lit/Home, 
 [body] => Hi Alice!)
> c:disconnect()
>
Now for a slightly more complex example. Suppose that you want to switch XMPP servers, but you want to take all your contacts with you to your new account. To do this, you start by logging into your current account, and fetch your contact list:
> c = sluift.new_client("alice@wonderland.lit", "MySecret")
> c:connect()
> contacts = c:get_contacts()
> tprint(contacts)
[sister@wonderland.lit] => table
    ( [jid] => sister@wonderland.lit
      [subscription] => both
      [groups] => table ( [1] => Family )
      [name] => Sister )
...
Now that we have our contact list, let’s disconnect, log into our second account, and add all the contacts from the list to the second account:
> c:disconnect()
> c = sluift.new_client("alice@teaparty.lit", "MyOtherSecret")
> c:connect()
> for _, contact in pairs(contacts) do c:add_contact(contact) end
That’s it, all your contacts have now been migrated! So far, we have used Sluift as an interactive XMPP console. However, Sluift’s synchronous/blocking nature (it only executes the next command when you have the results of the previous) also makes it very suitable for writing small batch scripts. For example, you can write a short script to collect statistics about which sever software is popular amongst your contacts:
c = sluift.new_client("alice@wonderland.lit", "MySecret")
c:connect()
versions = {}
for jid, _ in pairs(c:get_contacts()) do
  v = c:get_version(sluift.jid_domain(jid))
  if v then versions[v["name"]] = (versions[v["name"]] or 0) + 1 end
end
for name, cnt in pairs(versions) do print(name .. ": " .. cnt) end
c:disconnect()
Executing the script gives us the following result:
$ ./sluift CollectVersions.lua
jabberd2: 1
Prosody: 25
Isode M-Link: 31
yabberd: 1
SoapBox Server 2007: 1
jabberd: 5
Tigase: 2
ejabberd: 19
Openfire: 4
And finally, we can’t show script examples without including our beloved EchoBot from XMPP: The Definitive Guide:
c = sluift.new_client("echobot@wonderland.lit", "mypass")
c:connect():send_presence("Send me a message")
c:for_event(function(e)
    if e["type"] == "message" then 
      c:send_message(e["from"], e["body"])
    end
  end)
Besides interactive and scripted tasks, another great use for Sluift is for XMPP testing (which is the reason we started Sluift in the first place). However, we will go into details about this use case in a later blog post. For now, if you want to play around with Sluift yourself, you can build a development version from the Swift Git repository (together with some examples), or you can get a snapshot for Windows or Mac OS X here (currently only works on very specific setups). Finally, note that, although you can already do quite some tasks with Sluift today, the API is still quite limited (and undocumented). We are adding new functionality to Sluift as we need it or as people ask for it, so if you’re interested in Sluift, speak up! Stay tuned for more on the topic of XMPP scripting!]]>
Swiften on Lambdas http://el-tramo.be/blog/swiften-lambdas 2011-02-04T00:00:00+00:00 Remko Tronçon lambda expressions, providing functional-style inline function declarations. After seeing Herb Sutter’s PDC 2010 webcast on lambdas, I wanted to try this out on Swiften, the XMPP library behind Swift. I adapted the introductory EchoBot example from XMPP: The Definitive Guide, and ported it from Python to a C++ application using Swiften. The result is surprisingly clean. The purpose of EchoBot is simple: connect to an XMPP server, log in, send out a status message to announce you're available, and then wait and respond to all incoming messages with the exact same message. Translating this into C++ code, with lambdas, gives us the following: The flow of the code follows the description of the bot quite closely. Before connecting the client to the network, we declare the actions to be taken on different events: when connected, send out presence, and when a message was received, send it back. Swiften uses signals to notify events, and instead of having to declare slot methods and using boost::bind to connect signals to slots, we can now use lambdas to directly specify what should happen. (for the curious: [&] means that all variables outside of the lambda, i.e. client, are passed by reference) The great thing about this is that this works out of the box with recent compilers: I tried this code with Microsoft Visual Studio 2010 and GCC 4.5.0. (unfortunately, CLang doesn’t support this feature yet) If you want to try building your own XMPP applications using Swiften (with or without C++0x), grab a development version from the Git repository, and consult the Swiften Developers Guide and Swiften API documentation to get started.]]>