github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

msparks / irssiscripts

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Scripts for the Irssi IRC client — Read more

  cancel

http://quadpoint.org/projects/irssiscripts

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

bumping version and change date 
msparks (author)
Mon Feb 08 17:18:16 -0800 2010
commit  07f77deb13165e61efaa1488422f1e73a447b281
tree    b9da7850542c5d30624c1049f2834183213f37f0
parent  51c4411f9120009d8b38ad57c39262306461ff93
irssiscripts / bitlbee_autoreply.pl bitlbee_autoreply.pl
100644 63 lines (49 sloc) 1.742 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Sends autoreplies to IM users when they message while you are away.
#
# SETTINGS
# [bitlbee]
# bitlbee_autoreply_duration = OFF
# -> Send how long you have been away in your auto-reply. This requires
# Time::Duration.
# Example auto-reply: "gone (away: 3 minutes and 2 seconds)"
use strict;
use Irssi;
use Time::Duration qw/duration_exact/;
 
use vars qw($VERSION %IRSSI);
 
$VERSION = '0.12';
%IRSSI = (
  authors => 'Matt "f0rked" Sparks',
  contact => 'ms+irssi@quadpoint.org',
  name => 'bitlbee status notice',
  description => 'Sends autoreplies to IM users while you are away',
  license => 'GPLv2',
  url => 'http://quadpoint.org',
  changed => '2005-12-04',
);
 
my $bitlbee_channel = "&bitlbee";
my $bitlbee_server_tag = "IM";
 
my(%times, $away, $away_time);
 
 
sub away
{
  $away_time=time;
  %times=();
}
 
 
sub event_msg
{
  my($server, $msg, $nick, $address, $target) = @_;
  return if $server->{tag} ne $bitlbee_server_tag;
  return unless $server->{usermode_away};
  #return unless $address =~ /\@login\.oscar\.aol\.com$/; # Only send for AIM.
  return unless !$target or ($target eq $bitlbee_channel and $nick ne "root");
  return unless time - $times{$nick} > 3600; # send an auto-reply once an hour.
 
  $times{$nick} = time;
  my $append;
  if (Irssi::settings_get_bool("bitlbee_autoreply_duration") && $away_time) {
    $append = " (away: " . duration_exact(time - $away_time) . ")";
  }
 
  $server->command("/notice $nick $server->{away_reason}$append");
}
 
 
Irssi::signal_add("message private", "event_msg");
Irssi::signal_add("message public", "event_msg");
Irssi::signal_add("away mode changed", "away");
 
Irssi::settings_add_bool("bitlbee", "bitlbee_autoreply_duration", 0);
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server