Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8aeca4f0
authored
Jan 15, 2015
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
login rivit pois irc-kanavalta
1 parent
55b433d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/moyamessage/IrcBotMoyaEventTopicListener.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/moyamessage/IrcBotMoyaEventTopicListener.java
View file @
8aeca4f
...
...
@@ -6,6 +6,7 @@ import javax.jms.JMSException;
import
javax.jms.Message
;
import
javax.jms.MessageListener
;
import
fi.codecrew.moya.utilities.moyamessage.MoyaEventType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -18,6 +19,10 @@ import fi.codecrew.moya.model.LanEvent;
import
fi.codecrew.moya.model.User
;
import
fi.codecrew.moya.utilities.moyamessage.MoyaEventMessage
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* Message-Driven Bean implementation class for: IrcBotTopicListener
*/
...
...
@@ -26,6 +31,8 @@ public class IrcBotMoyaEventTopicListener implements MessageListener {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
IrcBotMoyaEventTopicListener
.
class
);
private
static
List
<
MoyaEventType
>
ignoreTypes
=
Arrays
.
asList
(
MoyaEventType
.
LOGIN_SUCCESSFULL
);
@EJB
private
BotBean
botbean
;
...
...
@@ -42,6 +49,11 @@ public class IrcBotMoyaEventTopicListener implements MessageListener {
public
void
onMessage
(
Message
message
)
{
try
{
MoyaEventMessage
msg
=
message
.
getBody
(
MoyaEventMessage
.
class
);
// do not flood irc-channel, message only really needed ones
if
(
msg
.
getEventtype
()
!=
null
&&
ignoreTypes
.
contains
(
msg
.
getEventtype
()))
return
;
String
event
=
"unknown event"
;
if
(
msg
.
getEventId
()
!=
null
)
{
LanEvent
e
=
eventfacade
.
find
(
msg
.
getEventId
());
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment