         @conn.on "stanza", (stanza) =>
             # Just debug output:
             console.log "<< #{stanza.toString()}"
+            from = stanza.attrs.from
 
             switch stanza.name
                 when "iq"

        # For iq response tracking (@sendIq):
        @lastIqId = 0
        @iqCallbacks = {}

        # For presence tracking:
        @onlineResources = {}

                when "message"
                    unless stanza.attrs.type is "error"
                        @_handleMessage stanza
                    else if from.indexOf('@') < 0
                        unless missedServerTimeouts.hasOwnProperty(from)
                            # We've got an error back from a component,
                            # which are not subject to presence and must
                            # be probed manually.
                            @missedServerTimeouts[from] = setTimeout =>
                                delete @missedServerTimeouts[from]
                                @send new xmpp.Element('message',
                                    type: 'headline'
                                    from: @jid
                                    to: from
                                ).c('you-missed-something', xmlns: NS.BUDDYCLOUD_V1)
                            , MISSED_INTERVAL

    send: (stanza) ->
        stanza = stanza.root()
