Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
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
solo-1
Commits
1eec69ba
Unverified
Commit
1eec69ba
authored
May 15, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Fix #12778
parent
984b0267
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
19 deletions
+6
-19
src/main/java/org/b3log/solo/processor/FeedProcessor.java
src/main/java/org/b3log/solo/processor/FeedProcessor.java
+4
-4
src/main/java/org/b3log/solo/service/CommentMgmtService.java
src/main/java/org/b3log/solo/service/CommentMgmtService.java
+1
-3
src/main/java/org/b3log/solo/util/Emotions.java
src/main/java/org/b3log/solo/util/Emotions.java
+1
-12
No files found.
src/main/java/org/b3log/solo/processor/FeedProcessor.java
View file @
1eec69ba
...
...
@@ -17,6 +17,7 @@
*/
package
org
.
b3log
.
solo
.
processor
;
import
com.vdurmont.emoji.EmojiParser
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.ioc.Inject
;
...
...
@@ -43,7 +44,6 @@ import org.b3log.solo.model.rss.Item;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.service.ArticleQueryService
;
import
org.b3log.solo.service.OptionQueryService
;
import
org.b3log.solo.util.Emotions
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
...
...
@@ -59,7 +59,7 @@ import java.util.List;
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="https://github.com/feroozkhanchintu">feroozkhanchintu</a>
* @author <a href="https://github.com/nanolikeyou">nanolikeyou</a>
* @version 2.0.0.
1, Dec 3, 2018
* @version 2.0.0.
2, May 15, 2019
* @since 0.3.1
*/
@RequestProcessor
...
...
@@ -228,12 +228,12 @@ public class FeedProcessor {
final
JSONObject
article
=
articles
.
getJSONObject
(
i
);
final
Item
ret
=
new
Item
();
String
title
=
article
.
getString
(
Article
.
ARTICLE_TITLE
);
title
=
Emo
tions
.
t
oAliases
(
title
);
title
=
Emo
jiParser
.
parseT
oAliases
(
title
);
ret
.
setTitle
(
title
);
String
description
=
isFullContent
?
article
.
getString
(
Article
.
ARTICLE_CONTENT
)
:
article
.
optString
(
Article
.
ARTICLE_ABSTRACT
);
description
=
Emo
tions
.
t
oAliases
(
description
);
description
=
Emo
jiParser
.
parseT
oAliases
(
description
);
ret
.
setDescription
(
description
);
final
long
pubDate
=
article
.
getLong
(
Article
.
ARTICLE_UPDATED
);
ret
.
setPubDate
(
new
Date
(
pubDate
));
...
...
src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
1eec69ba
...
...
@@ -48,7 +48,7 @@ import java.util.Date;
* Comment management service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.4.0.
1, Apr 19
, 2019
* @version 1.4.0.
2, May 15
, 2019
* @since 0.3.5
*/
@Service
...
...
@@ -210,8 +210,6 @@ public class CommentMgmtService {
}
ret
.
put
(
Keys
.
STATUS_CODE
,
true
);
commentContent
=
Emotions
.
toAliases
(
commentContent
);
requestJSONObject
.
put
(
Comment
.
COMMENT_CONTENT
,
commentContent
);
return
ret
;
...
...
src/main/java/org/b3log/solo/util/Emotions.java
View file @
1eec69ba
...
...
@@ -17,7 +17,6 @@
*/
package
org
.
b3log
.
solo
.
util
;
import
com.vdurmont.emoji.EmojiParser
;
import
org.b3log.latke.Latkes
;
import
java.util.regex.Pattern
;
...
...
@@ -26,7 +25,7 @@ import java.util.regex.Pattern;
* Emotions utilities.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
0.0.2, Mar
5, 2019
* @version 1.
1.0.0, Mar 1
5, 2019
* @since 1.4.0
*/
public
final
class
Emotions
{
...
...
@@ -36,16 +35,6 @@ public final class Emotions {
*/
public
static
final
Pattern
EMOJI_PATTERN
=
Pattern
.
compile
(
":.+:"
);
/**
* Replaces the emoji's unicode occurrences by one of their alias (between 2 ':'). Example: "😄" gives ":smile:".
*
* @param content the string to parse
* @return the string with the emojis replaced by their alias.
*/
public
static
String
toAliases
(
final
String
content
)
{
return
EmojiParser
.
parseToAliases
(
content
,
EmojiParser
.
FitzpatrickAction
.
IGNORE
);
}
/**
* Converts the specified content with emotions.
* <p>
...
...
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