From 1ce6bc55817129159b1cda5076d039e9c3bc8508 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 24 May 2016 14:43:49 +0300 Subject: fix telegram signup --- src/main/java/com/juick/server/UserQueries.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/server/UserQueries.java b/src/main/java/com/juick/server/UserQueries.java index 068f0c4b..c9f804cf 100644 --- a/src/main/java/com/juick/server/UserQueries.java +++ b/src/main/java/com/juick/server/UserQueries.java @@ -63,13 +63,13 @@ public class UserQueries { } return hash; } - public static String getSignUpHashByTelegramID(JdbcTemplate sql, Long telegramId) { + public static String getSignUpHashByTelegramID(JdbcTemplate sql, Long telegramId, String username) { try { return sql.queryForObject("SELECT loginhash FROM telegram WHERE tg_id=? AND user_id IS NULL", String.class, telegramId); } catch (EmptyResultDataAccessException e) { String hash = UUID.randomUUID().toString(); - sql.update("INSERT INTO telegram(tg_id, loginhash) VALUES (?, ?)", telegramId, hash); + sql.update("INSERT INTO telegram(tg_id, loginhash, tg_name) VALUES (?, ?, ?)", telegramId, hash, username); return hash; } } -- cgit v1.2.3