From 740ff53fb5648b15ad441ce9bd583395a16c4ef1 Mon Sep 17 00:00:00 2001 From: Max Franke Date: Tue, 8 Jun 2021 14:31:58 -0300 Subject: [PATCH] feat(streaming): bot's default avatar Set a default avatar to bot. Add the defaults methods to handle the new feature. --- .../bigbluebutton/api/ParamsProcessorUtil.java | 7 +++++++ .../org/bigbluebutton/api/domain/Meeting.java | 14 +++++++++++++- .../public/resources/images/bot-avatar.png | Bin 0 -> 977 bytes .../grails-app/conf/bigbluebutton.properties | 1 + .../grails-app/conf/spring/resources.xml | 1 + .../web/controllers/ApiController.groovy | 2 ++ 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 bigbluebutton-html5/public/resources/images/bot-avatar.png diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java index 54d2d85a41..6170d2bc4f 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/ParamsProcessorUtil.java @@ -77,6 +77,7 @@ public class ParamsProcessorUtil { private Integer defaultHttpSessionTimeout = 14400; private Boolean useDefaultAvatar = false; private String defaultAvatarURL; + private String defaultBotAvatarURL; private Boolean useDefaultWebcamBackground = false; private String defaultWebcamBackgroundURL; private String defaultGuestPolicy; @@ -783,6 +784,7 @@ public class ParamsProcessorUtil { } String avatarURL = useDefaultAvatar ? defaultAvatarURL : ""; + String botAvatarURL = defaultBotAvatarURL; String webcamBackgroundURL = useDefaultWebcamBackground ? defaultWebcamBackgroundURL : ""; if(defaultAllowDuplicateExtUserid == false) { @@ -803,6 +805,7 @@ public class ParamsProcessorUtil { .withTelVoice(telVoice).withWebVoice(webVoice) .withDialNumber(dialNumber) .withDefaultAvatarURL(avatarURL) + .withDefaultBotAvatarURL(botAvatarURL) .withDefaultWebcamBackgroundURL(webcamBackgroundURL) .withAutoStartRecording(autoStartRec) .withAllowStartStopRecording(allowStartStoptRec) @@ -1393,6 +1396,10 @@ public class ParamsProcessorUtil { this.defaultAvatarURL = url; } + public void setDefaultBotAvatarURL(String url) { + this.defaultBotAvatarURL = url; + } + public void setUseDefaultWebcamBackground(Boolean value) { this.useDefaultWebcamBackground = value; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index 04007338a7..9092238290 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -77,6 +77,7 @@ public class Meeting { private Integer maxPinnedCameras = 0; private String dialNumber; private String defaultAvatarURL; + private String defaultBotAvatarURL; private String defaultWebcamBackgroundURL; private Map plugins; private ArrayList pluginsManifests; @@ -153,7 +154,8 @@ public class Meeting { logoutUrl = builder.logoutUrl; logoutTimer = builder.logoutTimer; defaultAvatarURL = builder.defaultAvatarURL; - defaultWebcamBackgroundURL = builder.defaultWebcamBackgroundURL; + defaultBotAvatarURL = builder.defaultBotAvatarURL; + defaultWebcamBackgroundURL = builder.defaultWebcamBackgroundURL; record = builder.record; autoStartRecording = builder.autoStartRecording; allowStartStopRecording = builder.allowStartStopRecording; @@ -479,6 +481,10 @@ public class Meeting { return defaultAvatarURL; } + public String getDefaultBotAvatarURL() { + return defaultBotAvatarURL; + } + public String getDefaultWebcamBackgroundURL() { return defaultWebcamBackgroundURL; } @@ -960,6 +966,7 @@ public class Meeting { private Map metadata; private String dialNumber; private String defaultAvatarURL; + private String defaultBotAvatarURL; private String defaultWebcamBackgroundURL; private long createdTime; private boolean isBreakout; @@ -1113,6 +1120,11 @@ public class Meeting { return this; } + public Builder withDefaultBotAvatarURL(String w) { + defaultBotAvatarURL = w; + return this; + } + public Builder withDefaultWebcamBackgroundURL(String w) { defaultWebcamBackgroundURL = w; return this; diff --git a/bigbluebutton-html5/public/resources/images/bot-avatar.png b/bigbluebutton-html5/public/resources/images/bot-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..29fafa8959c39987e7ba08c776449fe63b387948 GIT binary patch literal 977 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE1xWt5x}*n4F(rAsyD`&P^1X)C{{1Gi%2ba4!+xb^mqeTHzN#PN^MmpHfc z$;v2|bO>zcla%GwjCe6&p>r!xNJhlU!m6a;&4LTA69Serd$0<8=DkkUjlG_^DtZ5(?y6OPWnSiLrELF`t$Doed*ud~sc)w4 zUw3$`1$WNW{YD9&Ue4>-Ar`@z;O)NEZ)=Xs|Hauauk82}cm0@J<5Qkw^`(9c%XA}T zd>NEAqCw=0jTW~SC){JrbPY?5^Sai5cbQ3QxYS8QbF;aR{9hcKpdNEM>Q~3E@>Bbl z+vNoRu4l|yrO!Br_1=2MsHyMonf-Im`?XK($A0dr2ZgsM7xmx1@UvsPoD0KKAbG^p z!B$+M^Dj?_45I)8V*>*R1B<|NPXF@%|G$_0s^zonShszPfBy3PjbEnmy?Og(?T@`n zovW??&S!Uhrz^X1`{wJ@*1cFW?Q7q=2uXSG{Ff*8&b>SNP||g)Eaz(zOKW`gE|sjZ zwswD=-rpXisu2Rm1OO#5#3h2c|4c3ANAu%2G?-P>7fB*VR9cO~W2 z6udu?bB|T_=?-qI>+_PMRx{6Ay1DQDd+(3u8V<)Cf2jR-7Eg(v9iN5O=02dl#`%o? zMf>LdT-(1@XVK-T%ge=%Eib-i_ALh=4|6j%>GK~?`n5Cq!TIUy3L;BVeY=7d!)@0$+cM5_16DSZ%RL%K7OqEzukjXe}8Yg9{*-~p`Zc-lL7-c+#iYjx$SxX zzF;w%0c#^D791FWk{WZInJm;8_LnK&s}f)|vB~@G6z3-I@G0_M#qA%)_Vpe7J$^6w z^>a0. + diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index 61467172cc..ddf26f5550 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -458,6 +458,8 @@ class ApiController { if (!StringUtils.isEmpty(params.avatarURL)) { us.avatarURL = params.avatarURL; + } else if (us.bot) { + us.avatarURL = meeting.defaultBotAvatarURL } else { us.avatarURL = meeting.defaultAvatarURL }