Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 36 lines (30 sloc) 0.995 kb
2e95078 Tom Preston-Werner force Jabber::Simple to send messages
mojombo authored
1 # Jabber::Simple does some insane kind of queueing if it thinks
2 # we are not in their buddy list (which is always) so messages
3 # never get sent before we disconnect. This forces the library
4 # to assume the recipient is a buddy.
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
5 class ::Jabber::Simple
2e95078 Tom Preston-Werner force Jabber::Simple to send messages
mojombo authored
6 def subscribed_to?(x); true; end
7 end
8
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
9 class Service::Jabber < Service
10 def receive_push
11 repository = payload['repository']['name']
12 branch = payload['ref_name']
2e95078 Tom Preston-Werner force Jabber::Simple to send messages
mojombo authored
13
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
14 # Accept any friend request
15 im.accept_subscriptions = true
2e95078 Tom Preston-Werner force Jabber::Simple to send messages
mojombo authored
16
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
17 #Split multiple addresses into array, removing duplicates
18 recipients = data['user'].split(',').uniq.collect(&:strip)
98a4804 Ruslan Nigmatullin Added asynchronious message delivery for jabber hook
euroelessar authored
19 messages = []
20 messages << "#{summary_message}: #{summary_url}"
21 messages += commit_messages
22 message = messages.join("\n")
3fcc4ff Preston Marshall Added multiple-user support to the jabber plugin.
bbhoss authored
23
98a4804 Ruslan Nigmatullin Added asynchronious message delivery for jabber hook
euroelessar authored
24 recipients.each do |recipient|
25 im.deliver_deferred recipient, message, :chat
3fcc4ff Preston Marshall Added multiple-user support to the jabber plugin.
bbhoss authored
26 end
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
27 end
28
98a4804 Ruslan Nigmatullin Added asynchronious message delivery for jabber hook
euroelessar authored
29 # attr_writer :im
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
30 def im
98a4804 Ruslan Nigmatullin Added asynchronious message delivery for jabber hook
euroelessar authored
31 @im ||= begin
32 ::Jabber::Simple.new(secrets['jabber']['user'], secrets['jabber']['password'])
33 end
5a4dc7d risk danger olson port disabled jabber hook
technoweenie authored
34 end
e177d60 Jorge Bernal Added jabber service
koke authored
35 end
Something went wrong with that request. Please try again.