Jigar Bhatt
Jigar Bhatt

Reputation: 4650

how to remove chat in ejabber using ruby on rails

I know how to send but i don't know how to recive and delete it.

    jid = Jabber::JID.new('user')
    client = Jabber::Client.new(jid)
    client.connect('54.187.67.96',5222)
    client.auth('password')
    client.send(Jabber::Presence.new.set_show(:chat).set_status('Rails!'))


    # Send an Instant Message.
    body = 'Hello from Rails'
    to_jid = Jabber::JID.new('user')
    message = Jabber::Message::new(to_jid, body).set_type(:normal).set_id('1')
    client.send(message)

Upvotes: 0

Views: 156

Answers (1)

Nathaniel Waisbrot
Nathaniel Waisbrot

Reputation: 24473

See stream.rb for the code you're running. add_message_callback looks like the winner to me. Deleting a message is not core Jabber so you need to talk it over with the server.

Upvotes: 1

Related Questions