aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/http/www/Home.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-01-14 12:16:49 +0300
committerGravatar Vitaly Takmazov2016-01-14 12:16:49 +0300
commitc492429b25c1ef711620a4f509975c7edc3ffa4a (patch)
tree5bc6b5746381d970760cd6ae5c5561e66a1f95e7 /src/main/java/com/juick/http/www/Home.java
parent7e93e142b6dd75c22c057962447eec014c4e15b4 (diff)
Update libraries and refactoring
Diffstat (limited to 'src/main/java/com/juick/http/www/Home.java')
-rw-r--r--src/main/java/com/juick/http/www/Home.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/com/juick/http/www/Home.java b/src/main/java/com/juick/http/www/Home.java
index 20752a40..8dc3e70c 100644
--- a/src/main/java/com/juick/http/www/Home.java
+++ b/src/main/java/com/juick/http/www/Home.java
@@ -24,6 +24,7 @@ import java.io.PrintWriter;
import java.net.URLEncoder;
import java.sql.Connection;
import java.util.ArrayList;
+import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -50,7 +51,7 @@ public class Home {
}
String title;
- ArrayList<Integer> mids;
+ List<Integer> mids;
String paramShow = request.getParameter("show");
if (paramSearch != null) {
@@ -68,27 +69,27 @@ public class Home {
return;
} else if (paramShow.equals("my") && visitor != null) {
title = "Моя лента";
- mids = MessagesQueries.getMyFeed(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getMyFeed(sql, visitor.getUID(), paramBefore);
} else if (paramShow.equals("private") && visitor != null) {
title = "Приватные";
- mids = MessagesQueries.getPrivate(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getPrivate(sql, visitor.getUID(), paramBefore);
} else if (paramShow.equals("discuss") && visitor != null) {
title = "Обсуждения";
- mids = MessagesQueries.getDiscussions(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getDiscussions(sql, visitor.getUID(), paramBefore);
} else if (paramShow.equals("recommended") && visitor != null) {
title = "Рекомендации";
- mids = MessagesQueries.getRecommended(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getRecommended(sql, visitor.getUID(), paramBefore);
} else if (paramShow.equals("photos")) {
title = "Фотографии";
if (visitor != null) {
- mids = MessagesQueries.getPhotos(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getPhotos(sql, visitor.getUID(), paramBefore);
} else {
mids = MessagesQueries.getPhotos(sql, 0, paramBefore);
}
} else if (paramShow.equals("all")) {
title = "Все сообщения";
if (visitor != null) {
- mids = MessagesQueries.getAll(sql, visitor.UID, paramBefore);
+ mids = MessagesQueries.getAll(sql, visitor.getUID(), paramBefore);
} else {
mids = MessagesQueries.getAll(sql, 0, paramBefore);
}
@@ -130,7 +131,7 @@ public class Home {
if (mids.size() > 0) {
int ad_mid = 0;
if (paramShow == null || paramShow.equals("top") || paramShow.equals("all")) {
- int vuid = visitor != null ? visitor.UID : 0;
+ int vuid = visitor != null ? visitor.getUID() : 0;
ad_mid = AdsQueries.getAdMID(sql, vuid);
if (ad_mid > 0 && mids.indexOf(ad_mid) == -1) {
mids.add(0, ad_mid);