Changeset b2648bc for perl/modules/jabber.pl
- Timestamp:
- Jan 25, 2007, 12:03:54 AM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 71e33ca
- Parents:
- 45d9eb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/jabber.pl
r45d9eb0 rb2648bc 97 97 server => $args{server}); 98 98 } 99 $jid = $jid->GetJID('base') if UNIVERSAL::isa($jid, 'Net:: Jabber::JID');99 $jid = $jid->GetJID('base') if UNIVERSAL::isa($jid, 'Net::XMPP::JID'); 100 100 101 101 foreach my $muc ($self->MUCs) { … … 266 266 } 267 267 if ($vars{status_changed}) { 268 my $p = new Net:: XMPP::Presence;268 my $p = new Net::Jabber::Presence; 269 269 $p->SetShow($vars{show}) if $vars{show}; 270 270 $p->SetStatus($vars{status}) if $vars{status}; … … 415 415 sub cmd_login { 416 416 my $cmd = shift; 417 my $jid = new Net:: XMPP::JID;417 my $jid = new Net::Jabber::JID; 418 418 $jid->SetJID(shift); 419 419 my $password = ''; … … 830 830 $name = "" unless (1 == scalar(@ARGV)); 831 831 832 my $p = new Net:: XMPP::Presence;832 my $p = new Net::Jabber::Presence; 833 833 $p->SetType('subscribe'); 834 834 … … 849 849 my $baseJID = baseJID($jid); 850 850 851 my $p = new Net:: XMPP::Presence;851 my $p = new Net::Jabber::Presence; 852 852 $p->SetType('unsubscribe'); 853 853 foreach my $to (@ARGV) { … … 872 872 foreach my $to (@ARGV) { 873 873 my %jq = $roster->query($to); 874 my $iq = new Net:: XMPP::IQ;874 my $iq = new Net::Jabber::IQ; 875 875 $iq->SetType('set'); 876 876 my $item = new XML::Stream::Node('item'); … … 912 912 my $baseJID = baseJID($jid); 913 913 914 my $iq = new Net:: XMPP::IQ;914 my $iq = new Net::Jabber::IQ; 915 915 $iq->SetType('set'); 916 916 my $item = new XML::Stream::Node('item'); … … 931 931 my $baseJID = baseJID($jid); 932 932 933 my $p = new Net:: XMPP::Presence;933 my $p = new Net::Jabber::Presence; 934 934 $p->SetType('subscribed'); 935 935 foreach my $to (@ARGV) { … … 947 947 my $baseJID = baseJID($jid); 948 948 949 my $p = new Net:: XMPP::Presence;949 my $p = new Net::Jabber::Presence; 950 950 $p->SetType('unsubscribed'); 951 951 foreach my $to (@ARGV) { … … 961 961 my $body = shift; 962 962 963 my $j = new Net:: XMPP::Message;963 my $j = new Net::Jabber::Message; 964 964 $body =~ s/\n\z//; 965 965 $j->SetMessage( … … 978 978 } 979 979 980 $j->RemoveFrom(); # Kludge to get around gtalk's random bits after the resou ce.980 $j->RemoveFrom(); # Kludge to get around gtalk's random bits after the resource. 981 981 if ($vars{jwrite}{sid} && $conn->sidExists( $vars{jwrite}{sid} )) { 982 982 $conn->getConnectionFromSid($vars{jwrite}{sid})->Send($j); … … 1114 1114 # Find a connection to reply with. 1115 1115 foreach my $jid ($conn->getJIDs()) { 1116 my $cJID = new Net:: XMPP::JID;1116 my $cJID = new Net::Jabber::JID; 1117 1117 $cJID->SetJID($jid); 1118 1118 if ($to eq $cJID->GetJID('base') || … … 1189 1189 " -a " . ( ( $dir eq 'out' ) ? $props{from} : $props{to} ); 1190 1190 $props{private} = 1; 1191 1192 my $connection; 1193 if ($dir eq 'in') { 1194 $connection = $conn->getConnectionFromSid($props{sid}); 1195 } 1196 else { 1197 $connection = $conn->getConnectionFromJID($props{from}); 1198 } 1199 1200 # Check to see if we're doing personals with someone in a muc. 1201 # If we are, show the full jid because the base jid is the room. 1202 if ($connection) { 1203 $props{sender} = $props{from} 1204 if ($connection->FindMUC(jid => $from)); 1205 $props{recipient} = $props{to} 1206 if ($connection->FindMUC(jid => $to)); 1207 } 1191 1208 } 1192 1209 elsif ( $jtype eq 'groupchat' ) { … … 1281 1298 sub baseJID { 1282 1299 my $givenJIDStr = shift; 1283 my $givenJID = new Net:: XMPP::JID;1300 my $givenJID = new Net::Jabber::JID; 1284 1301 $givenJID->SetJID($givenJIDStr); 1285 1302 return $givenJID->GetJID('base'); … … 1288 1305 sub resolveConnectedJID { 1289 1306 my $givenJIDStr = shift; 1290 my $givenJID = new Net:: XMPP::JID;1307 my $givenJID = new Net::Jabber::JID; 1291 1308 $givenJID->SetJID($givenJIDStr); 1292 1309 … … 1306 1323 1307 1324 foreach my $jid ( $conn->getJIDs() ) { 1308 my $cJID = new Net:: XMPP::JID;1325 my $cJID = new Net::Jabber::JID; 1309 1326 $cJID->SetJID($jid); 1310 1327 if ( $givenJIDStr eq $cJID->GetJID('base') ) {
Note: See TracChangeset
for help on using the changeset viewer.