Commit c0af1820 authored by daryl herzmann's avatar daryl herzmann

Merge pull request #367 from akrherz/of967

OF-967 add option to use Name as nickname for muc bookmark
parents da205c4d bbbd15bf
......@@ -43,6 +43,10 @@
<h1>
Client Control Plugin Changelog
</h1>
<p><b>1.3.1</b> -- Nov 08, 2015</p>
<ul>
<li>Added Name as a nickname option to Group Chat Bookmark.</li>
</ul>
<p><b>1.3.0</b> -- June 22, 2015</p>
<ul>
<li>Requires Openfire 3.11.0.</li>
......
......@@ -8,8 +8,8 @@
<name>Client Control</name>
<description>Controls clients allowed to connect and available features</description>
<author>Jive Software</author>
<version>1.2.0</version>
<date>6/22/2015</date>
<version>1.3.1</version>
<date>11/05/2015</date>
<minServerVersion>3.11.0</minServerVersion>
<databaseKey>clientcontrol</databaseKey>
<databaseVersion>0</databaseVersion>
......
......@@ -145,6 +145,7 @@ group.chat.bookmark.removed = Group chat bookmark removed.
group.chat.bookmark.name = Group Chat Name
group.chat.bookmark.address = Group Chat Address
group.chat.bookmark.autojoin = Auto-Join
group.chat.bookmark.nameasnick = Name as a nick
group.chat.bookmark.users = user(s)
group.chat.bookmark.groups = group(s)
group.chat.bookmark.none = You do not currently have any group chat bookmarks. Click the 'add group chat bookmark' to add a new group chat room.
......@@ -198,5 +199,6 @@ bookmark.delete.chat.address = Group Chat Address:
bookmark.delete.chat.users = Users:
bookmark.delete.chat.groups = Groups:
bookmark.delete.chat.autojoin = Auto-Join:
bookmark.delete.chat.nameasnick = Name as a nick:
bookmark.delete.chat.submit = Delete
bookmark.delete.chat.cancel = Cancel
\ No newline at end of file
......@@ -27,6 +27,7 @@ import org.jivesoftware.openfire.interceptor.InterceptorManager;
import org.jivesoftware.openfire.interceptor.PacketInterceptor;
import org.jivesoftware.openfire.interceptor.PacketRejectedException;
import org.jivesoftware.openfire.session.Session;
import org.jivesoftware.openfire.user.User;
import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.slf4j.Logger;
......@@ -198,6 +199,12 @@ public class BookmarkInterceptor implements PacketInterceptor {
boolean autojoin = Boolean.valueOf(bookmark.getProperty("autojoin"));
conferenceElement.addAttribute("autojoin", Boolean.toString(autojoin));
conferenceElement.addAttribute("jid", bookmark.getValue());
boolean nameasnick = Boolean.valueOf(bookmark.getProperty("nameasnick"));
if (nameasnick) {
User currentUser = userManager.getUser(jid.getNode());
Element nick = conferenceElement.addElement("nick");
nick.addText(currentUser.getName());
}
}
appendSharedElement(conferenceElement);
......
......@@ -127,6 +127,10 @@ else { %>
<tr>
<td><b><fmt:message key="bookmark.delete.chat.autojoin" /></b></td>
<td><%= bookmark.getProperty("autojoin") != null ? "<img src='/images/check.gif'>" : "&nbsp;"%></td>
</tr>
<tr>
<td><b><fmt:message key="bookmark.delete.chat.nameasnick" /></b></td>
<td><%= bookmark.getProperty("nameasnick") != null ? "<img src='/images/check.gif'>" : "&nbsp;"%></td>
</tr>
<tr>
<td></td>
......
......@@ -45,6 +45,7 @@
String groupchatJID = request.getParameter("groupchatJID");
boolean autojoin = ParamUtils.getBooleanParameter(request,"autojoin");
boolean nameAsNick = ParamUtils.getBooleanParameter(request,"nameasnick");
String users = request.getParameter("users");
String groups = request.getParameter("groups");
......@@ -94,6 +95,7 @@
else {
groupchatName = editBookmark.getName();
autojoin = editBookmark.getProperty("autojoin") != null;
nameAsNick = editBookmark.getProperty("nameasnick") != null;
groupchatJID = editBookmark.getValue();
}
......@@ -175,17 +177,23 @@
if (isRSS) {
bookmark.setProperty("rss", "true");
}
else {
else {
bookmark.deleteProperty("rss");
}
}
}
else {
if (autojoin) {
bookmark.setProperty("autojoin", "true");
}
else {
bookmark.deleteProperty("autojoin");
}
else {
bookmark.deleteProperty("autojoin");
}
if (nameAsNick) {
bookmark.setProperty("nameasnick", "true");
}
else {
bookmark.deleteProperty("nameasnick");
}
}
}
}
......@@ -366,6 +374,10 @@ else { %>
<tr>
<td><b><fmt:message key="group.chat.bookmark.autojoin" />:</b></td><td><input type="checkbox" name="autojoin" <%= autojoin ? "checked" : "" %>/></td>
</tr>
<tr>
<td><b><fmt:message key="group.chat.bookmark.nameasnick" />:</b></td><td><input type="checkbox" name="nameasnick" <%= nameAsNick ? "checked" : "" %>/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="createGroupchatBookmark" value="<%= editBookmark != null ? LocaleUtils.getLocalizedString("bookmark.save.changes", "clientcontrol") : LocaleUtils.getLocalizedString("create", "clientcontrol") %>"/>&nbsp;
......
......@@ -53,7 +53,7 @@
<div class="div-border" style="padding: 12px; width: 95%;">
<table class="jive-table" cellspacing="0" width="100%">
<th><fmt:message key="group.chat.bookmark.name" /></th><th><fmt:message key="group.chat.bookmark.address"/></th><th><fmt:message key="users" /></th><th><fmt:message key="groups" /></th><th><fmt:message key="group.chat.bookmark.autojoin" /></th><th><fmt:message key="options" /></th>
<th><fmt:message key="group.chat.bookmark.name" /></th><th><fmt:message key="group.chat.bookmark.address"/></th><th><fmt:message key="users" /></th><th><fmt:message key="groups" /></th><th><fmt:message key="group.chat.bookmark.autojoin" /></th><th><fmt:message key="group.chat.bookmark.nameasnick" /></th><th><fmt:message key="options" /></th>
<%
boolean hasBookmarks = false;
for (Bookmark bookmark : bookmarks) {
......@@ -80,6 +80,7 @@
<td><%= users%></td>
<td><%= groups%></td>
<td><%= bookmark.getProperty("autojoin") != null ? "<img src='/images/check.gif'>" : "&nbsp;"%></td>
<td><%= bookmark.getProperty("nameasnick") != null ? "<img src='/images/check.gif'>" : "&nbsp;"%></td>
<td>
<a href="create-bookmark.jsp?edit=true&bookmarkID=<%= bookmark.getBookmarkID()%>"><img src="/images/edit-16x16.gif" border="0" width="16" height="16" alt="Edit Bookmark"/></a>
<a href="confirm-bookmark-delete.jsp?bookmarkID=<%= bookmark.getBookmarkID()%>"><img src="/images/delete-16x16.gif" border="0" width="16" height="16" alt="Delete Bookmark"/></a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment