| 1 | =head1 NAME | ||
| 2 | |||
| 3 | Net::RVP::Sink - base clase for RVP event sinks | ||
| 4 | |||
| 5 | =head1 DESCRIPTION | ||
| 6 | |||
| 7 | These methods are invoked on your event sink object. | ||
| 8 | |||
| 9 | =cut | ||
| 10 | package Net::RVP::Sink; | ||
| 11 | |||
| 12 | use strict; | ||
| 13 | |||
| 14 | use HTTP::Status; | ||
| 15 | |||
| 16 | |||
| 17 | =head2 new | ||
| 18 | |||
| 19 | Create new sink object; called only if user doesn't provide a sink. | ||
| 20 | |||
| 21 | =cut | ||
| 22 | sub new { | ||
| 23 | my $class = shift; | ||
| 24 | return bless {}, ref $class || $class; | ||
| 25 | } | ||
| 26 | |||
| 27 | |||
| 28 | =head2 RVP | ||
| 29 | |||
| 30 | Set/get RVP object. | ||
| 31 | |||
| 32 | =cut | ||
| 33 | sub RVP { | ||
| 34 | my $self = shift; | ||
| 35 | $self->{rvp} = shift if @_; | ||
| 36 | return $self->{rvp}; | ||
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | =head2 change_event ( RVP::User, ( key => value ) ... ) | ||
| 41 | |||
| 42 | Property change event. | ||
| 43 | |||
| 44 | =cut | ||
| 45 | sub change_event { | ||
| 46 | return HTTP::Response->new(RC_OK, 'Change Notification Accepted'); | ||
| 47 | } | ||
| 48 | |||
| 49 | |||
| 50 | =head2 open_event ( RVP::Session ) | ||
| 51 | |||
| 52 | Starting a new conversation (incoming only, not notified of ones we begin). | ||
| 53 | This doesn't need to return anything. | ||
| 54 | |||
| 55 | =cut | ||
| 56 | sub open_event { | ||
| 57 | # do nothing | ||
| 58 | } | ||
| 59 | |||
| 60 | |||
| 61 | =head2 close_event ( RVP::Session ) | ||
| 62 | |||
| 63 | Ending (or leaving) a session. | ||
| 64 | |||
| 65 | =cut | ||
| 66 | sub close_event { | ||
| 67 | # do nothing | ||
| 68 | } | ||
| 69 | |||
| 70 | |||
| 71 | =head2 join_event ( RVP::Session, RVP::User ) | ||
| 72 | |||
| 73 | New user joining conversation. | ||
| 74 | |||
| 75 | =cut | ||
| 76 | sub join_event { | ||
| 77 | return HTTP::Response->new(RC_OK, 'User Joined Conversation'); | ||
| 78 | } | ||
| 79 | |||
| 80 | |||
| 81 | =head2 part_event ( RVP::Session, RVP::User ) | ||
| 82 | |||
| 83 | User left conversation. | ||
| 84 | |||
| 85 | =cut | ||
| 86 | sub part_event { | ||
| 87 | return HTTP::Response->new(RC_OK, 'User Left Conversation'); | ||
| 88 | } | ||
| 89 | |||
| 90 | |||
| 91 | =head2 typing_event ( RVP::Session, RVP::User ) | ||
| 92 | |||
| 93 | User is typing. | ||
| 94 | |||
| 95 | =cut | ||
| 96 | sub typing_event { | ||
| 97 | return HTTP::Response->new(RC_OK, 'User Is Typing'); | ||
| 98 | } | ||
| 99 | |||
| 100 | |||
| 101 | =head2 message_event ( RVP::Session, RVP::User, text ) | ||
| 102 | |||
| 103 | User sent message. | ||
| 104 | |||
| 105 | =cut | ||
| 106 | sub message_event { | ||
| 107 | return HTTP::Response->new(RC_OK, 'Message Received'); | ||
| 108 | } | ||
| 109 | |||
| 110 | |||
| 111 | =head1 AUTHOR | ||
| 112 | |||
| 113 | David Robins E<lt>dbrobins@davidrobins.netE<gt>. | ||
| 114 | |||
| 115 | =head1 SEE ALSO | ||
| 116 | |||
| 117 | L<RVP>. | ||
| 118 | |||
| 119 | =cut | ||
| 120 | |||
| 121 | |||
| 122 | 1; | ||
| 123 |