mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-19 13:01:17 +01:00
cleanup
This commit is contained in:
parent
5f5445e757
commit
a2b53d7527
@ -78,14 +78,6 @@ public interface Connection {
|
|||||||
*/
|
*/
|
||||||
User showUser(long id) throws ConnectionException;
|
User showUser(long id) throws ConnectionException;
|
||||||
|
|
||||||
/**
|
|
||||||
* lookup user and return user information
|
|
||||||
*
|
|
||||||
* @param name screen name of the user
|
|
||||||
* @return user information
|
|
||||||
*/
|
|
||||||
User showUser(String name) throws ConnectionException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* search for users matching a search string
|
* search for users matching a search string
|
||||||
*
|
*
|
||||||
|
@ -267,18 +267,6 @@ public class Mastodon implements Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public User showUser(String name) throws MastodonException {
|
|
||||||
List<String> params = new ArrayList<>();
|
|
||||||
params.add("acct=" + StringUtils.encode(name));
|
|
||||||
try {
|
|
||||||
return createUser(get(ENDPOINT_LOOKUP_USER, params));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new MastodonException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Users searchUsers(String search, long page) throws MastodonException {
|
public Users searchUsers(String search, long page) throws MastodonException {
|
||||||
List<String> params = new ArrayList<>();
|
List<String> params = new ArrayList<>();
|
||||||
@ -1446,6 +1434,22 @@ public class Mastodon implements Connection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get user by screen name
|
||||||
|
*
|
||||||
|
* @param name screen name (@username)
|
||||||
|
* @return user instance
|
||||||
|
*/
|
||||||
|
private User showUser(String name) throws MastodonException {
|
||||||
|
List<String> params = new ArrayList<>();
|
||||||
|
params.add("acct=" + StringUtils.encode(name));
|
||||||
|
try {
|
||||||
|
return createUser(get(ENDPOINT_LOOKUP_USER, params));
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new MastodonException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get information about the current user
|
* get information about the current user
|
||||||
*
|
*
|
||||||
@ -1802,7 +1806,7 @@ public class Mastodon implements Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create get response with user bearer token
|
* create get response with current bearer token
|
||||||
*
|
*
|
||||||
* @param endpoint endpoint to use
|
* @param endpoint endpoint to use
|
||||||
* @param params additional parameters
|
* @param params additional parameters
|
||||||
@ -1830,7 +1834,7 @@ public class Mastodon implements Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create post response with user bearer token
|
* create post response with current bearer token
|
||||||
*
|
*
|
||||||
* @param endpoint endpoint to use
|
* @param endpoint endpoint to use
|
||||||
* @param params additional parameters
|
* @param params additional parameters
|
||||||
|
@ -24,6 +24,7 @@ public class PushNotificationReceiver extends MessagingReceiver implements Async
|
|||||||
@Override
|
@Override
|
||||||
public void onMessage(@NonNull Context context, @NonNull byte[] message, @NonNull String instance) {
|
public void onMessage(@NonNull Context context, @NonNull byte[] message, @NonNull String instance) {
|
||||||
GlobalSettings settings = GlobalSettings.get(context);
|
GlobalSettings settings = GlobalSettings.get(context);
|
||||||
|
// check if received push notification is intended for the current login
|
||||||
if (settings.isLoggedIn() && settings.pushEnabled() && settings.getLogin().getConfiguration().isWebpushSupported() && settings.getPushInstance().equals(instance)) {
|
if (settings.isLoggedIn() && settings.pushEnabled() && settings.getLogin().getConfiguration().isWebpushSupported() && settings.getPushInstance().equals(instance)) {
|
||||||
NotificationLoader loader = new NotificationLoader(context);
|
NotificationLoader loader = new NotificationLoader(context);
|
||||||
NotificationLoader.Param param = new NotificationLoader.Param(NotificationLoader.Param.LOAD_UNREAD, 0, 0L, 0L);
|
NotificationLoader.Param param = new NotificationLoader.Param(NotificationLoader.Param.LOAD_UNREAD, 0, 0L, 0L);
|
||||||
|
Loading…
Reference in New Issue
Block a user