From 55a7e5c051bacf7f6661757a981defac0b7a6a7a Mon Sep 17 00:00:00 2001 From: Ilya Kalashnikov Date: Thu, 7 Sep 2017 12:03:22 +0500 Subject: [PATCH] Unique message id --- lib/xmpp_bot.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/xmpp_bot.rb b/lib/xmpp_bot.rb index 7b8bb56..f05aa4a 100644 --- a/lib/xmpp_bot.rb +++ b/lib/xmpp_bot.rb @@ -3,6 +3,7 @@ require 'forwardable' require 'singleton' require 'ap' +require 'securerandom' class Bot include Jabber @@ -226,7 +227,7 @@ def client end def deliver jid, message_text, message_type = :chat - message = Message.new(jid, message_text) + message = Message.new(jid, message_text).set_id(SecureRandom.uuid) message.type = message_type client.tap {|client| client.send(message) unless client.nil?