powered by Jive Software

Modified monitoring.jar plugin supporting "block user" and "off the record" feature

Hi. Everyone.

Nice see you here.

I am scott from gaucho.net, a .NET programmer primarly.

I am working on gaucho.net’s web chat function. I build it using openfire as jabber server. Using monitoring plugin to track members chat history. This week, my customer stongly wants the “block user” and “off the record” feature. (Check my attachment). After check openfire and jabber client library, I realize there is not such feature in openfire. And because “block user” and “off the record” are one-to-one feature, which means monitoring plugin doesn’t support it too.

After few thought, I decided to add it to monitoring plugin. In my view, monitoring plugin is the correct place to start. Because I have to control chat history track process.

So my first JAVA program started from here.

Through 3 days hard working for JAVA plugin part and our jabber proxy and our web chat client, I believe the “block user” and “off the record” are correctly implement and it works. JAVA looks nearly same to C# and easy to use. Just the building process (ant plugins) takes a real long time which makes me sleepy each time it build.

Build->compling->packing. Stop openfire->replace plugin-> start openfire->test->checking log.

Sign~~~

When can Java has a real IDE like visual studio

Back to track, I pasted my code and ms_sql.sql here so if anyone need same feature he can use this. I am an opensource fans and respect people’s work. Openfire devs are awesome! All of you are awesome.

Here is steps to use my monitoring plugin:

  1. create ofBanUser and ofOffRecordTable

CREATE TABLE [dbo].[ofBanUser](
[id] [int] IDENTITY(1,1) NOT NULL,
[jid] nvarchar NOT NULL,
[peerJid] nvarchar NOT NULL,
CONSTRAINT [PK_ofBanUser] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY];

CREATE NONCLUSTERED INDEX IX_ofBanUser_ban ON dbo.ofBanUser
(
jid,
peerJid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];

CREATE TABLE [dbo].[ofOffRecord](
[id] [int] IDENTITY(1,1) NOT NULL,
[jid] nvarchar NOT NULL,
[peerJid] nvarchar NOT NULL,
CONSTRAINT [PK_ofOffRecord] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY];

CREATE NONCLUSTERED INDEX IX_ofOffRecord_offrecord ON dbo.ofOffRecord
(
jid,
peerJid
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];

  1. Replace following files with mine, then use ‘ant plugins’ to build monitoring plugin.

Archive/ConversationManager.java

Archive/ArchiveInterceptor.java

  1. deploy your new plugin to openfire plugin folder.

  2. During chat, when you want to block/off record

Create a message without body, if body, we will treat this message as ‘event’, not ‘user message’

Message msg = new agsXMPP.protocol.client.Message();
msg.Type = MessageType.chat;
msg.To = new Jid(toUser);
msg.Attributes.Add(“action”, action);
XmppCon.Send(msg);

Add a attribute “action”,

“action” support 4 actions:

  1. “block” - this will block all messages between you 2.

  2. “unblock” - this will remove your block. if peer still block you, you 2 can’t talk either.

  3. “off_record” - this will turn off the monitoring’s message archive feature for you 2. All your chat will not be SAVED.

  4. “on_record” - this will reenable the message archive feature. All your chat will be SAVED.

BTW, don’t forget to turn on the one-to-one message chat in monitoring’s setting page. I didn’t touch that.

That’s all.

Welcome any comment, if you need few help, see may I could give a hand.

macromarship@gmail.com

Thanks all for reading.

Scott Zhang

BTW, you can check http://gaucho.net next week to see how it works. I will deploy our chat feature to live next week. And welcome check our gaucho.net too.

Does this work with only the web client, or is this something that can be utilized from Spark (the windows client)?

We’d rather not deploy pidgin everywhere (since there is an OTR plugin) since we already have spark on nearly every workstation. I’m hoping to find an OTR like install that works with Spark.

-Rich

Hi. Rich.

Actually I was talking about the server side, my post add the OTR and block feature to monitor plugin, because openfire keep the chat history by monitor plugin.

For OTR feature, it can’t be simply solved by client side, in your words, spark plugin things like. Even if there is a plugin on spark, without support on openfire side, OTR can’t work.

So for you, I think you need a plugin support OTR and a corresponding server side plugin to make them work tegother. I don’t see it so far. That’s why I did it myself.

Regards.

Scott

Has this been merged with upstream?