cinch-hangouts 1.0.3 → 1.0.4
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.
@@ -45,11 +45,12 @@ module Cinch::Plugins
|
|
45
45
|
def process_hangout(hangout_id, m)
|
46
46
|
if Hangout.find_by_id(hangout_id)
|
47
47
|
# If it's an old hangout capture a new expiration time
|
48
|
+
hangout = Hangout.find_by_id(hangout_id)
|
48
49
|
hangout.time = Time.now
|
49
50
|
hangout.save
|
50
51
|
else
|
51
|
-
|
52
|
-
|
52
|
+
Hangout.new(m.user.nick, hangout_id, Time.now)
|
53
|
+
.save
|
53
54
|
Subscription.notify(hangout_id, @bot)
|
54
55
|
end
|
55
56
|
end
|
@@ -61,7 +62,7 @@ module Cinch::Plugins
|
|
61
62
|
else
|
62
63
|
sub = Subscription.new(nick)
|
63
64
|
sub.save
|
64
|
-
msg = 'You are now subscribed.' +
|
65
|
+
msg = 'You are now subscribed. ' +
|
65
66
|
'I will let you know when a hangout is linked. '
|
66
67
|
end
|
67
68
|
m.user.notice msg + 'To unsubscribe use `.hangouts unsubscribe`.'
|
@@ -3,10 +3,6 @@
|
|
3
3
|
class Subscription < Cinch::Plugins::Hangouts
|
4
4
|
attr_accessor :nick, :all_links
|
5
5
|
|
6
|
-
def to_yaml
|
7
|
-
{}
|
8
|
-
end
|
9
|
-
|
10
6
|
def initialize(nick)
|
11
7
|
@nick = nick
|
12
8
|
@all_links = false
|
@@ -31,17 +27,17 @@ class Subscription < Cinch::Plugins::Hangouts
|
|
31
27
|
end
|
32
28
|
|
33
29
|
def self.list
|
34
|
-
|
30
|
+
storage.data
|
35
31
|
end
|
36
32
|
|
37
33
|
def self.notify(hangout_id, bot)
|
38
34
|
nick = Hangout.find_by_id(hangout_id).nick
|
39
|
-
|
35
|
+
list.each_value do |s|
|
40
36
|
# Don't link the person who linked it.
|
41
|
-
if nick !=
|
42
|
-
user = Cinch::User.new(
|
43
|
-
|
44
|
-
|
37
|
+
if nick != s.nick
|
38
|
+
user = Cinch::User.new(s.nick, bot)
|
39
|
+
user.msg("#{nick} just linked a new hangout at: " +
|
40
|
+
Hangout.url(hangout_id))
|
45
41
|
end
|
46
42
|
end
|
47
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-hangouts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|