[erlang-questions] HOWTO: Jabberlang vs. talk.google.com

Darrin Thompson <>
Wed Jan 3 04:44:52 CET 2007


On 1/2/07, Darrin Thompson <> wrote:
> I successfully connected with talk.google.com using jabberlang from
> process-one svn.
>

Except I forgot that I needed a patch.

Jabberlang is sending presence stanzas with type="available" which
isn't allowed by the xmpp spec, at least not the ones google folks
read. :-) The spec recommends no type attribute to indicate
"available".

Index: src/xmpp.erl
===================================================================
--- src/xmpp.erl        (revision 8)
+++ src/xmpp.erl        (working copy)
@@ -196,6 +196,9 @@

 send_presence(Socket, Show, Status) ->
     send_presence(Socket, "available", Show, Status).
+send_presence(Socket, "available", Show, Status) ->
+    Message = io_lib:format("<presence><show>~s</show><status>~s</status></presence>",
[Show, Status]),
+    gen_tcp:send(Socket, Message);
 send_presence(Socket, Type, Show, Status) ->
     Message = io_lib:format("<presence
type='~s'><show>~s</show><status>~s</status></presence>", [Type, Show,
Status]),
     gen_tcp:send(Socket, Message).



More information about the erlang-questions mailing list