Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
6e102ccf
Commit
6e102ccf
authored
May 12, 2014
by
Dele Olajide
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jitsi Videobridge plugin - Fixing issue with importing videobridge plugin into eclipse
parent
9238a7b8
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
390 deletions
+0
-390
src.zip
src/plugins/jitsivideobridge/src/apps/spark/src.zip
+0
-0
jitsi_logo16x16.png
...dge/src/apps/spark/src/classes/images/jitsi_logo16x16.png
+0
-0
BareBonesBrowserLaunch.class
...park/plugin/jitsivideobridge/BareBonesBrowserLaunch.class
+0
-0
BareBonesBrowserLaunch.java
...spark/plugin/jitsivideobridge/BareBonesBrowserLaunch.java
+0
-97
ChatRoomDecorator$1.class
...e/spark/plugin/jitsivideobridge/ChatRoomDecorator$1.class
+0
-0
ChatRoomDecorator.class
...are/spark/plugin/jitsivideobridge/ChatRoomDecorator.class
+0
-0
ChatRoomDecorator.java
...ware/spark/plugin/jitsivideobridge/ChatRoomDecorator.java
+0
-105
JitsiVideobridgePlugin.class
...park/plugin/jitsivideobridge/JitsiVideobridgePlugin.class
+0
-0
JitsiVideobridgePlugin.java
...spark/plugin/jitsivideobridge/JitsiVideobridgePlugin.java
+0
-188
No files found.
src/plugins/jitsivideobridge/src/apps/spark/src.zip
0 → 100644
View file @
6e102ccf
File added
src/plugins/jitsivideobridge/src/apps/spark/src/classes/images/jitsi_logo16x16.png
deleted
100644 → 0
View file @
9238a7b8
883 Bytes
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/BareBonesBrowserLaunch.class
deleted
100644 → 0
View file @
9238a7b8
File deleted
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/BareBonesBrowserLaunch.java
deleted
100644 → 0
View file @
9238a7b8
/**
* $RCSfile: ,v $
* $Revision: $
* $Date: $
*
* Copyright (C) 2004-2010 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* <b>Bare Bones Browser Launch for Java</b><br>
* Utility class to open a web page from a Swing application
* in the user's default browser.<br>
* Supports: Mac OS X, GNU/Linux, Unix, Windows XP/Vista/7<br>
* Example Usage:<code><br>
* String url = "http://www.google.com/";<br>
* BareBonesBrowserLaunch.openURL(int width, int height, String url, String title);<br></code>
* Latest Version: <a href="http://www.centerkey.com/java/browser/">www.centerkey.com/java/browser</a><br>
* Author: Dem Pilafian<br>
* Public Domain Software -- Free to Use as You Like
* @version 3.1, June 6, 2010
*/
package
org
.
jivesoftware
.
spark
.
plugin
.
jitsivideobridge
;
import
java.awt.BorderLayout
;
import
java.awt.Component
;
import
java.awt.event.*
;
import
javax.swing.*
;
import
java.util.*
;
import
org.jivesoftware.spark.SparkManager
;
import
org.jivesoftware.spark.component.browser.*
;
import
org.jivesoftware.spark.util.log.*
;
public
class
BareBonesBrowserLaunch
{
static
final
String
[]
browsers
=
{
"google-chrome"
,
"firefox"
,
"opera"
,
"epiphany"
,
"konqueror"
,
"conkeror"
,
"midori"
,
"kazehakase"
,
"mozilla"
};
static
final
String
errMsg
=
"Error attempting to launch web browser"
;
/**
* Opens the specified web page in the user's default browser
* @param url A web address (URL) of a web page (ex: "http://www.google.com/")
*/
public
static
void
openURL
(
String
url
)
{
Log
.
warning
(
"BareBonesBrowserLaunch.openURL: "
+
url
);
String
osName
=
System
.
getProperty
(
"os.name"
).
toLowerCase
();
try
{
if
(
osName
.
startsWith
(
"mac os"
))
{
Class
.
forName
(
"com.apple.eio.FileManager"
).
getDeclaredMethod
(
"openURL"
,
new
Class
[]
{
String
.
class
}).
invoke
(
null
,
new
Object
[]
{
url
});
}
else
if
(
osName
.
startsWith
(
"windows"
))
{
Runtime
.
getRuntime
().
exec
(
"rundll32 url.dll,FileProtocolHandler "
+
url
);
}
else
{
//assume Unix or Linux
String
browser
=
null
;
for
(
String
b
:
browsers
)
{
if
(
browser
==
null
&&
Runtime
.
getRuntime
().
exec
(
new
String
[]
{
"which"
,
b
}).
getInputStream
().
read
()
!=
-
1
)
{
Runtime
.
getRuntime
().
exec
(
new
String
[]
{
browser
=
b
,
url
});
}
}
if
(
browser
==
null
)
{
throw
new
Exception
(
Arrays
.
toString
(
browsers
));
}
}
}
catch
(
Exception
e
)
{
Log
.
warning
(
"BareBonesBrowserLaunch.openURL: error "
+
e
);
JOptionPane
.
showMessageDialog
(
null
,
errMsg
+
"\n"
+
e
.
toString
());
}
}
}
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/ChatRoomDecorator$1.class
deleted
100644 → 0
View file @
9238a7b8
File deleted
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/ChatRoomDecorator.class
deleted
100644 → 0
View file @
9238a7b8
File deleted
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/ChatRoomDecorator.java
deleted
100644 → 0
View file @
9238a7b8
/**
* $RCSfile: ,v $
* $Revision: $
* $Date: $
*
* Copyright (C) 2004-2010 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
jivesoftware
.
spark
.
plugin
.
jitsivideobridge
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
javax.swing.ImageIcon
;
import
org.jivesoftware.spark.SparkManager
;
import
org.jivesoftware.spark.component.RolloverButton
;
import
org.jivesoftware.spark.ui.ChatRoom
;
import
org.jivesoftware.spark.util.*
;
import
org.jivesoftware.spark.util.log.*
;
import
org.jivesoftware.smack.*
;
import
org.jivesoftware.smack.packet.*
;
public
class
ChatRoomDecorator
{
public
RolloverButton
jitsivideobridgeButton
;
public
ChatRoom
room
;
private
final
String
url
;
public
ChatRoomDecorator
(
final
ChatRoom
room
,
final
String
url
)
{
this
.
room
=
room
;
this
.
url
=
url
;
ClassLoader
cl
=
getClass
().
getClassLoader
();
ImageIcon
jitsivideobridgeIcon
=
new
ImageIcon
(
cl
.
getResource
(
"images/jitsi_logo16x16.png"
));
jitsivideobridgeButton
=
new
RolloverButton
(
jitsivideobridgeIcon
);
jitsivideobridgeButton
.
setToolTipText
(
GraphicUtils
.
createToolTip
(
"Jitsi Videobridge"
));
final
String
roomId
=
getNode
(
room
.
getRoomname
());
final
String
sessionID
=
roomId
+
"-"
+
SparkManager
.
getConnection
().
getConnectionID
();
final
String
nickname
=
getNode
(
org
.
jivesoftware
.
smack
.
util
.
StringUtils
.
parseBareAddress
(
SparkManager
.
getSessionManager
().
getJID
()));
jitsivideobridgeButton
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
event
)
{
String
newUrl
;
if
(
"groupchat"
.
equals
(
room
.
getChatType
().
toString
()))
{
newUrl
=
url
+
"r="
+
roomId
;
sendInvite
(
room
.
getRoomname
(),
newUrl
,
Message
.
Type
.
groupchat
);
}
else
{
newUrl
=
url
+
"r="
+
sessionID
;
sendInvite
(
room
.
getRoomname
(),
newUrl
,
Message
.
Type
.
chat
);
}
BareBonesBrowserLaunch
.
openURL
(
newUrl
);
}
});
room
.
getEditorBar
().
add
(
jitsivideobridgeButton
);
}
public
void
finished
()
{
Log
.
warning
(
"ChatRoomDecorator: finished "
+
room
.
getRoomname
());
}
private
String
getNode
(
String
jid
)
{
String
node
=
jid
;
int
pos
=
node
.
indexOf
(
"@"
);
if
(
pos
>
-
1
)
node
=
jid
.
substring
(
0
,
pos
);
return
node
;
}
private
void
sendInvite
(
String
jid
,
String
url
,
Message
.
Type
type
)
{
Message
message2
=
new
Message
();
message2
.
setTo
(
jid
);
message2
.
setType
(
type
);
message2
.
setBody
(
url
);
SparkManager
.
getConnection
().
sendPacket
(
message2
);
}
}
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/JitsiVideobridgePlugin.class
deleted
100644 → 0
View file @
9238a7b8
File deleted
src/plugins/jitsivideobridge/src/apps/spark/src/classes/org/jivesoftware/spark/plugin/jitsivideobridge/JitsiVideobridgePlugin.java
deleted
100644 → 0
View file @
9238a7b8
/**
* $RCSfile: ,v $
* $Revision: $
* $Date: $
*
* Copyright (C) 2004-2010 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
jivesoftware
.
spark
.
plugin
.
jitsivideobridge
;
import
java.awt.*
;
import
java.awt.event.*
;
import
javax.swing.*
;
import
java.util.*
;
import
java.io.*
;
import
java.net.*
;
import
org.jivesoftware.Spark
;
import
org.jivesoftware.spark.*
;
import
org.jivesoftware.spark.component.*
;
import
org.jivesoftware.spark.component.browser.*
;
import
org.jivesoftware.spark.plugin.*
;
import
org.jivesoftware.spark.ui.rooms.*
;
import
org.jivesoftware.spark.ui.*
;
import
org.jivesoftware.spark.util.*
;
import
org.jivesoftware.smack.*
;
import
org.jivesoftware.spark.util.log.*
;
public
class
JitsiVideobridgePlugin
implements
Plugin
,
ChatRoomListener
{
private
org
.
jivesoftware
.
spark
.
ChatManager
chatManager
;
private
ImageIcon
jitsivideobridgeIcon
;
private
String
protocol
=
"https"
;
private
String
server
=
null
;
private
String
port
=
"7443"
;
private
String
url
=
null
;
private
static
File
pluginsettings
=
new
File
(
System
.
getProperty
(
"user.home"
)
+
System
.
getProperty
(
"file.separator"
)
+
"Spark"
+
System
.
getProperty
(
"file.separator"
)
+
"jitsivideobridge.properties"
);
private
Map
<
String
,
ChatRoomDecorator
>
decorators
=
new
HashMap
<
String
,
ChatRoomDecorator
>();
public
JitsiVideobridgePlugin
()
{
ClassLoader
cl
=
getClass
().
getClassLoader
();
jitsivideobridgeIcon
=
new
ImageIcon
(
cl
.
getResource
(
"images/jitsi_logo16x16.png"
));
}
public
void
initialize
()
{
chatManager
=
SparkManager
.
getChatManager
();
server
=
SparkManager
.
getSessionManager
().
getServerAddress
();
url
=
protocol
+
"://"
+
server
+
":"
+
port
+
"/jitsi/apps/ofmeet/?"
;
Properties
props
=
new
Properties
();
if
(
pluginsettings
.
exists
())
{
Log
.
warning
(
"JitsiVideobridge-Info: Properties-file does exist= "
+
pluginsettings
.
getPath
());
try
{
props
.
load
(
new
FileInputStream
(
pluginsettings
));
if
(
props
.
getProperty
(
"port"
)
!=
null
)
{
port
=
props
.
getProperty
(
"port"
);
Log
.
warning
(
"JitsiVideobridge-Info: JitsiVideobridge-port from properties-file is= "
+
port
);
}
if
(
props
.
getProperty
(
"protocol"
)
!=
null
)
{
protocol
=
props
.
getProperty
(
"protocol"
);
Log
.
warning
(
"JitsiVideobridge-Info: JitsiVideobridge-protocol from properties-file is= "
+
protocol
);
}
if
(
props
.
getProperty
(
"server"
)
!=
null
)
{
server
=
props
.
getProperty
(
"server"
);
Log
.
warning
(
"JitsiVideobridge-Info: JitsiVideobridge-server from properties-file is= "
+
server
);
}
url
=
protocol
+
"://"
+
server
+
":"
+
port
+
"/jitsi/apps/ofmeet/?"
;
}
catch
(
IOException
ioe
)
{
System
.
err
.
println
(
ioe
);
//TODO handle error better.
}
}
else
{
Log
.
warning
(
"JitsiVideobridge-Error: Properties-file does not exist= "
+
pluginsettings
.
getPath
()
+
", using default "
+
url
);
}
chatManager
.
addChatRoomListener
(
this
);
}
public
void
shutdown
()
{
try
{
Log
.
warning
(
"shutdown"
);
chatManager
.
removeChatRoomListener
(
this
);
}
catch
(
Exception
e
)
{
Log
.
warning
(
"shutdown "
+
e
);
}
}
public
boolean
canShutDown
()
{
return
true
;
}
public
void
uninstall
()
{
}
public
void
chatRoomLeft
(
ChatRoom
chatroom
)
{
}
public
void
chatRoomClosed
(
ChatRoom
chatroom
)
{
String
roomId
=
chatroom
.
getRoomname
();
Log
.
warning
(
"chatRoomClosed: "
+
roomId
);
if
(
decorators
.
containsKey
(
roomId
))
{
ChatRoomDecorator
decorator
=
decorators
.
remove
(
roomId
);
decorator
.
finished
();
decorator
=
null
;
}
}
public
void
chatRoomActivated
(
ChatRoom
chatroom
)
{
String
roomId
=
chatroom
.
getRoomname
();
Log
.
warning
(
"chatRoomActivated: "
+
roomId
);
}
public
void
userHasJoined
(
ChatRoom
room
,
String
s
)
{
String
roomId
=
room
.
getRoomname
();
Log
.
warning
(
"userHasJoined: "
+
roomId
+
" "
+
s
);
}
public
void
userHasLeft
(
ChatRoom
room
,
String
s
)
{
String
roomId
=
room
.
getRoomname
();
Log
.
warning
(
"userHasLeft: "
+
roomId
+
" "
+
s
);
}
public
void
chatRoomOpened
(
final
ChatRoom
room
)
{
String
roomId
=
room
.
getRoomname
();
Log
.
warning
(
"chatRoomOpened: "
+
roomId
);
if
(
roomId
.
indexOf
(
'/'
)
==
-
1
)
{
decorators
.
put
(
roomId
,
new
ChatRoomDecorator
(
room
,
url
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment