Changeset d5dcd7c for perl/modules/Jabber/lib/BarnOwl/Message/Jabber.pm
- Timestamp:
- Aug 21, 2008, 6:20:01 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 5b75e8b
- Parents:
- 57cf4f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/Jabber/lib/BarnOwl/Message/Jabber.pm
r38a7f22 rd5dcd7c 91 91 } 92 92 93 sub replycmd { 94 my $self = shift; 95 my ($recip, $account, $subject); 96 if ($self->is_loginout) { 97 $recip = $self->sender; 98 $account = $self->recipient; 99 } elsif ($self->jtype eq 'chat') { 100 return $self->replysendercmd; 101 } elsif ($self->jtype eq 'groupchat') { 102 $recip = $self->room; 103 if ($self->is_incoming) { 104 $account = $self->to; 105 } else { 106 $account = $self->from; 107 } 108 $subject = $self->subject; 109 } 110 return jwrite_cmd($recip, $account, $subject); 111 } 112 113 sub replysendercmd { 114 my $self = shift; 115 if($self->jtype eq 'groupchat' 116 || $self->jtype eq 'chat') { 117 my ($recip, $account); 118 if ($self->is_incoming) { 119 $recip = $self->from; 120 $account = $self->to; 121 } else { 122 $recip = $self->to; 123 $account = $self->from; 124 } 125 return jwrite_cmd($recip, $account); 126 } 127 return $self->replycmd; 128 } 129 130 sub jwrite_cmd { 131 my ($recip, $account, $subject) = @_; 132 if (defined $recip) { 133 my $cmd = "jwrite $recip -a $account"; 134 if (defined $subject) { 135 $cmd .= " -s $subject"; 136 } 137 return $cmd; 138 } else { 139 return undef; 140 } 141 } 93 142 94 143 =head1 SEE ALSO
Note: See TracChangeset
for help on using the changeset viewer.