Stanza send functionality now directly sends the stanzas over the wire and returns appropriate notification whether the sent succeeded (as far as we can tell)
Here's a hack with `Read' and `Show' instances for Jid, as discussed.
I didn't have the time or patience to make it elegant, but at least it
does the job.
I'm calling it `jid' instead of `toJid' for the time-being since
`toJid' is already used in the stream configuration record.
Fixes#24.
The way I understand it, the `Show' and `Read' instances are for `String' representations that can be Haskell code. A proper `Show' instance of `Jid' would produce something like `Jid (Just "test") "example.com" Nothing'. A proper `Read' instance of `Jid' would parse something like that `String' value, and would stop parsing when completed.
This patch automatically derives the `Show' instance from `Jid'. It also uses the previous `Show' instance to create a pretty printer, `jidToText'. It also provides a (trivial) `jidToTexts'. As an automatically derived `Read' instance could be used to create invalid `Jid' values and affect the correctness of applications using Pontarius XMPP, such a derivation has not been included. This required some changes in the `Jid' marshalling code, which assumed a `Read' instance.
Since we provide `jidFromText', I'm assuming that no-one needs a `Read' instance of `Jid'.
Fixes#24.
As I think the `SaslHandler's might change relatively frequently
depending on the value of `ConnectionState', I hereby suggest that the
handler value passed to `session' is changed from `[SaslHandler]' to
`(ConnectionState -> [SaslHandler]'.
Most people would probably just do `\_ -> scramSha1...', but I guess
the extra flexibility this provides makes up for the slightly more
complicated API.
For some reason, answerMessage used to set messageFrom = messageTo,
while I believe that it should just set it to Nothing (the server will
set the "from" attribute for us).
Fixes#7.