MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / menuAction

Method menuAction

src/main/java/Conference/ConferenceForm.java:182–245  ·  view source on GitHub ↗
(MenuCommand c, VirtualList d)

Source from the content-addressed store, hash-verified

180 }
181
182 public void menuAction(MenuCommand c, VirtualList d) {
183 super.menuAction(c, d);
184
185 String nick = nickField.getValue();
186 String name = nameField.getValue();
187 String host = hostField.getValue();
188 String room = roomField.getValue();
189 String pass = passField.getValue();
190 int msgLimit = Integer.parseInt(msgLimitField.getValue());
191
192 boolean autojoin = autoJoin.getValue();
193
194 if (nick.length() == 0) {
195 return;
196 }
197 if (room.length() == 0) {
198 return;
199 }
200 if (host.length() == 0) {
201 return;
202 }
203
204 StringBuffer gchat = new StringBuffer(room.trim()).append('@').append(host.trim());
205
206 if (name.length() == 0) {
207 name = gchat.toString();
208 }
209
210 saveMsgCount(msgLimit);
211
212 if (c == cmdEdit) {
213 sd.account.bookmarks.removeElement(editConf);
214 Bookmark newItem = new Bookmark(name, gchat.toString(), nick, pass, autojoin);
215 BookmarkItem item = new BookmarkItem(newItem);
216 if (cursor < sd.account.bookmarks.size()) {
217 sd.account.bookmarks.insertElementAt(newItem, cursor);
218 } else {
219 sd.account.bookmarks.addElement(newItem);
220 }
221 sd.getTheStream().addBlockListener(new BookmarkQuery(BookmarkQuery.SAVE));
222 destroyView();
223 } else if (c == cmdAdd) {
224 new Bookmarks(new BookmarkItem(new Bookmark(name, gchat.toString(), nick, pass, autojoin)));
225 } else if (c == cmdJoin) {
226//#ifdef PRIVACY
227 if (!sd.account.isGoogle) {
228 if (QuickPrivacy.conferenceList == null) {
229 QuickPrivacy.conferenceList = new Vector();
230 }
231 QuickPrivacy.conferenceList.addElement(host);
232 new QuickPrivacy().updateQuickPrivacyList();
233 }
234//#endif
235
236 try {
237 cf.defGcRoom = room + "@" + host;
238 cf.saveToStorage();
239 gchat.append('/').append(nick);

Callers

nothing calls this directly

Calls 14

saveMsgCountMethod · 0.95
joinMethod · 0.95
appendMethod · 0.80
addElementMethod · 0.80
getTheStreamMethod · 0.80
menuActionMethod · 0.65
getValueMethod · 0.45
toStringMethod · 0.45
sizeMethod · 0.45
addBlockListenerMethod · 0.45
destroyViewMethod · 0.45

Tested by

no test coverage detected