Modifying Chat service

Need help? Post your questions here.

Moderator: moderators

Modifying Chat service

Postby neodawg » Tue Dec 20, 2011 6:21 pm

I am looking for some help modifying the subsonic chat

I am hoping to just simply change it so messages expire after 3 days, I have tried doing it via a hack solution of changing the MAX_MESSAGES to 1000 in the ChatService.java file. This however doesnt seem to work, it still deletes the 1st message when the 11th message is posted.

Note: I have no experience with java programming or much programming experience at all other than some php and html. With that said I have managed to setup eclipse and get subsonic to compile/install, I have successfully changed the share url domain for the sharing feature on SubSonic.

Code: Select all
   
private static final Object CACHE_KEY = 1;
private static final int MAX_MESSAGES = 1000;
private static final long TTL_MILLIS = 3L * 24L * 60L * 60L * 1000L; // 3 days.


If someone with java experience could give me a hand in tweaking this it would much appreciated.

For testing i have been just extracting the changed .class file from the newly compiled war and then adding/updating the war on my server and restarting the SS service.

EDIT: Server is Server 2008R2, mem limit 1gig, SS version 4.6


Thanks for any help.

neodawg
Music Collection--
2,890 artists
8,253 albums
103,492 songs
640.11 GB
7,023 hours
neodawg
 
Posts: 51
Joined: Fri Feb 12, 2010 2:51 pm

Re: Modifying Chat service

Postby ytechie » Mon Jan 02, 2012 11:12 pm

After playing with the right.jsp, but not the java files, I gave up on modifying the chat service.

However, I do know that if you manage to edit the java files correctly, you still need to modify right.jsp to reflect those changes.
Specifically, this:

Code: Select all
for (var i = 0; i < messages.messages.length; i++) {
                var message = messages.messages[i];
                var id = i + 1;
                dwr.util.cloneNode("pattern", { idSuffix:id });
                dwr.util.setValue("user" + id, message.username);
                dwr.util.setValue("date" + id, " [" + formatDate(message.date) + "]");
                dwr.util.setValue("content" + id, message.content);
                $("pattern" + id).show();
            }


Can you see what it is doing?

It is re-writing all the chat messages onto the screen. It clones the first row 9 times. You have to change i < messages.messages.length to the number of messages the backend will keep.

Or, you could change the value of messages.messages.length.
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Modifying Chat service

Postby fonsoy » Tue Apr 10, 2012 11:40 pm

I have tried to edit the static final int MAX_MESSAGES as well. It failed, as expected now I read.

I would love to hear from somebody who got this working.
fonsoy
 
Posts: 38
Joined: Mon Jan 10, 2011 12:07 pm

Re: Modifying Chat service

Postby ytechie » Wed Apr 11, 2012 4:42 am

A while back I looked through the java source code, and the chat size was hard coded into the backend.
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Modifying Chat service

Postby neodawg » Wed Apr 11, 2012 4:51 pm

ytechie wrote:A while back I looked through the java source code, and the chat size was hard coded into the backend.



Can you explain hard coded, would you be able to change that there?
Music Collection--
2,890 artists
8,253 albums
103,492 songs
640.11 GB
7,023 hours
neodawg
 
Posts: 51
Joined: Fri Feb 12, 2010 2:51 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 23 guests