File: 01_chat-message-fix

package info (click to toggle)
nagzilla 2.0-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 504 kB
  • sloc: perl: 272; sh: 191; makefile: 17
file content (23 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Author: Gerfried Fuchs <rhonda@debian.at>	vim:ft=diff:
Description: Allows handing over complete JIDs for room and chat types

Index: nagzilla-1.5.4-2/nagzilla/nagzillad.pl
===================================================================
--- nagzilla-1.5.4-2.orig/nagzilla/nagzillad.pl
+++ nagzilla-1.5.4-2/nagzilla/nagzillad.pl
@@ -116,12 +116,12 @@ $mess = "@clientin[2]";
 	my $message = Net::Jabber::Message->new();
 	if ($style eq "room") { 
 		$message->SetMessage( "type"	=> 'groupchat',
-							  "to"		=> "$roomy\@$confserver",
+							  "to"		=> $roomy =~ /@/ ? $roomy : "$roomy\@$confserver",
 							  "type"	=> 'chat',
 							  "body"	=> "$mess" );
 
 				} else { 
-	         $message->SetMessage ( "to"		=> "$roomy\@$jabberserver",
+	         $message->SetMessage ( "to"		=> $roomy =~ /@/ ? $roomy : "$roomy\@$jabberserver",
 					"subject"	=> "Monitoring Alert",
 					"type"		=> 'chat',
 					"body" 		=> "$mess" );