xrc 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/xrc/client.rb +17 -9
- data/lib/xrc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc17ab04c17f6d41c5d1edad4c46e6e6b1d12a80
|
|
4
|
+
data.tar.gz: d0a3195fa27404f84b970e4466c58596f3580163
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f601f606af18e481a571335a7129a6e6d14d4e7ae2a9e845aa5ee6f0b02270bd5ed8d69552c2fb918749700622ab0b626a9281d1e5941d454648cd89acb932a2
|
|
7
|
+
data.tar.gz: 74eb1936d5da2720c12c48412fe73d214ae553bdb8989fcaa41301cc049b55aa4184152630d58dcfcccc6d3d650623cce6c41931f67709db1a76f850ac68cd8e
|
data/CHANGELOG.md
CHANGED
data/lib/xrc/client.rb
CHANGED
|
@@ -92,6 +92,23 @@ module Xrc
|
|
|
92
92
|
)
|
|
93
93
|
end
|
|
94
94
|
|
|
95
|
+
# Send a message
|
|
96
|
+
# @option options [String] :body Message body
|
|
97
|
+
# @option options [String] :from Sender's JID
|
|
98
|
+
# @option options [String] :to Address JID
|
|
99
|
+
# @option options [String] :type Message type (e.g. chat, groupchat)
|
|
100
|
+
# @return [REXML::Element] Returns an element sent to server
|
|
101
|
+
# @example
|
|
102
|
+
# client.say(body: "Thanks", from: "alice@example.com", to: "bob@example.com", type: "chat")
|
|
103
|
+
def say(options)
|
|
104
|
+
post Elements::Message.new(
|
|
105
|
+
body: options[:body],
|
|
106
|
+
from: options[:from],
|
|
107
|
+
to: options[:to],
|
|
108
|
+
type: options[:type],
|
|
109
|
+
)
|
|
110
|
+
end
|
|
111
|
+
|
|
95
112
|
# @return [String] Mention name of this account
|
|
96
113
|
# @example
|
|
97
114
|
# client.mention_name #=> "alice"
|
|
@@ -298,15 +315,6 @@ module Xrc
|
|
|
298
315
|
post(Elements::Auth.new(jid: jid, password: password))
|
|
299
316
|
end
|
|
300
317
|
|
|
301
|
-
def say(options)
|
|
302
|
-
post Elements::Message.new(
|
|
303
|
-
body: options[:body],
|
|
304
|
-
from: options[:from],
|
|
305
|
-
to: options[:to],
|
|
306
|
-
type: options[:type],
|
|
307
|
-
)
|
|
308
|
-
end
|
|
309
|
-
|
|
310
318
|
def start_ping_thread
|
|
311
319
|
Thread.new do
|
|
312
320
|
loop do
|
data/lib/xrc/version.rb
CHANGED