ignore OTR messages over Jabber (I think)
darcs-hash:20080806002134-84dde-1674375f840a61ce469be784805a969beff35f43.gz
This commit is contained in:
		@@ -172,6 +172,9 @@ class XMPPDaemon {
 | 
				
			|||||||
		} else if ($this->is_autoreply($pl['body'])) {
 | 
							} else if ($this->is_autoreply($pl['body'])) {
 | 
				
			||||||
			$this->log(LOG_INFO, 'Ignoring auto reply from ' . $from);
 | 
								$this->log(LOG_INFO, 'Ignoring auto reply from ' . $from);
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
 | 
							} else if ($this->is_otr($pl['body'])) {
 | 
				
			||||||
 | 
								$this->log(LOG_INFO, 'Ignoring OTR from ' . $from);
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			$this->add_notice($user, $pl);
 | 
								$this->add_notice($user, $pl);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -185,6 +188,14 @@ class XMPPDaemon {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						function is_otr($txt) {
 | 
				
			||||||
 | 
							if (preg_match('/^\?OTR/', $txt)) {
 | 
				
			||||||
 | 
								return true;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	function from_site($address, $msg) {
 | 
						function from_site($address, $msg) {
 | 
				
			||||||
		$text = '['.common_config('site', 'name') . '] ' . $msg;
 | 
							$text = '['.common_config('site', 'name') . '] ' . $msg;
 | 
				
			||||||
		jabber_send_message($address, $text);
 | 
							jabber_send_message($address, $text);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user