Giter VIP home page Giter VIP logo

halcyon's People

Contributors

arturhefczyc avatar bmalkow avatar hantu85 avatar qianqianluo avatar woj-tek 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

halcyon's Issues

ContactChangeStatusEvent fired for presence subscription type

I am not sure if this is intentional but I noticed that presence subscription results in firing ContactChangeStatusEvent event. This seems not entirely correct, as subscription request does not really change contact status.

I am not even sure if this should trigger PresenceReceivedEvent as this is really subscription request. Perhaps it would be more efficient to have a separate SubscriptionReuqestEvent to be triggered for such packets.

Problem getting vcards for all roster entries

First I am logging into the XMPP service.

halcyon.connect()

Then, in the SASL event handler, after successful login I am registering handler for RosterEvent and requesting roster entries:

var rosterModule = halcyon.getModule<RosterModule>(RosterModule.TYPE)!!
halcyon.eventBus.register<RosterEvent>(RosterEvent.TYPE) {
    handleRosterEvent(it)
}
rosterModule.rosterGet()

Then, again, in the roter event handler I am attempting to request vCard for each roster item:

fun handleRosterEvent(ev: RosterEvent) {
    var nick = if(ev.item.name == null || ev.item.name == "") ev.item.jid.localpart else ev.item.name
    if (nick == null || nick == "") nick = ev.item.jid.toString()
    val contact = Contact(ev.item.jid.toString(), true, nick)

    println("RosterItem added: ${contact.jid}, nickname: '${contact.nickname}'")

    // Requesting VCard for the roster item
    halcyon.eventBus.register<VCardUpdatedEvent>(VCardUpdatedEvent.TYPE) {
        handleVCardEvent(it)
    }

    var vcardModule = halcyon.getModule<VCardModule>(VCardModule.TYPE)!!
    vcardModule.autoRetrieve = true
    println("Requesting VCard for ${ev.item.jid}")
    vcardModule.retrieveVCard(ev.item.jid)
}

And here is the vCard event handler code:

fun handleVCardEvent(ev: VCardUpdatedEvent) {
    println("Received VCard: ${ev.jid.toString()}")
    var vCard = ev.vcard
    println("VCard: ${vCard.toString()}")
    println("VCard nickname: ${vCard?.nickname}")
    println("VCard formattedName: ${vCard?.formattedName}")
}

I have about 100 items in the roster which all are received using rosterModule.rosterGet() method call.

Now, the problem is that I request a vCard for each roster item in the roster event handler but I only receive vcard for the last roster item and I receive this vCard for the last roster item 100 times.

It looks like vCard module sends 100 requests but the argument for all these 100 request is set to the last JID requested.

Missing online documentation

The README file points users to Tigase's online documentation website for Halcyon documentation. However, the website does not contain any documentation for the library yet.

Logs on all levels contains huge chunks of data

Right now logs on levels from FINEST to FINE contain entire content of stanzas received. Especially for packets like avatar data it makes it very difficult to read and analyze logs which tend to rapidly grow.

It would be much more useful to limit such a high verbosity to the highest log level - FINEST. Any level below that should only contain most critical parts of the stanza. Maybe just the first level of the XML or maybe 2 levels deep. Just to avoid huge chunks of data in the log files.

vCard error response is not passed back to application as an event

I am attempting to retrieve contact's vcard as described in the issue: #6 (comment)

For some vcard request I am getting responses like this:
Request:

<iq to="[email protected]" id="JAiFXty3u8W0209Ro0EEDxvx" type="get">
  <vcard xmlns="urn:ietf:params:xml:ns:vcard-4.0"/>
</iq>

Response:

<iq to="[email protected]" xmlns="jabber:client" from="[email protected]" type="error" id="JAiFXty3u8W0209Ro0EEDxvx">
  <error type="cancel">
    <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</iq>

In the library log I can see that the response was not correctly handler:

[EDT] 0:0:10,791 - Mon Oct 05 15:52:46 PDT 2020 [FINE] tigase.halcyon.core.connector.WebSocketConnector: Received: <iq to="[email protected]" xmlns="jabber:client" from="[email protected]" type="error" id="JAiFXty3u8W0209Ro0EEDxvx"><error type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
[EDT] 0:0:10,791 - Mon Oct 05 15:52:46 PDT 2020 [FINEST] tigase.halcyon.core.connector.WebSocketConnector: Received element <iq xmlns="jabber:client" from="[email protected]" to="[email protected]" id="JAiFXty3u8W0209Ro0EEDxvx" type="error"><error type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>
[EDT] 0:0:10,791 - Mon Oct 05 15:52:46 PDT 2020 [FINEST] tigase.halcyon.core.eventbus.EventBus: Firing event ReceivedXMLElementEvent(element=XMLElement[name='iq' hash='929711258']) with 3 handlers
[EDT] 0:0:10,791 - Mon Oct 05 15:52:46 PDT 2020 [WARNING] tigase.halcyon.core.requests.RequestsManager: Error on processing response
tigase.halcyon.core.xmpp.XMPPException

There is an event fired ReceivedXMLElementEvent but it is not really useful in the application space. It would be bette to receive an error event in response to the vcard IQRequest.

Missing details on how to handle `connect`

The example in the README file provides a simple use case using connectAndWait. It does not, however, provide any details on how to check of the connection was successful or not. How to check and handle connection errors in case, for example if password is incorrect.

Missing documentation

There is no documentation or example code on how to retrieve user's roster.

Please add code example on retrieving user's roster as well as other typical XMPP use cases:

  • roster
  • presence status for contact
  • own user vcard
  • contact vcard

iOS support

Hey guys,

first of all thank you for your effort making Kotlin Multiplatform XMPP library. There are not many other solutions available in the area so far ๐Ÿ‘

The only one question I have is about iOS support - my vision is Kotlin Multiplatform should be a great alternative to separated Android/iOS development, so iOS support is a must.

If you have any plans/thoughts on this matter - could you please share.

thank you

vCard minimal content required

We require the following, minimum content supported in vCards for contacts:

  • email
  • firstName
  • lastName
  • role
  • phone
  • birthday date
  • timezone
  • street address
  • country address
  • city address
  • postal code address
  • region (maybe not mandatory)

As for the firstName/lastName I am not sure how related to this is currently supported structuredName and formattedName. Maybe this would be enough and we do not need first/last names. I am not sure at this point.

RosterLoadedEvent

Right now, we have a few events in the RosterModule for item change (Added, Updated, Removed). However, at the startup time, in GUI it is inefficient to deal individual roster items and updated GUI for each element.

It would be very useful to have a single event handler called once, the entire roster is loaded. Then, in the GUI I can load all roster items and display up to date list.

How is this supposed to be used with Angular?

import halcyon from 'halcyon-core-jsLegacy';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

	constructor() {
		console.log( halcyon.tigase.halcyon.core.Halcyon())
	}
}

Fail ERROR TypeError: this.eventBus is undefined

WebSocket support

Library like Smack providing xmpp over websocket support.
Could be nice if halcyon support websocket as well.

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.