lita-twitter 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/adapters/twitter/connector.rb +14 -7
- data/lib/lita/twitter/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: ba7a06c938a206af9c3165e968b27032dc2d0b08
|
4
|
+
data.tar.gz: 6cc6a871ed9f2efd7216c36cc5efcaf550873cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9828db77c6044ab250cffabab36d734b5f587b505a6e428a50a923a85a80acc438a903b13924117b4a8c3bd16c005bd65241d179b8da32171a9c82317e1f1e3f
|
7
|
+
data.tar.gz: dec70642141617ddc90e1d612568a2dcc3e218d5067d014b4dcfb3c22620415e10253a89b72754427964fae443ebad02083a253d44e8c0ada57aa90505724bf6
|
@@ -55,13 +55,20 @@ module Lita
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def message(target, strings)
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
58
|
+
tries = 0
|
59
|
+
text = strings.join("\n")[0...137]
|
60
|
+
begin
|
61
|
+
if target.private_message
|
62
|
+
rest_client.create_direct_message(target.user.name, text)
|
63
|
+
elsif target.user
|
64
|
+
rest_client.update(text, in_reply_to_status_id: target.room)
|
65
|
+
else
|
66
|
+
rest_client.update(text)
|
67
|
+
end
|
68
|
+
rescue Twitter::Error::DuplicateStatus => e
|
69
|
+
tries += 1
|
70
|
+
text += "⠀" #U+2800
|
71
|
+
retry if tries <= 3
|
65
72
|
end
|
66
73
|
end
|
67
74
|
|
data/lib/lita/twitter/version.rb
CHANGED