Giter VIP home page Giter VIP logo

xmpp4r-simple's Introduction

= Name

Jabber::Simple - An extremely easy-to-use Jabber client library.

= Synopsis

  # Send a message to a friend, asking for authorization if necessary:
  im = Jabber::Simple.new("[email protected]", "password")
  im.deliver("[email protected]", "Hey there friend!")

  # Get received messages and print them out to the console:
  im.received_messages { |msg| puts msg.body if msg.type == :chat }

  # Send an authorization request to a user:
  im.add("[email protected]")

  # Get presence updates from your friends, and print them out to the console:
  # (admittedly, this one needs some work)
  im.presence_updates { |update|
    from     = update[0].jid.strip.to_s
    status   = update[2].status
    presence = update[2].show
    puts "#{from} went #{presence}: #{status}"
  end

  # Remove a user from your contact list:
  im.remove("[email protected]")

  # See the Jabber::Simple documentation for more information.

= Description

Jabber::Simple is intended to make Jabber client programming dead simple. XMPP,
the Jabber protocol, is extremely powerful but also carries a steep learning
curve. This library exposes only the most common tasks, and does so in a way
that is familiar to users of traditional instant messenger clients.

= Known Issues

* None. If you'd like additional functionality, please contact the developer!

= Copyright

Jabber::Simple - An extremely easy-to-use Jabber client library.
Copyright 2006-2008 Blaine Cook <[email protected]>.

Jabber::Simple is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Jabber::Simple is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Jabber::Simple; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

xmpp4r-simple's People

Contributors

blaine 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

xmpp4r-simple's Issues

[PATH] Add ability to register new users with the jabber server

Originally submitted by saimonmoore with a path included; please refer to http://code.google.com/p/xmpp4r-simple/issues/detail?id=6#makechanges

Simple usage:

im = Jabber::Simple.register(jid, passwd)

  • will try and register user on the server
  • if successfull, will reconnect and send default status presence
  • if not successfull, throws a RegistrationError with a detailed message

self.register method signature:

self.register(jid, password, status = nil, status_message = "Available") #So you can still provide
custom status after registration

Testing instability

There are several problems with the approach to testing; admittedly, Jabber isn't an easy protocol to test, but I believe every single one of the features involved in xmpp4r-simple should be mocked to include no networking, and certainly no real Jabber accounts.

This would resolve intermittent errors due to network latency et al. It would also make writing further tests much simpler (and therefore more probable). Also, it will help with having to deal with side-effects of previous tests (if there are any) due to the external dependency.

Personally, it's painful and disheartening to sit there with the tests failing due to network problems, especially when they sit there for 20 seconds for each network-sensitive test.

Deferred message delivery spikes CPU usage to 100%

This is directly related to:

http://code.google.com/p/xmpp4r-simple/issues/detail?id=7#makechanges

The culprit is start_deferred_delivery_thread with the following code:

def start_deferred_delivery_thread #:nodoc:
Thread.new {
  loop {
    messages = [queue(:pending_messages).pop].flatten
    messages.each do |message|
      if subscribed_to?(message[:to])
        deliver(message[:to], message[:message], message[:type])
      else
        queue(:pending_messages) << message
      end
    end
  }
}

end

The loop has absolutely no sleep time and will run at max speed, continually dequeueing and queueing until there is no more CPU power left, then it keeps going until nothing else runs on your computer (unless you've got god/monit monitoring it) until the subscription actually occurs.

In my production environment, this is asynchronous, and can occur even upwards of days later, and I'd rather not have my CPU raped for that long.

Problem with tests and adding incorrect JIDs to roster

I've noticed that occasionally, in some situations, the tests that add clients to the roster, instead of adding [email protected], will add #jabber::simple:0x0xxxxxx as the JID. This is obviously wrong.

I was not able to pinpoint where exactly the problem was originating from (which tests, specifically).

I'm on xmpp4r-simple 0.8.8 (latest gem version) and xmpp4r 0.4.

cannot send directly to a specific resource

What steps will reproduce the problem?

  1. try to send a message to user/resource using a string or a jid object.

What is the expected output? What do you see instead?

I want it to only send to the specific resource.

What version of the product are you using? On what operating system?

Ubuntu Linux + 'ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]' + xmpp4r (0.5) + xmpp4r-simple (0.8.8)

gem install rcov

ruby 2.3.1

gem install rcov

Building native extensions.  This could take a while...
ERROR:  Error installing rcov:
    ERROR: Failed to build gem native extension.

compiling 1.8/callsite.c
1.8/callsite.c:2:17: fatal error: env.h:

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.