Is there a way to receive messages through XMPP in Rails? - ruby-on-rails

Is there a way to receive Facebook chat/messages through XMPP in Rails? I've checked with xmpp4r_facebook but so far I can only send messages with it. Thanks!

You should be able to set a message callback using add_message_callback. The echo example from xmpp4r should get you started: https://github.com/ln/xmpp4r/blob/master/data/doc/xmpp4r/examples/basic/echo.rb.

Related

How to debug the rails mailer

I am using mandril mailer, I have set up my mailers and everything was working fine, at some point the mailer stopped working, I am trying to send a message from the rails console
TaskCompletedMailer.client_created(email: 'mymail#gmail.com').deliver
I am getting a message in the console that the email has been delivered.
[{"email"=>"mymail#gmail.com", "status"=>"sent", "_id"=>"184e03d40a874fa892b5549173ccba80", "reject_reason"=>nil}]
but the mail is not been delivered into my account.
How can I debug that ?
Check in the logs what can you see there. Probalby the action_mailer config is not correct for your current enviroment.
You can try to use a protocol analyzer, such as Wireshark, to monitor the SMTP traffic on your network card and so check how realy the rails app sends to it.

Sinch Client works but messages aren't being sent

I'm using sinch and I've gotten the client to work by registering a user, but I can't send a message. When I click my send button, nothing happens. The required methods that need to be implemented, such as messageFailed(), messageDelivered(), etc. are not being called either. Does anyone know why?
Have you registered the one more user? Can you enable logging and share the full log output.
See comment below, user tried to send message to self

Storing chat messages with an irc bot

I am trying to code a simple irc bot that detects if a word is inside a chat message and then saves that message to a file. I have the correct 'on text' event set up, but I don't know how to access the message that was sent so I can save it.
on *:TEXT:*txt*:#:
{
var %message $msg
writeini Log.ini Message value %message
}
$msg is clearly wrong. Is there an identifier to have my bot access the messages in the chat, or is there a completely different way to do this? I can't seem to find anything online about this either.

MUC implemention on ejabberd server using xmppFramework

I want to know that is it possible to create a chatroom and invite people ? I have setup ejabberd on my mac and implemented chat with single buddy following
this link but i want to implement MUC. I tried demo project of MUC which come with xmppframework available here ,but every time i get error 404 remote server not found. The delegate method
- (void)xmppRoomDidCreate:(XMPPRoom *)sender;
never gets called.
Instead
- (void)handleDidLeaveRoom:(XMPPRoom *)room
this method gets called. Has anyone successfully implemented MUC using localhost as server?If yes then please let me know the XMPP client you are using , because for ejabberd,it says remote server not found.
Did you try with conference.host (presumably conference.localhost) as MUC host ?

Facebooker Rails plugin - Notifications

I have quite silly question: how to send notifications?
For example, when I register user on my app, I want to welcome him/her with
notification.
Assuming you're using Facebooker (which, really, you should be), you can create a Publisher class.
You can also use facebook_session.send_notification([user_fb_id], "notification message") (in your controller). This will be an app-to-user notification, and you have a limited number that you can send to users each week.
To see this limit you can use the following call:
Facebooker::Session.create.post('facebook.admin.getAllocation', :integration_point_name => 'announcement_notifications_per_week')

Resources