aMSN Forums
May 19, 2013, 06:07:10 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Question about the event 'event_msg_received'  (Read 1985 times)
leuko
Newbie

Offline Offline

Posts: 2


View Profile
« on: January 31, 2008, 04:09:04 am »

Today I wanted to write a plugin to count the sent and received messages. To do it I used the events 'event_msg_received' and 'event_msg_sent'. But when I send a message both events occur. Is this a normal feature?
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: January 31, 2008, 10:46:41 am »

Yes , this has already been answered in the forums, please search before asking next time.
The chat_msg_received event is sent whenever we write something in the chat window, to know if it's your own message or a message from someone else, simply do a check on the evpar(user) and check whether it's yourself or not.
Code:
if { $user != [::config::getKey login] } {
     incr msg_received
} else {
    incr msg_sent
}
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!