Git Product home page Git Product logo

go-xmpp's People

Contributors

bodqhrohro avatar genofire avatar hypafrag avatar jacksgt avatar jsautret avatar mremond avatar remicorniere avatar samwhited avatar theomcginley avatar wichert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-xmpp's Issues

Add sendxmpp command-line tool

The goal is to be able to use a command-line tool to allow sending message to XMPP user or MUC, for easy notification automation.

Add XMPP Router feature to let components and clients provide handler depending on XMPP packet received

Currently, the developer has to make his own dispatcher code in each client or component.

It would be more handy to provide the needed infrastructure to let the developer match the packet they are interested to handle in their code.

It also likely mean that it will way packets are received, moving from a channel iterator to a set of callback functions. Developers can always get back to the channel behaviour by sending the message on a channel in their callbacks.

JIDs must be split on the resourcepart first

The JID class needs to split on the resourcepart first and be more careful about how it's splitting. Eg. trying to parse the following valid JID will cause a panic: [email protected]/resource@moreresource/stillmoreresourcepart

Disclaimer: Shameless self promotion follows. Feel free to steal code from my implementation here. I'd love to collaborate and reduce code duplication on some of this. I also have an issue at golang/go#13797 to add JIDs into the x/net package. No idea if that will be accepted or not though.

EDIT: I just noticed that there's a test to make sure that [email protected]/test/test is invalid, but this is a perfectly valid JID. Not sure if this was deliberate or not.

Add way to add route to match any unhandled packet

This is handy for example for logging such traffic.

I need to test / validate this, but possibly an empty route as last route, would do that.
Even in that case, it is probably best to add an explicit alias in the router API to clarify developer intent.

See discussion here: #55 (comment)

Support registering new types into IQ payload type registry

IQ code has a pretty slick way of registering a struct into which an IQ payload should be unmarshaled using reflect package's TypeOf.

Unfortunately, all types are hardcoded.

It would be a nice way to send custom, currently unsupported payloads (e.g. User Activity for PEP) if the library would allow registering new types into the type registry.

Would it make sense to create such a public API?

MUC Implementation

Is joining a MUC implemented in this library?

I looked around and found a few issues mentioning MUC that seem to indicate it is implemented, but I can't find any documentation on how to actually use it.

Could you point me in the right direction? Thanks!

Add support for outgoing message queue

We should allow sending messages for a while, until we reconnect. The send would fail on messages with an error when the queue is full.

We should also link that to stream management ack to keep outgoing message in that queue until they have been acked by the server, so that they can be replayed if they are lost.

MUC support

I found my old code again ... yaja- most of the handling is a little bit trash.

But the library of structs is still not bad (here: xmpp)

The parsing is really easy: https://dev.sum7.eu/genofire/yaja/blob/master/client/comm.go#L9-37.

Another nice feature is, that it is not necessary to iterate over all Message.Extensions we could just make a if PresenceClient.MUC !=nil because omitempty pointer are filled with nil if the values for this structs are not given.

atm i miss somethings to replace other libraries in related project:

  • muc support
  • obb (to publish image urls as http_upload)
  • html body

IQ can only have a single payload

We can thus simplify IQ. IQ can only have a single payload + an optional error.

"An IQ stanza of type "get" or "set" MUST contain exactly one
child element, which specifies the semantics of the particular
request."

Is there a way to check if connection is still alive?

First thank you for this library and the echo bot example. I was able to build a simple bot without programming experience following the example, although I have to admit at the start I used code from this repo.

But despite reading in the library a lot it is still not clear to me how I could check whether the connection is still alive. My bot works pretty well till it stops working due to a network flaw/reconnect. Could you please give me a hint at which modules/functions I should have a closer look?

godocs are down

The godocs have been down for a handful of weeks now:

image

Any ideas on what is causing it/how to fix it?

Support <presence/>-less client connections

Hi,

I am trying to log in, query PEP node for user activity (xep-0108), publish something on this node, disconnect and shut down.

I would prefer to minimize the notifications to other users, I would prefer to minimize the traffic, and therefore I don't need or wish to publish presence or receive presences. Publishing a presence would encourage clients to do other communications with the PEP publisher.

Could you add an option to sign in without sending <presence/>? There is already a comment wondering exactly whether this should happen. I believe no, there should not be auto-sent <presence/>; and if yes, it should be configurable what the presence contains (capabilities, status type, status text, ...).

Perhaps the default shouldn't change to avoid breaking existing clients, but it should be possible to switch the sending off.

Improve / simplify stanza building code

Currently, building a stanza can lead to quite lengthy code, like the following:

iqResp := xmpp.NewIQ(xmpp.Attrs{Type: "result", From: iq.To, To: iq.From, Id: iq.Id, Lang: "en"})
identity := xmpp.Identity{
	Name:     opts.Name,
	Category: opts.Category,
	Type:     opts.Type,
}
payload := xmpp.DiscoInfo{
	XMLName: xml.Name{
		Space: xmpp.NSDiscoInfo,
		Local: "query",
	},
	Identity: identity,
	Features: []xmpp.Feature{
		{Var: xmpp.NSDiscoInfo},
		{Var: xmpp.NSDiscoItems},
		{Var: "jabber:iq:version"},
		{Var: "urn:xmpp:delegation:1"},
	},
}
iqResp.Payload = &payload

I am exploring ways to make the code more compact and more guided through helpers (usable with code completin) with a code like this:

b := stanza.NewBuilder().Lang("fr") // Create builder and set default language

iq := b.IQ(stanza.Attrs{Type: "get", To: "service.localhost", Id: "disco-get-1"})

payload := b.DiscoInfo()
identity := b.Identity("Test Component", "gateway", "service")
payload.SetFeatures(stanza.NSDiscoInfo, stanza.NSDiscoItems, "jabber:iq:version", "urn:xmpp:delegation:1").
	SetIdentities(identity)

iq.Payload = payload

What do you think?

TLS domain from JID is wrong

When creating tls connection the domain should be the connection address not JID domain part. there might be situation where connection is made to xmpp.example.com and jids are @example.com. this causes the tls fail.

go get fluux.io/xmpp failed

Server certificate is expired.

$ go get fluux.io/xmpp
package fluux.io/xmpp: unrecognized import path "fluux.io/xmpp" (https fetch: Get https://fluux.io/xmpp?go-get=1: x509: certificate has expired or is not yet valid)

tls.Config warning.

I got the warning:
call of xmpp.NewClient copies lock value: gosrc.io/xmpp.Config contains crypto/tls.Config contains sync.Once contains sync.Mutexcopylocks
I think that TLSConfig option in Config should be pointer.

Implement connection loss detection

We need to use whitespace ping to maintain the connection and basically "ask" the network layer if the connection is still valid.
It should also solve #8.

I will not support XMPP ping for now as it is much more consuming for both the client and the server (CPU and bandwidth) without providing any significant benefit for checking the client to server connection. XMPP ping should be limited to client to client and components interactions.

[bug] in Resume for Component

component/config.go:43:31: cannot use c.xmpp (type *xmpp.Component) as type xmpp.StreamClient in argument to xmpp.NewStreamManager:
	*xmpp.Component does not implement xmpp.StreamClient (wrong type for Resume method)
		have Resume() error
		want Resume(xmpp.SMState) error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.