Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spark plugin for galene #842

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update to version 0.0.2
  • Loading branch information
deleolajide committed Jun 20, 2023
commit ff5799c43a6d50edf09736af70a303de42d0240c
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ public ChatRoomDecorator(final ChatRoom room, final SparkGalenePlugin plugin)
galeneButton = new RolloverButton(galeneIcon);
galeneButton.setToolTipText(GraphicUtils.createToolTip(SparkGaleneResource.getString("name")));
final String roomId = getNode(room.getBareJid().toString());
final String sessionID = roomId + "-" + System.currentTimeMillis();
final String sessionID = roomId + "/" + System.currentTimeMillis();

galeneButton.addActionListener(event -> {
String newUrl, newRoomId;

if ("groupchat".equals(room.getChatType().toString())) {
newRoomId = sessionID;
newUrl = plugin.url + "?group=" + newRoomId;
newUrl = plugin.url + "?room=" + newRoomId;
plugin.handleClick(newUrl, room, newUrl, Message.Type.groupchat);

} else {
newRoomId = sessionID;
newUrl = plugin.url + "?group=" + newRoomId;
newUrl = plugin.url + "?room=" + newRoomId;
plugin.handleClick(newUrl, room, newUrl, Message.Type.chat);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void messageReceived(ChatRoom room, Message message) {
String body = message.getBody();
int pos = body.indexOf("https://");

if ( pos > -1 && (body.contains("group=" + roomId + "-") || body.contains("/galene/")) ) {
if ( pos > -1 && (body.contains("room=" + roomId + "/") || body.contains("/galene/")) ) {
showInvitationAlert(message.getBody().substring(pos), room, roomId);
}

Expand Down Expand Up @@ -230,7 +230,7 @@ public void openURL(String newUrl)
String username = URLEncoder.encode(SparkManager.getSessionManager().getUsername(), "UTF-8");
String password = URLEncoder.encode(SparkManager.getSessionManager().getPassword(), "UTF-8");

electronThread = Spawn.startProcess(electronExePath + " --ignore-certificate-errors " + newUrl + "&username=" + username, new File(electronHomePath), new ProcessListener() {
electronThread = Spawn.startProcess(electronExePath + " --ignore-certificate-errors " + newUrl + "&username=" + username + "&password=" + password, new File(electronHomePath), new ProcessListener() {

public void onOutputLine(final String line) {
System.out.println(line);
Expand Down